Make screenshot scripts more robust

This commit is contained in:
Kiana Sheibani 2024-02-17 13:18:27 -05:00
parent ae37ae72fa
commit c3247b08ad
2 changed files with 9 additions and 4 deletions

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
grim - | wl-copy grim - | wl-copy
notify-send "Screenshot saved to clipboard" \ notify-send "Screenshot saved to clipboard" \
-a grim -c screenshot -u low -a grim -c screenshot -u low -t 3000

View file

@ -1,4 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
grim -g "$(slurp)" - | wl-copy if region="$(slurp)"; then
notify-send "Screenshot saved to clipboard" \ grim -g "$region" - | wl-copy
-a grim -c screenshot -u low notify-send "Screenshot saved to clipboard" \
-a grim -c screenshot -u low -t 3000
else
notify-send "Screenshot cancelled" \
-a grim -c screenshot -u low -t 3000
fi