neodotfiles/user/.local/bin/rs_scrot

40 lines
1 KiB
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() {
2023-10-25 11:20:57 +00:00
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
2023-10-21 13:44:39 +00:00
}
# run
2023-10-26 19:56:17 +00:00
choice=$(echo -e "$options" | $RUNNER -l 3 -p "[󰄀 Screenshot]  " )
2023-10-21 13:44:39 +00:00
case $choice in
2023-10-25 11:20:57 +00:00
$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
;;
2023-10-21 13:44:39 +00:00
esac