I am Ubuntu 12.04 user and I want my machine take automatic screenshots of my work every 2 minutes. So which Software you prefer. Please suggest me.
-
1I hope you are not violating anyone's privacy. – don.joey Jun 12 '13 at 10:50
-
Maybe you should take a look at this Stack Overflow question : http://stackoverflow.com/questions/12072424/linux-take-automatic-screenshots-at-random-times – smonff Jun 12 '13 at 11:09
-
Ubuntu forums also provides these responses : http://ubuntuforums.org/showthread.php?t=1350333 – smonff Jun 12 '13 at 11:11
1 Answers
I'd prefer ImageMagick.
Note: check applicable privacy laws, as the screenshots may contain confidential data.
Now, on how to do this:
You need to have the ImageMagick package:
# apt-get install imagemagick
Then, make a Bash script to take the screenshot, save it somewhere (I'm using an example filename of /path/to/your/script.sh
) and make it executable (chmod +x /path/to/your/script.sh
):
#!/bin/bash
# change this for a different date format - see: man date
export DATE=`date '+%Y-%m-%d_%H%M%S'`
# display to take the screenshot of
export DISPLAY=:0
# filename to screenshot
export SCREENSHOT_FILENAME="/tmp/screenshot-$DATE.png"
/usr/bin/import -window root "$SCREENSHOT_FILENAME"
Last, set up a cron script to do this for you (crontab -e
, add this line to the end):
*/2 * * * * /path/to/your/script.sh
This will, every two minutes, try to take screenshots of display 0 (which is the default one; if you have a multiseat setup, you may need to find out which window you need), and save them as timestamped PNGs to /tmp (this is an example location which is likely to exist; you may want to use a different directory).
Caveats: there is no checking of free space, so the script may fill up all the space in target location. The script assumes the user is logged in at display :0 (if another user is logged in, user is logged in at different display, or there is no X session, the script will fail).

- 11
- 1