Created
April 29, 2019 10:27
-
-
Save ju916/60990308b696007e4941f6a85d829e8f to your computer and use it in GitHub Desktop.
Skript to unlock XScreensaver
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/sh | |
# echo "USB device inserted `date` $@" >>/tmp/xscreenlock.log | |
#user=ju | |
user=`who | grep ':0' | awk '{print $1}'| head -1` | |
if [ ! -z "$user" ] ; then | |
# echo "$user is logged in :0" | |
# give it some time to settle | |
sleep 1 | |
DISPLAY=:0 sudo -n -H -u "$user" /usr/bin/xscreensaver-command -deactivate >> /tmp/xscreenlock.log 2>>/tmp/xscreenlock.log | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment