tadd screenshot tool - scripts - random scripts
git clone git://parazyd.org/scripts.git
Log
Files
Refs
---
commit 03dc04f52bf41dedfdec38532eb7df43873144ff
parent 5a6eff26d98276c443543419327c4459af3d07e5
Author: parazyd 
Date:   Wed, 15 Feb 2017 05:03:04 +0100

add screenshot tool

Diffstat:
  M autoup                              |       5 +++++
  A skrot                               |      18 ++++++++++++++++++

2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/autoup b/autoup
t@@ -6,6 +6,11 @@ server=pub.parazyd.cf
 webroot=/home/parazyd/public_html/pub.parazyd.cf
 webdir=dev/random
 
+test "$1" = -n && {
+        shift
+        webdir=dev/null
+}
+
 test -z "$1" && exit 1 || filename=$(basename $1)
 scp -i "$sshkey" "$1" "${sshuser}@${server}:${webroot}/${webdir}/${filename}"
 echo "https://$server/$webdir/$filename" | xclip -i
diff --git a/skrot b/skrot
t@@ -0,0 +1,18 @@
+#!/bin/sh
+
+shotdir="$HOME/screenshots"
+
+case "x$1" in
+        x-s)
+                import "$shotdir/last.png" && \
+                        play -n synth 0.1 sin 880
+                ;;
+        x)
+                import -window root "$shotdir/$(date +%Y-%m-%d-%H-%M-%S)-1366x768.png" && \
+                        play -n synth 0.1 sin 880 | echo -e "\a"
+                ;;
+        *)
+                >&2 printf "skrot: internal error\n"
+                exit 1
+                ;;
+esac