1
0
Fork 0

new screenshot menu

new screenshot menu
This commit is contained in:
Luca Bilke 2023-02-21 17:42:44 +01:00
parent a6628ff3cc
commit 1a46c273f2
2 changed files with 25 additions and 3 deletions

24
.local/bin/dmenuflameshot Executable file
View file

@ -0,0 +1,24 @@
#!/bin/sh
# this script provides a menu of screenshot options, using flameshot
geom() {
case $1 in
"active") eval "$(xdotool getactivewindow getwindowgeometry --shell)" ;;
"select") eval "$(xdotool selectwindow getwindowgeometry --shell)" ;;
esac
echo "${WIDTH}x${HEIGHT}+${X}+${Y}"
}
# variables
output="${XDG_PICTURES_DIR:-$HOME/Pictures}/$(date '+%y%m%d-%H%M-%S').png"
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
"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 ;;
esac

View file

@ -1,8 +1,6 @@
#!/bin/sh
# This is bound to Shift+PrintScreen by default, requires maim. It lets you
# choose the kind of screenshot to take, including copying the image or even
# highlighting an area to copy. scrotcucks on suicidewatch right now.
# this script provides a menu of screenshot options, using maim
# variables
output="$(date '+%y%m%d-%H%M-%S').png"