#!/bin/sh
# Console screenshot with snapscreenshot and convert it with imagemagick convert to a $png_f_name defined file name
# Written by Georgi Dimitrov Georgiev
# Thu Apr 26 16:59:45 EEST 2012
# To work this script requires 
# 1. snapscreenshot installed http://bisqwit.iki.fi/source/snapscreenshot.html
# 2. ImageMagick http://www.imagemagick.org 
# -on Debian to install apt-get install --yes imagemagick

### Config
# .tga produced file name
output_f_name='console-screenshot.tga';
# gets current date
cur_date=$(date +%d_%m_%Y|sed -e 's/^ *//');
# png output f name
png_f_name="console-screenshot-$cur_date.png";
### END Config
snapscreenshot -c1 -x1 > $output_f_name && convert $output_f_name $png_f_name;
echo "Output png screenshot from tty1 console produced in";
echo "$PWD/$png_f_name";
/bin/rm -f $output_f_name;

