2023-04-03 14:20:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# ____ _ _
|
|
|
|
# / ___| ___ _ __ ___ ___ _ __ ___| |__ ___ | |_
|
|
|
|
# \___ \ / __| '__/ _ \/ _ \ '_ \/ __| '_ \ / _ \| __|
|
|
|
|
# ___) | (__| | | __/ __/ | | \__ \ | | | (_) | |_
|
|
|
|
# |____/ \___|_| \___|\___|_| |_|___/_| |_|\___/ \__|
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# by Stephan Raabe (2023)
|
|
|
|
# -----------------------------------------------------
|
|
|
|
|
|
|
|
DIR="$HOME/Pictures/screenshots/"
|
|
|
|
NAME="screenshot_$(date +%d%m%Y_%H%M%S).png"
|
|
|
|
|
|
|
|
option1="Selected window (delay 3 sec)"
|
|
|
|
option2="Selected area"
|
|
|
|
option3="Fullscreen (delay 3 sec)"
|
|
|
|
|
2023-10-02 08:51:16 +00:00
|
|
|
options="$option2\n$option3\n$option1"
|
2023-04-03 14:20:44 +00:00
|
|
|
|
2023-10-02 08:51:16 +00:00
|
|
|
choice=$(echo -e "$options" | rofi -i -dmenu -config ~/dotfiles/rofi/config-screenshot.rasi -width 30 -p "Take Screenshot")
|
2023-04-03 14:20:44 +00:00
|
|
|
|
|
|
|
case $choice in
|
|
|
|
$option1)
|
2023-04-11 08:27:01 +00:00
|
|
|
scrot $DIR$NAME -d 3 -e 'xclip -selection clipboard -t image/png -i $f' -c -z -u
|
|
|
|
notify-send "Screenshot created" "Mode: Selected window"
|
|
|
|
;;
|
2023-04-03 14:20:44 +00:00
|
|
|
$option2)
|
2023-04-11 08:27:01 +00:00
|
|
|
scrot $DIR$NAME -s -e 'xclip -selection clipboard -t image/png -i $f'
|
|
|
|
notify-send "Screenshot created" "Mode: Selected area"
|
|
|
|
;;
|
2023-04-03 14:20:44 +00:00
|
|
|
$option3)
|
2023-04-11 08:27:01 +00:00
|
|
|
scrot $DIR$NAME -d 3 -e 'xclip -selection clipboard -t image/png -i $f'
|
|
|
|
notify-send "Screenshot created" "Mode: Fullscreen"
|
|
|
|
;;
|
2023-04-03 14:20:44 +00:00
|
|
|
esac
|