summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2017-01-27 23:19:51 +0100
committerPacien TRAN-GIRARD2017-01-27 23:19:51 +0100
commitc1db63cc6bd47d9d902382d57efd8ddf35a2cb95 (patch)
treec7cbf652cfd0d15ee555dbd537b60291a9d29d99
parentde7b77f70d76024f243e90393bfbcc3f28c01cc7 (diff)
downloaddesktop-utilities-c1db63cc6bd47d9d902382d57efd8ddf35a2cb95.tar.gz
Use paste.gnugen.ch service
-rwxr-xr-xpost-screenshot.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/post-screenshot.sh b/post-screenshot.sh
index a798dd1..edca85e 100755
--- a/post-screenshot.sh
+++ b/post-screenshot.sh
@@ -1,8 +1,8 @@
1#!/usr/bin/env sh 1#!/usr/bin/env sh
2 2
3LOCAL_DIR="/home/pacien/medias/pictures/screenshots" 3LOCAL_DIR="/home/pacien/medias/pictures/screenshots"
4REMOTE_DIR="nginx.berlioz:/var/www/files.pacien.net/screenshots" 4REMOTE_SERVICE_URL="https://paste.gnugen.ch"
5BASE_URL="https://files.pacien.net/screenshots" 5PASTE_EXPIRATION="1d"
6 6
7TS=$(date +"%s") 7TS=$(date +"%s")
8RAND=$(shuf -i 1000-9999 -n 1) 8RAND=$(shuf -i 1000-9999 -n 1)
@@ -13,10 +13,9 @@ FILE="$LOCAL_DIR/$FILE_NAME"
13scrot "$FILE" -s 13scrot "$FILE" -s
14viewnior "$FILE" & 14viewnior "$FILE" &
15 15
16scp "$FILE" "$REMOTE_DIR/" 16SCREENSHOT_URL=$(curl -F "file=@$FILE;type=image/png" -F "expire=$PASTE_EXPIRATION" -H "Expect:" "$REMOTE_SERVICE_URL")
17 17
18if [ $? -eq 0 ]; then 18if [ $? -eq 0 ]; then
19 SCREENSHOT_URL="$BASE_URL/$FILE_NAME"
20 notify-send --category=transfer.complete "Screenshot upload complete." "$SCREENSHOT_URL" 19 notify-send --category=transfer.complete "Screenshot upload complete." "$SCREENSHOT_URL"
21 echo -n "$SCREENSHOT_URL" | xclip -i 20 echo -n "$SCREENSHOT_URL" | xclip -i
22else 21else