Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
#!/bin/bash
while true; do
directory=/home/jhendric/screenshots/`date +%b%d`
if [ ! -e "$directory" ]; then
mkdir $directory
fi
import -window root -silent $directory/`date +%H%M`.gif
sleep 10m
done
The only issue is that import uses 100% CPU every time it runs, so X locks up for 3-5 seconds while import runs. I tried using nice, but it didn't help any.
I know it's a bit of an off-topic question, but I thought I'd ask since it'd be helpful for me.
Add -screen to your command line, that may help. Otherwise, the delay is expected. The X server is locked so the pixels do not change while a snapshot is taken.
I found an alternative to import, called xwd (http://en.wikipedia.org/wiki/Xwd), that doesn't cause a 100% CPU spike while running. Here's the script, for anyone that cares.
There is also a lower level standard X window utility called "xwd" to take snapshots. however its out put is the 'xwd' format but IM understands this so that is no drama.