mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-12-11 00:28:32 -05:00
42 lines
990 B
Bash
Executable File
42 lines
990 B
Bash
Executable File
#!/bin/sh
|
|
|
|
mkdir -p ~/Screenshots
|
|
SAVEPATH="$HOME/Screenshots/$(date +'%Y-%m-%d-%H%M%S_grim.png')"
|
|
|
|
if command -v mako >/dev/null
|
|
then
|
|
notification=mako
|
|
else
|
|
notification=dunst
|
|
fi
|
|
|
|
case $1 in
|
|
--full)
|
|
grim "${SAVEPATH}"
|
|
notify-send -i $HOME/.config/${notification}/photograph.png "Screenshot taken..."
|
|
;;
|
|
--region)
|
|
GEOMETRY=$(slurp)
|
|
grim -g "${GEOMETRY}" "${SAVEPATH}"
|
|
notify-send -i $HOME/.config/${notification}/photograph.png "Screenshot taken..."
|
|
;;
|
|
--full-optional)
|
|
grim - | swappy -f -
|
|
;;
|
|
--region-optional)
|
|
GEOMETRY=$(slurp)
|
|
grim -g "${GEOMETRY}" - | swappy -f -
|
|
;;
|
|
--full-copy)
|
|
grim - | wl-copy
|
|
notify-send -i $HOME/.config/${notification}/photograph.png "Screenshot copied..."
|
|
;;
|
|
--region-copy)
|
|
GEOMETRY=$(slurp)
|
|
grim -g "${GEOMETRY}" - | wl-copy
|
|
notify-send -i $HOME/.config/${notification}/photograph.png "Screenshot copied..."
|
|
;;
|
|
*)
|
|
;;
|
|
esac
|