Screenshot area (ImageMagick)

From WickyWiki

The following will use name of the selected window in the filename:

timestamp=$(date '+%Y-%m-%d %H.%M.%S')
windowname=$(xwininfo -id $(xprop -root | awk '/NET_ACTIVE_WINDOW/ { print $5; exit }') | awk -F\" '/xwininfo:/ { print $2; exit }')
import "$HOME/Pictures/Screenshot - $timestamp - $windowname.png"

Also see: