capturing multiple monitors individually with xfce4-screenshooter
(or imagemagick)
originally i had been using ksnip from KDE which can capture solely the active monitor, 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, namely that it captures multiple monitors all in one file with huge black spaces.
also, these solutions could be used outside of xfce by swapping xfce4-screenshooter for imagemagick's import
, which similarly takes one massive screenshot.
it's a case of making however many copies of the screenshot as you have monitors and cropping them each accordingly. one way to find the coordinates of a monitor is with gimp
. then, use imagemagick
's 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.
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). for imagemagick's import
, the command is import -display :0 -window root -crop widthxheight+X+Y "filename.png"
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. 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.
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
for an imagemagick snipping tool, you can use slop
(great name) to select the region you want import
to capture (they have an example on their readme).