neodotfiles/user/.config/wofi/scripts/rs_scrot

40 lines
977 B
Text
Raw Normal View History

2023-10-21 13:44:39 +00:00
#!/usr/bin/env bash
# ***This script was made by Clay Gomera (Drake)***
# - Description: A simple screenshot menu rofi script
# - Dependencies: wofi, grim, slurp
# options
option1=" Capture the screen"
option2=" Capture region"
option3=" Exit"
options="$option1\n$option2\n$option3"
# countdown
countdown() {
notify-send "Screenshot" "Executing in 3 seconds" -t 1000
sleep 1
notify-send "Screenshot" "Executing in 2 seconds" -t 1000
sleep 1
notify-send "Screenshot" "Executing in 1 seconds" -t 1000
sleep 2
}
# run
choice=$(echo -e "$options" | wofi -L 5 --dmenu -p "󰄀 Screenshot" )
case $choice in
$option1)
countdown
grim - | wl-copy -t image/jpg
notify-send "Screenshot" "Screenshot saved to clipboard"
;;
$option2)
notify-send "Screenshot" "Select a region to capture"
grim -g "$(slurp)" - | wl-copy -t image/jpg
notify-send "Screenshot" "Region saved to clipboard"
;;
$option3)
exit 0
;;
esac