#!/bin/sh # Screenshot Tool Script if [ "$1" = "q" ] || [ "$1" = "quick" ]; then { maim -u -m 10 ~/Pictures/Screenshots/screenshot-"$(date '+%Y%m%d_%H%M%S')".png } else { INPUT=$(printf "Screen\nSelection" | dmenu -i -p "Screenshot: ") case "$INPUT" in Screen) SAVE=$(printf "Clipboard\nNote\nPictures Folder" | dmenu -i -p "Save to: ") case "$SAVE" in "Clipboard") maim -u -q -d 1 -m 10 | xclip -selection clipboard -t image/png ;; "Pictures Folder") maim -u -q -d 1 -m 10 ~/Pictures/Screenshots/screenshot-"$(date '+%Y%m%d_%H%M%S')".png ;; "Note") DATE=$(date '+%y%m%d%H%M%S%N') maim -u -q -d 1 -m 10 /tmp/screenshot-"$DATE".png sxiv /tmp/screenshot-"$DATE".png esac ;; Selection) SAVE=$(printf "Clipboard\nNote\nPictures Folder" | dmenu -i -p "Save to: ") case "$SAVE" in "Clipboard") maim -s -u -m 10 | xclip -selection clipboard -t image/png ;; "Pictures Folder") maim -s -u -m 10 ~/Pictures/Screenshots/screenshot-"$(date '+%Y%m%d_%H%M%S')".png ;; "Note") DATE=$(date '+%y%m%d%H%M%S%N') maim -s -u -m 10 /tmp/screenshot-"$DATE".png sxiv /tmp/screenshot-"$DATE".png esac ;; esac } fi