dmenu-scripts/dmenu-screenshot

26 lines
620 B
Plaintext
Raw Normal View History

2022-04-05 16:59:13 +02:00
#!/bin/sh
# It lets you choose the kind of screenshot to take, including
# copying the image or even highlighting an area to copy.
load_config () {
. $HOME/.config/dmenu/config
}
2022-04-05 16:59:13 +02:00
menu () {
case "$(printf "a selected area\\nfull screen" | $DMENU -l 6 -p "Screenshot which area?")" in
2023-08-23 19:50:09 +02:00
"a selected area") sleep 0.5; maim -m 2 -s $dir/pic-selected-"$(date '+%y%m%d-%H%M-%S').png" ;;
"full screen") sleep 0.5; maim -m 2 $dir/pic-full-"$(date '+%y%m%d-%H%M-%S').png" ;;
esac
}
2022-07-17 11:03:13 +02:00
main () {
dir="$HOME/pics/screenshots"
[ ! -d "$dir" ] && mkdir $dir -p
2022-04-05 16:59:13 +02:00
load_config
menu
}
main $@