Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Hello everyone,
I am using linux mint 11 and I have been looking for a screenshot application to replace the existing one. In fact there only two things I want from it is saving the image as a .jpeg file and saving to an assigned folder ,like the desktop, with no user interaction besides typing the printscreen button. I have tried many apps like Shutter but unfortunately my computer is old and I can't afford 30-50 mb only for this type of app. I know IM is highly versatile and I was wondering if there was any way I could create a script to do that!
#!/bin/bash
#
# Get current window focus and capture it as fast as posible.
#
# Then find last number of previous capures (ignore leading zeros),
# and name rename the new capture to the next number (3 digits).
#
cd # Go Home
# Capture currently active window
id=`xprop -root _NET_ACTIVE_WINDOW | sed 's/.* //'`
#id=`xwit -current -print | sed 's/:.*//'`
convert x:"$id" capture-tmp-$$.png
#jiggle_window -t circle -id "$id" # notify user by jiggling window
# Find the next number
num=$(ls capture-[0-9]*.png 2>/dev/null | sed -n '$ s/[^0-9]//gp' )
num=$( printf %03d $(expr $num + 1) )
# Rename the captured image
mv capture-tmp-$$.png capture-$num.png
You can adjust the "cd" for your save directory, and the filenames used.
The "xprop" is a standard X windows utility program.
The jiggle_window program (commented out in the above) is another script of mine.
But it is not actually needed. You cane download it from.. though needs the "xwit" executable to use. http://www.ict.griffith.edu.au/anthony/ ... gle_window
that is used to provide some feedback that the capture is finished. Basically it makes the window in question move in a tight circle a couple of times. Basically just good programming practise.
Hello anthony,
I run into some trouble.I created an empty file and pasted the script,saved it,renamed it to .sh and allowed it to be run as executable. However,after running it no images pop up in my home folder.My guess is that, I am doing something terribly wrong.