slurp
slurp copied to clipboard
Implement option to use image as backgrop
So that you can select a region of a full screenshot from grim (or similar).
I'm not sure if this will work with rotated or flipped displays yet.
For those looking for a stopgap solution, I wrote a script that uses swayimg to display the background image. It's far from perfect, but it gets the job done.
#!/bin/sh
grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') /tmp/freeze-screenshot
swayimg -s fit -f /tmp/freeze-screenshot -b none &
grimshot --notify "$1" area
killall swayimg # We are only using swayimg for this purpose
Cleaner version:
#!/bin/sh
set -euo pipefail
grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') - |
swayimg -s fit -f -b none - &
swayimg_pid=$!
grimshot $@
kill $swayimg_pid
Invoke it with whatever args you'd normally pass to grimshot.
Slight issue: The background image only shows after you click and drag. Otherwise, it shows the current defocused screen.
Sorry, but I don't think this feature is desirable.