dmenu-scripts/dmenu-screenshot
2022-10-30 16:07:16 +01:00

15 lines
608 B
Bash
Executable File

#!/bin/sh
# It lets you choose the kind of screenshot to take, including
# copying the image or even highlighting an area to copy.
. $HOME/.config/dmenu/config
dir="$HOME/pics/screenshots"
[ ! -d "$dir" ] && mkdir $dir -p
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | $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