diff options
author | ryo <ryo@nopwd.lol> | 2024-10-30 20:10:03 +0000 |
---|---|---|
committer | ryo <ryo@nopwd.lol> | 2024-10-30 20:10:03 +0000 |
commit | cc6d6fcfc6e8403e87dae9f092e61f0edf8e3cc6 (patch) | |
tree | f7f751a92c30b5ef7cf8770004c30479c516fdca /bin/scshot.sh |
Initial commit
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" |