neodotfiles/user/.config/rofi/scripts/rofi_scrot

44 lines
1.1 KiB
Text
Raw Normal View History

2022-09-13 01:06:55 +00:00
#!/usr/bin/env bash
# ***This script was made by Clay Gomera (Drake)***
# - Description: A simple screenshot dmenu script
2023-06-24 17:01:17 +00:00
# - Dependencies: escrotum, dmenu, notify-send
2022-09-13 01:06:55 +00:00
## CREATING SCREENSHOT FOLDER ##
2023-06-24 17:01:17 +00:00
mkdir -p "$HOME/Media/Pictures/Screenshots"
cd "$HOME/Media/Pictures/Screenshots" || exit 0
2022-09-13 01:06:55 +00:00
## CHOICES ##
2023-06-20 22:34:41 +00:00
cho1="󱣴 Entire screen"
cho2="󱎫 Entire screen with delay"
cho3="󱕻 Select window or area"
cho4="󱎘 Exit"
chos="$cho1\n$cho2\n$cho3\n$cho4"
2022-09-13 01:06:55 +00:00
## DELAY OPTIONS ##
2023-06-20 22:34:41 +00:00
del1="󱑀 3 sec delay"
del2="󱑂 5 sec delay"
del3="󱑇 10 sec delay"
2022-09-13 01:06:55 +00:00
dels="$del1\n$del2\n$del3"
2023-06-24 17:01:17 +00:00
## MAIN ACTION ##
choice=$(echo -e "$chos" | rofi -dmenu -i -p "  Sreenshot Menu ")
case $choice in
"$cho1")
escrotum && notify-send "Screenshot saved";;
"$cho2")
del=$(echo -e "$dels" | rofi -dmenu -i -p "  Select Delay ");
2023-06-20 22:34:41 +00:00
case $del in
"$del1")
escrotum -d 3 -C && notify-send "Screenshot saved";;
2023-06-20 22:34:41 +00:00
"$del2")
escrotum -d 5 -C && notify-send "Screenshot saved";;
2023-06-20 22:34:41 +00:00
"$del3")
escrotum -d 10 -C && notify-send "Screenshot saved"
2023-06-24 17:01:17 +00:00
esac ;;
2023-06-20 22:34:41 +00:00
"$cho3")
2023-06-24 17:01:17 +00:00
escrotum -s && notify-send "Screenshot saved.";;
2023-06-20 22:34:41 +00:00
"$cho4")
exit 0
2022-09-13 01:06:55 +00:00
esac