aboutsummaryrefslogtreecommitdiff
path: root/bin/scshot.sh
diff options
context:
space:
mode:
authorryo <ryo@nopwd.lol>2024-10-30 20:10:03 +0000
committerryo <ryo@nopwd.lol>2024-10-30 20:10:03 +0000
commitcc6d6fcfc6e8403e87dae9f092e61f0edf8e3cc6 (patch)
treef7f751a92c30b5ef7cf8770004c30479c516fdca /bin/scshot.sh
Initial commit
Diffstat (limited to 'bin/scshot.sh')
-rwxr-xr-xbin/scshot.sh21
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"