This is a note for some use cases of xsnap, which I never can remember how to use them, exactly, even after five years.
2 -region
Option value type GEOMETRY format: WxH+X+Y, for example:
xsnap -region 1280x720+2+20 -file screenshot.png
xsnap grabs 1280 by 720 pixels area at screen position 2, 20.
3 Full-screen
Using xwininfo to determine the screen size:
xsnap -file screenshot.png -region "$(xwininfo -root | sed '/\(Width\|Height\)/ {s/[ :a-z-]//gi;p} ; d' | tr '\n' ' ' | cut -d ' ' -f1-2 | tr ' ' 'x')+0+0"
The breakdown version:
xsnap -file screenshot.png -region "$(xwininfo -root |
sed '/\(Width\|Height\)/ {s/[ :a-z-]//gi;p} ; d' |
tr '\n' ' ' |
cut -d ' ' -f1-2 |
tr ' ' 'x')+0+0"
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.