dotfiles/river-classic/.config/river/screenshot.sh

18 lines
487 B
Bash
Raw Normal View History

2026-03-05 16:41:33 -08:00
#!/bin/sh
if [ $1 = "clip" ]; then
if grim -g "$(slurp)" - | wl-copy; then
notify-send "screenshot" "Saved to clipboard"
else
notify-send "screenshot" "Canceled"
fi
else
filename="$HOME/Downloads/$(echo '' | bemenu --ifne -p "Enter filename:")"
filename_ext="${filename%.png}.png"
if grim -g "$(slurp)" "$filename_ext"; then
notify-send "screenshot" "Saved as $filename_ext"
else
notify-send "screenshot" "Canceled"
fi
fi