2021-02-13 11:28:59 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
mkdir -p ~/Screenshots
|
|
|
|
SAVEPATH="$HOME/Screenshots/$(date +'%Y-%m-%d-%H%M%S_grim.png')"
|
|
|
|
|
2021-02-25 19:52:18 -05:00
|
|
|
if command -v mako >/dev/null
|
|
|
|
then
|
|
|
|
notification=mako
|
|
|
|
else
|
|
|
|
notification=dunst
|
|
|
|
fi
|
|
|
|
|
2021-02-13 11:28:59 -05:00
|
|
|
case $1 in
|
|
|
|
--full)
|
|
|
|
grim "${SAVEPATH}"
|
2021-02-25 19:52:18 -05:00
|
|
|
notify-send -i $HOME/.config/${notification}/photograph.png "Screenshot taken..."
|
2021-02-13 11:28:59 -05:00
|
|
|
;;
|
|
|
|
--region)
|
|
|
|
GEOMETRY=$(slurp)
|
|
|
|
grim -g "${GEOMETRY}" "${SAVEPATH}"
|
2021-02-25 19:52:18 -05:00
|
|
|
notify-send -i $HOME/.config/${notification}/photograph.png "Screenshot taken..."
|
2021-02-13 11:28:59 -05:00
|
|
|
;;
|
|
|
|
--full-optional)
|
|
|
|
grim - | swappy -f -
|
|
|
|
;;
|
|
|
|
--region-optional)
|
|
|
|
GEOMETRY=$(slurp)
|
|
|
|
grim -g "${GEOMETRY}" - | swappy -f -
|
|
|
|
;;
|
|
|
|
--full-copy)
|
|
|
|
grim - | wl-copy
|
2021-02-25 19:52:18 -05:00
|
|
|
notify-send -i $HOME/.config/${notification}/photograph.png "Screenshot copied..."
|
2021-02-13 11:28:59 -05:00
|
|
|
;;
|
|
|
|
--region-copy)
|
|
|
|
GEOMETRY=$(slurp)
|
|
|
|
grim -g "${GEOMETRY}" - | wl-copy
|
2021-02-25 19:52:18 -05:00
|
|
|
notify-send -i $HOME/.config/${notification}/photograph.png "Screenshot copied..."
|
2021-02-13 11:28:59 -05:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|