dmenu-scripts/dmenu-screenshot

26 lines
627 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
"a selected area") sleep 0.5; shotgun -g $(hacksaw) $dir/pic-selected-"$(date '+%y%m%d-%H%M-%S').png" ;;
"full screen") sleep 0.5; shotgun $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 $@