Last active
August 29, 2015 14:02
-
-
Save vyder/d47a0979ab61d03b003f to your computer and use it in GitHub Desktop.
Wiggle the mouse/cursor every now and then to prevent the screen saver from activating
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
#!/usr/bin/env bash | |
# | |
# 1. Install 'xdotool' - http://www.semicomplete.com/projects/xdotool/ | |
# sudo apt-get install xdotool | |
# 2. Open a screen session: | |
# screen -S mouse_wiggle | |
# 3. Exec this script | |
# 4. Background the session with Ctrl+A+D | |
# | |
# Not sure why we need this, | |
# but it complains if this | |
# variable isn't set | |
export DISPLAY=':0.0' | |
# Format: | |
# Number + (s|m|h|d) | |
sleep_period=2m | |
while true; do | |
echo "Twitching mouse at: " | |
date | |
echo "---" | |
xdotool mousemove 0 100 | |
xdotool mousemove 0 50 | |
sleep ${sleep_period} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment