sway
sway copied to clipboard
Add `anything` option to grimshot
This enables selecting a window, output, or area within one invocation, removing the need for multiple keybindings.
- Drag for an area (note that this already works in the
windowcase) - Click on a window to select it
- Click outside of all windows (e.g. in gaps or on the statusbar) to select the output
Ideally this needs some testing with multiple monitors, which I don't have.
~The name selection may need to change.~ It's anything now.
This sounds great, can't wait to get this!
@Ashe Note that you could already just take the updated grimshot file and put it somewhere in your path (at least that's what I did).
Ideally this needs some testing with multiple monitors, which I don't have.
Though I'm not using grimshot myself, I stole the snippet (swaymsg ... | slurp -o) and have been using it for many months with multiple monitors and it works without issue.
@fluix-dev Oh, I didn't know of slurp -o before. That simplifies things since now we can use the same jq command as the existing window option, and just do slurp -o to add the rectangles for all outputs instead of only slurp.
selection could maybe change to e.g. anything
Oh, I didn't know of slurp -o before
Oh haha, looks like I got a similar snippet from somewhere else.
selectioncould maybe change to e.g.anything
Hm, yeah anything is probably better.
Clicking on the status bar (waybar) results on the current window getting screenshotted.
Would it be possible to maybe use right-click to trigger saving the current output?
I like the idea, but it's doesn't seem to be possible to screenshot the whole output without using gaps.
@WhyNotHugo Hmm, do you mean that the last window you hovered before moving the cursor over the waybar is what gets screenshotted? That sounds weird to me. For me, both hovering the gaps and hovering the waybar (anything outside all windows) have the desired effect of screenshotting the entire output.
Is there anything blocking this PR from being merged, or does this just need a reviewer? This is one of the few things I really missed switching from x11 to sway.
I think it's ready and has just fallen of the radar. I've been using it for over a year without problems and having a single screenshot button that does everything is super convenient indeed.
Clicking on the status bar did not work for me. Without gaps I don’t see how you can screenshot the whole output.
Hmm, interesting. That would probably be an issue with slurp. I'm running version 1.3.2, and with it the following works:
echo 0,0 500x500 | slurp -o
- click in the top left corner of the output to select it
- click outside the top left corner of the output to select the entire output
- click and drag anywhere to select an area.
Mind you, I'm just pointing out an issue I've found; I'm not saying that this should be a blocker to merging.
The contrib/ directory has been moved from Sway to a separate repository: https://github.com/OctopusET/sway-contrib
See https://github.com/swaywm/sway/pull/7541 for details.
Please re-open your pull request against the new repository.
See https://github.com/OctopusET/sway-contrib/pull/11