OctopusET / sway-contrib

A collection of user-contributed scripts for sway
MIT License
58 stars 22 forks source link

Chore / Limit grimshot window grab #10

Closed paulodiovani closed 1 year ago

paulodiovani commented 1 year ago

Updated PR for https://github.com/swaywm/sway/pull/7158

The grimshot script accepts option to screenshot current output, window or area, but the window option will also allow area shot If the user click and grab the mouse.

This change adds the -r option to slurt, so when using grimshot window it will only possible to select an existing window area.

From slurp -r

  -r           Restrict selection to predefined boxes.
fluix-dev commented 1 year ago

Can I ask why this is a good idea, especially considering it breaks backwards compatibility? Personally, I use my own script which is equivalent to the new anything option being proposed, but what's wrong with the extra feature that you can click and drag to select a region?

paulodiovani commented 1 year ago

Can I ask why this is a good idea, especially considering it breaks backwards compatibility? Personally, I use my own script which is equivalent to the new anything option being proposed, but what's wrong with the extra feature that you can click and drag to select a region?

Without the -r option the user could accidentally drag and take a screenshot of a much smaller area by mistake. It is a small issue, but it can be annoying if trying to screenshot something with movement (a video or log stream, for example).

IMO it does not break backward compatibility because there is still the area option.