Last active
May 9, 2019 08:39
-
-
Save intarstudents/33be20022dfc83195702868ba2d31ae8 to your computer and use it in GitHub Desktop.
Synergy client locking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sudo apt-get install inotify-tools xautomation | |
DISPLAY=:0 | |
killall mate-screensaver | |
mate-screensaver & | |
CMD_FILE="remote-lock.cmd" | |
touch $CMD_FILE | |
while inotifywait -e close_write $CMD_FILE; do | |
case "$(< $CMD_FILE)" in | |
l) | |
mate-screensaver-command -l | |
xte "mousermove 1 1" | |
;; | |
u) | |
mate-screensaver-command -d | |
;; | |
esac | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dbus-monitor --session "type='signal',interface='org.mate.ScreenSaver'" | | |
while read x; do | |
case "$x" in | |
*"boolean true"*) | |
ssh user@ip 'echo "l" > remote-lock.cmd' | |
;; | |
*"boolean false"*) | |
ssh user@ip 'echo "u" > remote-lock.cmd' | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment