Hyprland-dotfiles/scripts/grim.sh

35 lines
1.1 KiB
Bash
Raw Normal View History

2023-08-20 11:34:53 -04:00
#!/bin/bash
# ____ _ _
# / ___| ___ _ __ ___ ___ _ __ ___| |__ ___ | |_
# \___ \ / __| '__/ _ \/ _ \ '_ \/ __| '_ \ / _ \| __|
# ___) | (__| | | __/ __/ | | \__ \ | | | (_) | |_
# |____/ \___|_| \___|\___|_| |_|___/_| |_|\___/ \__|
#
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
DIR="$HOME/Pictures/screenshots/"
NAME="screenshot_$(date +%d%m%Y_%H%M%S).png"
option2="Selected area"
option3="Fullscreen (delay 3 sec)"
options="$option2\n$option3"
choice=$(echo -e "$options" | rofi -dmenu -i -no-show-icons -l 4 -width 30 -p "Take Screenshot")
case $choice in
$option2)
2023-09-25 02:53:35 -04:00
grim -g "$(slurp)" - | swappy -f -
# grim -g "$(slurp)" $(xdg-user-dir PICTURES)/screenshots/$(date +'%s_grim.png')
2023-08-20 11:34:53 -04:00
notify-send "Screenshot created" "Mode: Selected area"
;;
$option3)
sleep 3
2023-09-25 02:53:35 -04:00
grim - | swappy -f -
# grim $(xdg-user-dir PICTURES)/screenshots/$(date +'%s_grim.png')
2023-08-20 11:34:53 -04:00
notify-send "Screenshot created" "Mode: Fullscreen"
;;
esac