Skip to content

Instantly share code, notes, and snippets.

@rsnemmen
Created March 6, 2015 14:36
Show Gist options
  • Save rsnemmen/6f0a190c0d1fd0de6f93 to your computer and use it in GitHub Desktop.
Save rsnemmen/6f0a190c0d1fd0de6f93 to your computer and use it in GitHub Desktop.
Captures screenshots at regular time intervals and wakes up computer from screensaver
#!/bin/bash
#
# Captures regular screenshots and saves them to dropbox.
# Useful when I leave my linux box doing number crunching
# over long periods.
#
# t = number of seconds in-between screenshots
t=5400 # 1.5 h
while true
do
gnome-screensaver-command -d # wakes up from screensaver
sleep 15
scrot -d $t '%Y-%m-%d-%H:%M:%S.png' -e 'mv $f ~/Dropbox/Screenshots/ubuntu/';
ls -1t ~/Dropbox/Screenshots/ubuntu/* | head -n1 # prints last file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment