diff options
Diffstat (limited to 'bin/scshot.sh')
-rwxr-xr-x | bin/scshot.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/scshot.sh b/bin/scshot.sh new file mode 100755 index 0000000..e789c6e --- /dev/null +++ b/bin/scshot.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env dash + +sspath="$HOME/media" +ssname="$(date +"%F_%I%M").png" + +cd $sspath + +if [ "$1" = "a" ]; then + scrot $ssname +else + scrot -s $ssname +fi +if [ $? -ne 0 ]; then + dunstify -t 2000 "Screenshot aborted" + exit 0 +fi + +xclip -selection clipboard -t image/png $ssname + +sleep 1 +dunstify "Screenshot taked" "$sspath\n$ssname" |