From f485a9a5d1f7889ac6e78c6eb11962725c457f8c Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Mon, 7 Mar 2016 12:48:02 +0100 Subject: Add screenshot upload state notification --- post-screenshot.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/post-screenshot.sh b/post-screenshot.sh index df8acf2..5a4b478 100755 --- a/post-screenshot.sh +++ b/post-screenshot.sh @@ -12,5 +12,13 @@ FILE="$LOCAL_DIR/$FILE_NAME" scrot "$FILE" -s viewnior "$FILE" & -scp "$FILE" "$REMOTE_DIR/" & -echo -n "$BASE_URL/$FILE_NAME" | xclip -i + +scp "$FILE" "$REMOTE_DIR/" + +if [ $? -eq 0 ]; then + SCREENSHOT_URL="$BASE_URL/$FILE_NAME" + notify-send --category=transfer.complete "Screenshot upload complete." "$SCREENSHOT_URL" + echo -n "$SCREENSHOT_URL" | xclip -i +else + notify-send --category=transfer.error "Screenshot upload failed." +fi -- cgit v1.2.3