summaryrefslogtreecommitdiff
path: root/scr
blob: 4d069fff644ecb00e62aea03530c1181becb89f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

output="$(date '+%y%m%d%H%M%S').png"
xclip_cmd="xclip -selection clipboard -t image/png"

case "$(printf "Selected area\\nCurrent window\\nFull screen\\nSelected area (copy)\\nCurrent window (copy)\\nFull screen (copy)" | dmenu -i -c -l 6 -p "Screenshot area?")" in
    "Selected area") maim -u -s img-sel-"${output}" ;;
    "Current window") maim -u -B -q -d 0.2 -i "$(xdotool getactivewindow)" img-win-"${output}" ;;
    "Full screen") maim -u -q -d 0.2 img-full-"${output}" ;;
    "Selected area (copy)") maim -u -s | ${xclip_cmd} ;;
    "Current window (copy)") maim -u -B -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;;
    "Full screen (copy)") maim -u -q -d 0.2 | ${xclip_cmd} ;;
esac