summaryrefslogtreecommitdiff
path: root/.local/bin/maimshot
blob: c85e1c075979c8cade8a92ba277c271e1da44020 (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

case "$(printf "a selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)\\na selected area\\ncurrent window\\nfull screen" | dmenu -l 6 -i -p "Screenshot which area?")" in
	"a selected area (copy)") maim -u -s | xclip -selection clipboard -t image/png ;;
	"current window (copy)") maim -i "$(xdotool getactivewindow)" | xclip -selection clipboard -t image/png ;;
	"full screen (copy)") sleep 0.2 ; maim | xclip -selection clipboard -t image/png ;;
        "a selected area") maim -u -s ~/pix/ss/pic-selected-$(uuidgen | awk -F- '{printf $2}')-"$(date '+%y-%m-%d').png" ;;
	"current window") maim -i "$(xdotool getactivewindow)" ~/pix/ss/pic-window-"$(uuidgen | awk -F- '{printf $2}')-$(date '+%y-%m-%d').png" ;;
	"full screen") sleep 0.2 ; maim ~/pix/ss/pic-full-"$(uuidgen | awk -F- '{printf $2}')-$(date '+%y-%m-%d').png" ;;
esac