#!/bin/sh
# Take a screenshot in quiet mode and save int the specified directory, 
#  or in /var/log/screenshot/ or in /tmp
# Philippe Corbes, 16 may 2011
# Usage: screenshot [directory]

if [ "$#" = "1" ] ; then
	if [ -d "$1" ] ; then
		dest="$1"
	else
		dest="/var/log/screenshot/"
	fi
else
	dest="/var/log/screenshot/"
fi
if [ ! -d "${dest}" ] ; then
	echo "$0: Unable to write to ${dest}, use /tmp !"
	dest="/tmp"
fi

echo "$0: Store a picture to ${dest}"
gtk-screenshot -q -D ${dest} --display=":0.0"
