scrot
scrot copied to clipboard
[Feature request] Select monitor
Ability to select which monitor to take a screenshot of (the full monitor) on a multiple monitors setup.
This is already scriptable. The following command takes a screenshot of (and only of) the first monitor:
scrot -a $(xrandr | grep '\Wconnected\W' | grep -Po "\d+x\d+\+\d+\+\d+" | sed 's/x/+/' | awk -F "+" '{print $3","$4","$1","$2}' | head -n 1 | tail -n 1)
Thanks but I know that. My feature request stands despite that.
Em dom., 19 de abr. de 2020 às 17:46, IFo Hancroft [email protected] escreveu:
Thanks but I know that. My feature request stands despite that.
I agree. The right way is add the feature in scrot. But thanks for this workaround.
Now, we need new volunteers to add new features in scrot.
If someone gets to doing it, here's what I have:
The libxrandr library holds/provides the RandR extension. Package is libxrandr but depends on distro probably.
The following functions found there (mostly in Xrandr.h but in some of the other files as well) might help you: XRRGetOutputPrimary XRRGetMonitors XRRGetScreenSizeRange
Keep in mind that you will probably need to check the configured screen arrangement (where they are located in relation to one another) as the order in which you get them, may not be the order they are set in). For example my HDMI display is on the left and set as primary, while my DVI display is on the right, however the xrandr binary, lists the DVI first (also it is the first one to boot and sits on the left before xrandr is loaded to read its configuration)