I need a tool that will do the following: selecting a window, will make a screenshot of that window with a x padding, like in the following image:
So, in most of the cases x will be equal with y, but sometimes I need different distances.
How to make such a screenshot, automatically? I tried with Shutter, but I couldn't find such a setting there. However, it supports plugins. So a plugin could be to crop the window this way.
Script, using Shutter
I don't think it exists, but like anything, it can be made.
If you make the script below available under a key combination (explanation further below), a window will pop up, allowing you to set the margins of your screenshot on the left, right, top and bottom, separated by a space:
I set the default to 30 px, but you can set any default value (see below).
How to use
The script uses
Shutteris already on your system (since you mentioned it), install
N.B. If you use Kubuntu,
Zenityis not installed by default:
Copy the script below into an empty file. If you want you can change the "default' marge in the line of the script:
save it as
Add the script to a key shortcut combination: choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command:
The script uses
wmctrlto determine the position of the window. On different window managers however, the output of the
wmctrl -lGcommand shows small differences in the y-position of the window. These differences are eliminated by the value, set in the
deviation=-line of the script. The currently set value (0) is appropriate for Unity and KDE.
The script is also tested, and works fine on
Gnome, but the value needs to be changed then, as explained in the head section of the script.