neodotfiles/user/.config/suckless/dmenu/scripts/dmenu_scrot

44 lines
1.1 KiB
Text
Raw Normal View History

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