mirror of
https://github.com/rbreaves/kinto.git
synced 2025-08-05 18:38:26 +02:00
- WIP adding proper closing of xkeysnail on logoff
This commit is contained in:
6
xkeysnail-config/logoff.sh
Executable file
6
xkeysnail-config/logoff.sh
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
dbus-monitor --session "type='signal',interface='org.gnome.SessionManager.Logout'" | grep '1' |
|
||||||
|
while read x; do
|
||||||
|
echo "$x"
|
||||||
|
sudo systemctl stop xkeysnail
|
||||||
|
break
|
||||||
|
done
|
@@ -2,7 +2,7 @@
|
|||||||
Name=Kinto_xkey
|
Name=Kinto_xkey
|
||||||
GenericName=Kinto_xkey
|
GenericName=Kinto_xkey
|
||||||
Comment=Make Linux Type Like it's a Mac
|
Comment=Make Linux Type Like it's a Mac
|
||||||
Exec=/bin/bash -c "{xhost} +SI:localuser:root && sudo {systemctl} restart xkeysnail"
|
Exec=/bin/bash -c "{xhost} +SI:localuser:root && sudo {systemctl} restart xkeysnail && {homedir}/.config/kinto/logoff.sh"
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
X-GNOME-Autostart-enabled=true
|
X-GNOME-Autostart-enabled=true
|
@@ -4,9 +4,8 @@ Description=xkeysnail
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
KillMode=process
|
KillMode=process
|
||||||
ExecStartPre=/bin/bash -c "{xhost} +SI:localuser:root && /sbin/runuser -l {username} -c {homedir}/.config/kinto/prexk.sh"
|
ExecStart=/usr/bin/sudo /bin/bash -c '/usr/bin/xhost +SI:localuser:root && /usr/local/bin/xkeysnail --quiet --watch {homedir}/.config/kinto/kinto.py'
|
||||||
ExecStart=/usr/bin/sudo /bin/bash -c '{experimental-caret}{homedir}/.config/kinto/xkeystart.sh /tmp/kinto/xkeysnail/kinto.py'
|
ExecStop=/usr/bin/killall xkeysnail
|
||||||
ExecStop=/bin/bash -c 'me=$$;ps -ef | grep \'[t]mp/kinto\' | awk -v me=$me \'$2 != me {print $2}\' | xargs kill;/usr/bin/killall dbus-monitor;/usr/bin/killall xkeysnail;{kill-caret}'
|
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=3
|
RestartSec=3
|
||||||
Environment=DISPLAY={displayid}
|
Environment=DISPLAY={displayid}
|
||||||
|
@@ -181,21 +181,21 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
|||||||
* ) break;;
|
* ) break;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
branch=$(git rev-parse --abbrev-ref HEAD)
|
# branch=$(git rev-parse --abbrev-ref HEAD)
|
||||||
if [ "$branch" == "dev" ] || [ "$branch" == "alpha" ];then
|
# if [ "$branch" == "dev" ] || [ "$branch" == "alpha" ];then
|
||||||
while true; do
|
# while true; do
|
||||||
read -rep $'\nExperimental Support for Firefox/Chrome Back/Forward hotkeys (Cmd+Left/Right)?\n(Keys could get stuck, switch windows or press ctrl &/or super to release) (y/n)\n' yn
|
# read -rep $'\nExperimental Support for Firefox/Chrome Back/Forward hotkeys (Cmd+Left/Right)?\n(Keys could get stuck, switch windows or press ctrl &/or super to release) (y/n)\n' yn
|
||||||
case $yn in
|
# case $yn in
|
||||||
[Yy]* ) exp='/sbin/runuser -l {username} -c "export DISPLAY={displayid};{homedir}/.config/kinto/caret_status_xkey.sh\&";'; expsh='"{homedir}/.config/kinto/caret_status_xkey.sh"'; break;;
|
# [Yy]* ) exp='/sbin/runuser -l {username} -c "export DISPLAY={displayid};{homedir}/.config/kinto/caret_status_xkey.sh\&";'; expsh='"{homedir}/.config/kinto/caret_status_xkey.sh"'; break;;
|
||||||
[Nn]* ) exp=" "; expsh=" " break;;
|
# [Nn]* ) exp=" "; expsh=" " break;;
|
||||||
# * ) echo "Please answer yes or no.";;
|
# # * ) echo "Please answer yes or no.";;
|
||||||
esac
|
# esac
|
||||||
done
|
# done
|
||||||
else
|
# else
|
||||||
echo -e "\nSupport for Firefox/Chrome Back/Forward hotkeys (Cmd+Left/Right) disabled on $branch w/ xkeysnail \n"
|
# echo -e "\nSupport for Firefox/Chrome Back/Forward hotkeys (Cmd+Left/Right) disabled on $branch w/ xkeysnail \n"
|
||||||
exp=" "
|
exp=" "
|
||||||
expsh=" "
|
expsh=" "
|
||||||
fi
|
# fi
|
||||||
sudo systemctl enable xkeysnail >/dev/null 2>&1
|
sudo systemctl enable xkeysnail >/dev/null 2>&1
|
||||||
if ! [ -x "$(command -v inotifywait)" ]; then
|
if ! [ -x "$(command -v inotifywait)" ]; then
|
||||||
echo "Will need to install inotify-tools to restart key remapper live for config file changes..."
|
echo "Will need to install inotify-tools to restart key remapper live for config file changes..."
|
||||||
@@ -238,6 +238,7 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
|||||||
yes | cp -rf ./xkeysnail-config/xkeysnail.desktop ~/.config/autostart/xkeysnail.desktop
|
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/xkeystart.sh ~/.config/kinto/xkeystart.sh
|
||||||
|
yes | cp -rf ./xkeysnail-config/logoff.sh ~/.config/kinto/logoff.sh
|
||||||
yes | cp -rf ./xkeysnail-config/kinto.py ./xkeysnail-config/kinto.py.new
|
yes | cp -rf ./xkeysnail-config/kinto.py ./xkeysnail-config/kinto.py.new
|
||||||
yes | cp -rf ./xkeysnail-config/limitedadmins ./xkeysnail-config/limitedadmins.new
|
yes | cp -rf ./xkeysnail-config/limitedadmins ./xkeysnail-config/limitedadmins.new
|
||||||
yes | cp -rf ./xkeysnail-config/prexk.sh ~/.config/kinto/prexk.sh
|
yes | cp -rf ./xkeysnail-config/prexk.sh ~/.config/kinto/prexk.sh
|
||||||
@@ -260,6 +261,7 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
|||||||
sudo mv ./xkeysnail-config/limitedadmins.new /etc/sudoers.d/limitedadmins
|
sudo mv ./xkeysnail-config/limitedadmins.new /etc/sudoers.d/limitedadmins
|
||||||
sed -i "s#{systemctl}#`\\which systemctl`#g" ~/.config/autostart/xkeysnail.desktop
|
sed -i "s#{systemctl}#`\\which systemctl`#g" ~/.config/autostart/xkeysnail.desktop
|
||||||
sed -i "s#{xhost}#`\\which xhost`#g" ~/.config/autostart/xkeysnail.desktop
|
sed -i "s#{xhost}#`\\which xhost`#g" ~/.config/autostart/xkeysnail.desktop
|
||||||
|
sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/autostart/xkeysnail.desktop
|
||||||
sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/prexk.sh
|
sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/prexk.sh
|
||||||
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ./xkeysnail-config/xkeysnail.service.new
|
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ./xkeysnail-config/xkeysnail.service.new
|
||||||
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/kinto/prexk.sh
|
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/kinto/prexk.sh
|
||||||
|
Reference in New Issue
Block a user