- Updated xkeysnail installer to properly copy desktop autostart and to restart service on config file changes

This commit is contained in:
Ben Reaves
2020-04-21 17:39:20 -05:00
parent 3b802d1d49
commit c1e2db9a2e
5 changed files with 49 additions and 7 deletions

View File

@@ -15,6 +15,10 @@ if [ $# -eq 0 ]; then
fi
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
if ! [ -x "$(command -v inotifywait)" ]; then
echo "Will need to install inotify-tools to restart key remapper live for config file changes..."
sudo ./system-config/unipkg.sh inotify-tools
fi
# echo "Transferring files..."
mkdir -p ~/.config/kinto
@@ -23,9 +27,13 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
echo -e '#!/bin/sh\rxhost +SI:localuser:root' > ~/.kde/Autostart/kintohost.sh
chmod +x ~/.kde/Autostart/kintohost.sh
cp ./xkeysnail-config/kinto.py ./xkeysnail-config/kinto.py.new
cp ./xkeysnail-config/prexk.sh ~/.config/kinto/prexk.sh
cp ./xkeysnail-config/xkeysnail.service ./xkeysnail-config/xkeysnail.service.new
# KDE startup - xhost fix
yes | cp -rf ./xkeysnail-config/xkeysnail.desktop ~/.config/autostart/xkeysnail.desktop
yes | cp -rf ./xkeysnail-config/xkeystart.sh ~/.config/kinto/xkeystart.sh
yes | cp -rf ./xkeysnail-config/kinto.py ./xkeysnail-config/kinto.py.new
yes | cp -rf ./xkeysnail-config/prexk.sh ~/.config/kinto/prexk.sh
yes | cp -rf ./xkeysnail-config/xkeysnail.service ./xkeysnail-config/xkeysnail.service.new
sed -i "s/{username}/`whoami`/g" ./xkeysnail-config/xkeysnail.service.new
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ./xkeysnail-config/xkeysnail.service.new
else
@@ -55,9 +63,6 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
echo "Adding xhost fix..."
# KDE startup - xhost fix
cp ./xkeysnail-config/xkeysnail.desktop ~/.config/autostart/xkeysnail.desktop
LINE='xhost +SI:localuser:root'
if [ ! -e "~/.xprofile" ]; then