originally i had been using ksnip
from KDE which is a very nice tool but the gui popping up for a brief instant when using the command line version was annoying me (that is literally the entire reason for all this). i use xfce, so i resolved to use its default screenshot tool even if there were some things about it that annoyed me. these included:
- requiring the user enter a filename (from the command line, the gui auto-fills a suggestion, but i don't want to confirm that over and over when i use a totally uniform naming convention and directory)
- has an apparently buggy send-to-clipboard feature
- captures multiple monitors all in one file with huge black spaces
other than those it's a good program. here's my solutions.
capturing multiple monitors individually with xfce4-screenshooter
for two monitors, it's a case of making however many copies of the screenshot as you have monitors and cropping them each accordingly.
this requires having gimp
installed to find the coordinates, and imagemagick
installed to be able to use its mogrify
command's cropping ability.
to find out where to crop, open a screenshot in gimp and use the Rectangle Select tool. in the Tool Options docker, it will display the width and height under Size and X Y coordinates under Position, which need to be formatted as widthxheight+X+Y
for the mogrify command. (this guide was very helpful!)
you can download this script here as a template.
play --volume 0.5 -q /usr/share/sounds/freedesktop/stereo/camera-shutter.oga
timestamp=$(date +%Y-%m-%d--%H-%M-%S)
xfce4-screenshooter --fullscreen --save $HOME/Pictures/screenshots/$timestamp.png
cp $HOME/Pictures/screenshots/$timestamp.png $HOME/Pictures/screenshots/$timestamp-2.png
mogrify -crop 1680x1050+1200+766 -colorspace sRGB $HOME/Pictures/screenshots/$timestamp.png
mogrify -crop 1200x1920+0+0 -colorspace sRGB $HOME/Pictures/screenshots/$timestamp-2.png
to execute this easily, assign it to a keyboard shortcut (i use just the printscreen key).
capturing a single monitor
i find that often i only need to capture the main monitor and deleting the second monitor capture annoys me, so i made a simple tweak and assigned it ctrl + printscreen. you can download it here. it should be trivial to make more individual scripts and keybindings for each additional monitor.
play --volume 0.5 -q /usr/share/sounds/freedesktop/stereo/camera-shutter.oga
timestamp=$(date +%Y-%m-%d--%H-%M-%S)
xfce4-screenshooter --fullscreen --save $HOME/Pictures/screenshots/$timestamp.png
mogrify -crop 1680x1050+1200+766 -colorspace sRGB $HOME/Pictures/screenshots/$timestamp.png
snipping tool
and of course sometimes you need even less than that. as opposed to a keybinding, this one is a launcher on my xfce panel since i have to use the mouse to select a region anyway. download it here.
timestamp=$(date +%Y-%m-%d--%H-%M-%S)
xfce4-screenshooter --clipboard --region --save $HOME/Pictures/screenshots/$timestamp.png
xclip -selection clipboard -t image/png -i $HOME/Pictures/screenshots/$timestamp.png
play --volume 0.5 -q /usr/share/sounds/freedesktop/stereo/camera-shutter.oga