mirror of
https://github.com/rbreaves/kinto.git
synced 2025-08-01 16:56:38 +02:00
- Added ability to kill xkeysnail duplicate processes
This commit is contained in:
19
xkeysnail-config/killdups.sh
Executable file
19
xkeysnail-config/killdups.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
xkeycount=$(pgrep 'xkeysnail' | wc -l)
|
||||
|
||||
if [[ $xkeycount -lt 1 ]]; then
|
||||
# No dups found
|
||||
exit 0
|
||||
fi
|
||||
|
||||
while ! zenity --entry --title="Kinto Duplicates" --text="Type Password to end duplicates:" --hide-text| sudo -S cat /dev/null >/dev/null; do
|
||||
if ! $(zenity --question --text="Wrong password, try again?"); then
|
||||
# Dups still exist
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
pgrep 'xkeysnail' | head -n -1 | xargs -r -n1 sudo kill
|
||||
sudo -K # remove privilege
|
||||
# No dups should exist
|
||||
exit 0
|
@@ -4,7 +4,7 @@ Description=xkeysnail
|
||||
[Service]
|
||||
Type=simple
|
||||
KillMode=process
|
||||
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 '/usr/bin/xhost +SI:localuser:root && {homedir}/.config/kinto/killdups.sh && /usr/local/bin/xkeysnail --quiet --watch {homedir}/.config/kinto/kinto.py'
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
Environment=DISPLAY={displayid}
|
||||
|
@@ -299,6 +299,7 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
||||
|
||||
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/killdups.sh ~/.config/kinto/killdups.sh
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/appindicator/kintotray.py ~/.config/kinto/kintotray.py
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/BudgieApplet/icons/kinto-color-16.svg ~/.config/kinto/kinto-color.svg
|
||||
yes | cp -rf ./xkeysnail-config/trayapps/BudgieApplet/icons/kinto-invert-16.svg ~/.config/kinto/kinto-invert.svg
|
||||
|
Reference in New Issue
Block a user