dotfiles/.local/bin/scripts/grimshot

28 lines
437 B
Plaintext
Raw Normal View History

2023-05-26 13:29:25 +02:00
#!/bin/sh
2023-05-28 19:34:31 +02:00
target=area
case "$1" in
-f|--fullscreen)
target=screen
shift
;;
esac
2023-05-26 13:29:25 +02:00
filename=~/Pictures/Screenshots/Screenshot_"$(date +'%Y%m%d_%H%M%S').png"
2023-05-28 19:34:31 +02:00
grimblast copysave "$target" "$filename" || exit 1
2023-05-26 13:29:25 +02:00
action="$(dunstify \
-i "$filename" \
-A "open,OPEN" \
-t 10000 \
"Screenshot saved" \
"$filename")"
case "$action" in
2) #click
xdg-open "$filename"
2023-05-28 19:34:31 +02:00
;;
2023-05-26 13:29:25 +02:00
esac