dotfiles/.local/bin/aws

13 lines
343 B
Bash
Executable file

#!/bin/sh
notify(){
notify-send "aws" "screenshot copied to clipboard"
}
img="$HOME/Pictures/$(date +"%d_%m_%y-%H_%M_%S").png"
case "$1" in
-f) grim "$img" && wl-copy -t image/png < "$img" && notify ;;
-r) grim -g "$(slurp)" "$img" && wl-copy -t image/png < "$img" && notify ;;
-h|*) echo "usage: aws [-f] [-r]" >&2; exit 1; ;;
esac