diff --git a/system-config/unipkg.sh b/system-config/unipkg.sh index 3a22fe7..a425d78 100755 --- a/system-config/unipkg.sh +++ b/system-config/unipkg.sh @@ -9,7 +9,7 @@ elif pkgmgr="$( which dnf )" 2> /dev/null; then $pkgmgr check-update; $pkgmgr install -y "$1" elif pkgmgr="$( which pacman )" 2> /dev/null; then echo "Arch-based" - $pkgmgr -Syy; yes | pkgmr -S "$1" + $pkgmgr -Syy;yes | $pkgmgr -S "$1" else echo "Package manager not found, please install $1" >&2 exit 1 diff --git a/xkeysnail-config/xkeystart.sh b/xkeysnail-config/xkeystart.sh index e590e39..bcfffb3 100755 --- a/xkeysnail-config/xkeystart.sh +++ b/xkeysnail-config/xkeystart.sh @@ -1,9 +1,19 @@ #!/bin/bash # >/dev/null 2>&1 -/usr/local/bin/xkeysnail --quiet --watch "$1" & + +if [ -f /usr/local/bin/xkeysnail ];then + xkeyfullpath="/usr/local/bin/xkeysnail" +elif [ -f /usr/bin/xkeysnail ];then + xkeyfullpath="/usr/bin/xkeysnail" +else + xkeyfullpath=`which xkeysnail` +fi + +"$xkeyfullpath" --quiet --watch "$1" & inotifywait -m -e close_write,moved_to,create,modify /tmp/kinto/xkeysnail | + while read -r path; do /usr/bin/killall xkeysnail - /usr/local/bin/xkeysnail --quiet --watch "$1" & + "$xkeyfullpath" --quiet --watch "$1" & done \ No newline at end of file diff --git a/xkeysnail_service.sh b/xkeysnail_service.sh index bbc5c37..e9ea046 100755 --- a/xkeysnail_service.sh +++ b/xkeysnail_service.sh @@ -116,6 +116,11 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 sudo ./system-config/unipkg.sh "$pydev" fi fi + if ! [ -x "$(command -v xhost)" ]; then + if [ "$distro" == "\"manjaro linux\"" ]; then + sudo ./system-config/unipkg.sh xorg-xhost + fi + fi # echo "Transferring files..." mkdir -p ~/.config/kinto @@ -170,10 +175,8 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 # if [ "$distro" == "fedora" ];then sudo rm /etc/systemd/system/xkeysnail.service if [ -d /usr/lib/systemd/system ];then - echo "1" xkeypath="/usr/lib/systemd/system/" elif [ -d /lib/systemd/system ];then - echo "2" xkeypath="/lib/systemd/system/" fi sudo mv ./xkeysnail-config/xkeysnail.service.new "$xkeypath"xkeysnail.service && echo "Service file added to "$xkeypath"xkeysnail.service"