pfr Also thanks to @JuvenalUrbino's recent reddit post, I've finally deleted scrot and took this screenshot with
xwd -root -silent | xwdtopnm | pnmtopng > aliased to dumproot
I'm used to pipe xwd through either netpbm commands (like you did above) or ImageMagick (convert
can handle .xwd among the others, you just need to clarify the format on the command line) depending on which of the 2 I've installed (not infrequently both):
XWD/ImageMagick script to take a root window dump and name it after current date:
#!/bin/sh
DIR=$HOME/Pictures/Screenshots
xwd -silent -root | convert xwd:- $DIR/"$(echo root.$(date +'%Y%M%d%H%m%S'))".png
To take a dump of the currently focused window:
#!/bin/sh
DIR=$HOME/Pictures/Screenshots
ID=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | awk {'print $2'})
xwd -silent -id $ID | convert xwd:- $DIR/"$(echo term.$(date +'%Y%M%d%H%m%S'))".png