dude2425
April 11th, 2005, 07:51 PM
I've been wanting to post this for some time now, but never really got around to doing it, or remember it for that matter, till now. I just wanted to post it before I forget it again.
First, copy and paste the following into a random text editor:
#!/bin/bash
NOW=`date '+%m_%d_%Y_%M_%S'`
FNAME=screenshot${NOW}
EXT=png
if [ -d $HOME/screenshots ]
then
cd $HOME/screenshots
else
mkdir $HOME/screenshots
cd $HOME/screenshots
fi
sleep 5
import -window root ${FNAME}.${EXT}
convert -resize 320x240 ${FNAME}.${EXT} ${FNAME}_thumb.${EXT}
if [ -d $HOME/screenshots/thumbs ]
then
mv screenshot${NOW}_thumb.${EXT} thumbs/
else
mkdir thumbs/
mv screenshot${NOW}_thumb.${EXT} thumbs/
fi
(Remember the cariage return at the end)
Now save that as something like '/usr/local/bin/screenshot'
Go into gconf-editor, then nav on to '/apps/metacity/keybinding_cammands/cammand_screenshot' and assign the value of 'screenshot' or '/usr/local/bin/screenshot' whichever you prefer.
Now you should be able to take a quick screenshot of your desktop, and have it saved to ~/screenshots, and a thumbnail saved to ~/screenshots/thumbs
Remember, this is my very first ever shell script, and I'm sure this could have been more efficient, but it work's fine for me. I only did this because I didn't like the gnome screenshot thing, and I needed a thumbnail for my image.
Have fun with it
UPDATE:
I was just searching around the net when I found this on O'Reilly, basicly it takes a screenshot with a thumbnail, but also allows you to upload it to a server taking out the hardest part of taking a screenshot.
http://hacks.oreilly.com/pub/h/3181
I havent tested it myself yet as I have no server to upload anything to, but it's here if anybody wants it.
UPDATED: Changed '/usr/bin' to '/usr/local/bin'
First, copy and paste the following into a random text editor:
#!/bin/bash
NOW=`date '+%m_%d_%Y_%M_%S'`
FNAME=screenshot${NOW}
EXT=png
if [ -d $HOME/screenshots ]
then
cd $HOME/screenshots
else
mkdir $HOME/screenshots
cd $HOME/screenshots
fi
sleep 5
import -window root ${FNAME}.${EXT}
convert -resize 320x240 ${FNAME}.${EXT} ${FNAME}_thumb.${EXT}
if [ -d $HOME/screenshots/thumbs ]
then
mv screenshot${NOW}_thumb.${EXT} thumbs/
else
mkdir thumbs/
mv screenshot${NOW}_thumb.${EXT} thumbs/
fi
(Remember the cariage return at the end)
Now save that as something like '/usr/local/bin/screenshot'
Go into gconf-editor, then nav on to '/apps/metacity/keybinding_cammands/cammand_screenshot' and assign the value of 'screenshot' or '/usr/local/bin/screenshot' whichever you prefer.
Now you should be able to take a quick screenshot of your desktop, and have it saved to ~/screenshots, and a thumbnail saved to ~/screenshots/thumbs
Remember, this is my very first ever shell script, and I'm sure this could have been more efficient, but it work's fine for me. I only did this because I didn't like the gnome screenshot thing, and I needed a thumbnail for my image.
Have fun with it
UPDATE:
I was just searching around the net when I found this on O'Reilly, basicly it takes a screenshot with a thumbnail, but also allows you to upload it to a server taking out the hardest part of taking a screenshot.
http://hacks.oreilly.com/pub/h/3181
I havent tested it myself yet as I have no server to upload anything to, but it's here if anybody wants it.
UPDATED: Changed '/usr/bin' to '/usr/local/bin'