2023-02-21 17:42:44 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# this script provides a menu of screenshot options, using flameshot
|
|
|
|
|
|
|
|
geom() {
|
2023-04-12 11:37:10 +02:00
|
|
|
case $1 in
|
|
|
|
"active") eval "$(xdotool getactivewindow getwindowgeometry --shell)" ;;
|
|
|
|
"select") eval "$(xdotool selectwindow getwindowgeometry --shell)" ;;
|
2023-02-21 17:42:44 +01:00
|
|
|
esac
|
|
|
|
echo "${WIDTH}x${HEIGHT}+${X}+${Y}"
|
|
|
|
}
|
|
|
|
|
|
|
|
# variables
|
2023-03-13 01:35:23 +01:00
|
|
|
output="${XDG_PICTURES_DIR:-$HOME/Pictures}/Screenshots/$(date '+%y%m%d-%H%M-%S').png"
|
2023-02-21 17:42:44 +01:00
|
|
|
case "$(printf "selected area\\ncurrent window\\nselected window\\nfull screen\\nselected area (copy)\\ncurrent window (copy)\\nselect window (copy)\\nfull screen (copy)" | dmenu -i -p "Screenshot which area?")" in
|
2023-04-12 11:37:10 +02:00
|
|
|
"selected area") flameshot gui -p "$output" ;;
|
|
|
|
"current window") flameshot gui -p "$output" --region "$(geom active)" ;;
|
|
|
|
"selected window") flameshot gui -p "$output" --region "$(geom select)" ;;
|
|
|
|
"full screen") flameshot full -p "$output" ;;
|
|
|
|
"selected area (copy)") flameshot gui -c ;;
|
|
|
|
"current window (copy)") flameshot gui -p "$output" -c --region "$(geom active)" ;;
|
|
|
|
"selected window (copy)") flameshot gui -p "$output" -c --region "$(geom select)" ;;
|
|
|
|
"full screen (copy)") flameshot full -c ;;
|
2023-02-21 17:42:44 +01:00
|
|
|
esac
|