It's my first bash script and felt I should share to someone, since my girlfriend does not seem to care at all about it. It's a usesless /bin/sh script to take a screen shot of your desktop and put the *.jpg in your home directory named grab-year,month & nanosecond. It supports the full screen or manually via drawing a box with your mouse. I only wrote this script to take screens faster, useless otherwise.
Create a file called "grab" insert this code into it:
Code:
#!/bin/sh
# grab
# description:
# A simple program to take a quick screen shot
#
# Required: import (Part of the image magic library)
#
# By Micxz
mygrab=`which import | tr -d ''`
if [ $mygrab == '' ] ; then
echo ""
echo "I'm Sorry I can't find: /usr/bin/import "
echo "Open this script and change \$mygrab at the top."
echo ""
exit 0
fi
case "$1" in
-f)
echo ""
RANDTIME=`/bin/date +%Y%m%N | tr -d ' '`
$mygrab -window root ~/grab-$RANDTIME.jpg
echo "Full grab done. Look in ~/"
echo ""
;;
-m)
echo ""
RANDTIME=`/bin/date +%Y%m%N | tr -d ' '`
$mygrab ~/grab-manual-$RANDTIME.jpg
echo "Manual grab done. Look in ~/"
echo ""
;;
*)
echo ""
echo " USAGE: grab [command] "
echo ""
echo " COMMANDS:"
echo " -f Grab the entire X server screen."
echo " -m Manually grab the screen with your mouse."
echo " -help Displays this list of options."
echo ""
exit 1 ;;
esac
exit 0
chmod 755 grab
Done;