diff options
author | Pacien TRAN-GIRARD | 2016-03-07 09:42:38 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2016-03-07 09:42:38 +0100 |
commit | a2e1d274224e7e5e6a9afd519fdbe5276c4f08c1 (patch) | |
tree | 68ee7ee9ee9d2a1a1ea2601c3bef4c04b0ad13c1 | |
download | desktop-utilities-a2e1d274224e7e5e6a9afd519fdbe5276c4f08c1.tar.gz |
Add screenshot web publishing script
-rwxr-xr-x | post-screenshot.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/post-screenshot.sh b/post-screenshot.sh new file mode 100755 index 0000000..df8acf2 --- /dev/null +++ b/post-screenshot.sh | |||
@@ -0,0 +1,16 @@ | |||
1 | #!/usr/bin/env sh | ||
2 | |||
3 | LOCAL_DIR="/home/pacien/medias/pictures/screenshots" | ||
4 | REMOTE_DIR="nginx.l:/var/www/files.pacien.net/screenshots" | ||
5 | BASE_URL="https://files.pacien.net/screenshots" | ||
6 | |||
7 | TS=$(date +"%s") | ||
8 | RAND=$(shuf -i 1000-9999 -n 1) | ||
9 | |||
10 | FILE_NAME="$TS$RAND.png" | ||
11 | FILE="$LOCAL_DIR/$FILE_NAME" | ||
12 | |||
13 | scrot "$FILE" -s | ||
14 | viewnior "$FILE" & | ||
15 | scp "$FILE" "$REMOTE_DIR/" & | ||
16 | echo -n "$BASE_URL/$FILE_NAME" | xclip -i | ||