Created
May 24, 2014 17:53
-
-
Save yaasita/b651882a405413bfddcd to your computer and use it in GitHub Desktop.
This file contains 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 | |
DISPLAY=:0 | |
function previous { | |
sleep $1 | |
eval $(xdotool getmouselocation --shell) | |
echo "$X,$Y" | |
} | |
while :;do | |
p05=`previous 5m` | |
p10=`previous 10m` | |
p15=`previous 15m` | |
if [ "$p05" = "$p10" ] && [ "$p05" = "$p15" ] ; then | |
sudo pm-suspend | |
fi | |
sleep 60 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment