Screenshot area (ImageMagick)

From WickyWiki
Revision as of 12:11, 4 December 2016 by Wilbert (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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: