shot (705B)
1 #!/usr/bin/env bash 2 3 to="" 4 if command -v grim &> /dev/null; then 5 case $1 in 6 %c) to='clipboard'; grim -g "$(slurp)" - | wl-copy ;; 7 %d) to=~/desktop/pictures/screenshots/$(hostname)/$(date +'%Y-%m-%d-%H%M%S').png; grim -g "$(slurp)" "$to" ;; 8 *) to=$1; grim -g "$(slurp)" "$to" ;; 9 esac 10 else 11 maim -g $(slop; sleep ${2:-0}) | { 12 case $1 in 13 %c) to='clipboard'; xclip -selection clipboard -t image/png ;; 14 %d) to=~/desktop/pictures/screenshots/$(hostname)/$(date +'%Y-%m-%d-%H%M%S').png; cat > "$to" ;; 15 *) to=$1; cat > "$to" ;; 16 esac 17 } 18 fi 19 notify-send --category=recording \ 20 --icon=$to \ 21 'Screenshot Taken' "Saved to $to"