From 8031758fcb3053fbd595cdae8567bb3aab7f1f8a Mon Sep 17 00:00:00 2001 From: Charlie <45357714+GoodPro712@users.noreply.github.com> Date: Fri, 24 Sep 2021 15:33:23 +1000 Subject: [PATCH 1/4] Printf instead of echo --- flameshot_example.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flameshot_example.sh b/flameshot_example.sh index 9f0b280..c2ad791 100644 --- a/flameshot_example.sh +++ b/flameshot_example.sh @@ -2,7 +2,7 @@ IMAGEPATH="$HOME/Pictures/" # Where to store screenshots before they're deleted IMAGENAME="ass" # Not really important, tells Flameshot what file to send and delete KEY="" # Your ass upload token -DOMAIN="" # Your upload domain +DOMAIN="" # Your upload domain (http(s)) flameshot config -f "$IMAGENAME" # Make sure that Flameshot names the file correctly flameshot gui -r -p "$IMAGEPATH" # Prompt the screenshot GUI @@ -14,6 +14,6 @@ URL=$(curl -X POST \ -H "User-Agent: ShareX/13.4.0" \ -H "Authorization: $KEY" \ -F "file=@$IMAGEPATH$IMAGENAME.png" "https://$DOMAIN/" | grep -Po '(?<="resource":")[^"]+') -echo "$URL" | xclip -sel clip +printf "$URL" | xclip -sel clip rm "$IMAGEPATH$IMAGENAME.png" # Delete the image locally From 4e736cc140a3603b40558c12a98f8fe4d6b2abf5 Mon Sep 17 00:00:00 2001 From: Charlie <45357714+GoodPro712@users.noreply.github.com> Date: Fri, 24 Sep 2021 15:38:25 +1000 Subject: [PATCH 2/4] Printf comment --- flameshot_example.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flameshot_example.sh b/flameshot_example.sh index c2ad791..29d58a4 100644 --- a/flameshot_example.sh +++ b/flameshot_example.sh @@ -2,7 +2,7 @@ IMAGEPATH="$HOME/Pictures/" # Where to store screenshots before they're deleted IMAGENAME="ass" # Not really important, tells Flameshot what file to send and delete KEY="" # Your ass upload token -DOMAIN="" # Your upload domain (http(s)) +DOMAIN="" # Your upload domain (without http(s)) flameshot config -f "$IMAGENAME" # Make sure that Flameshot names the file correctly flameshot gui -r -p "$IMAGEPATH" # Prompt the screenshot GUI @@ -14,6 +14,7 @@ URL=$(curl -X POST \ -H "User-Agent: ShareX/13.4.0" \ -H "Authorization: $KEY" \ -F "file=@$IMAGEPATH$IMAGENAME.png" "https://$DOMAIN/" | grep -Po '(?<="resource":")[^"]+') +# printf instead of echo as echo appends a newline printf "$URL" | xclip -sel clip rm "$IMAGEPATH$IMAGENAME.png" # Delete the image locally From db7c3c9281e209e499c82a94ae991f8f45876d75 Mon Sep 17 00:00:00 2001 From: Charlie <45357714+GoodPro712@users.noreply.github.com> Date: Fri, 24 Sep 2021 15:43:08 +1000 Subject: [PATCH 3/4] Printf "bug" (Deepsource was upset) --- flameshot_example.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flameshot_example.sh b/flameshot_example.sh index 29d58a4..b64529f 100644 --- a/flameshot_example.sh +++ b/flameshot_example.sh @@ -15,6 +15,6 @@ URL=$(curl -X POST \ -H "Authorization: $KEY" \ -F "file=@$IMAGEPATH$IMAGENAME.png" "https://$DOMAIN/" | grep -Po '(?<="resource":")[^"]+') # printf instead of echo as echo appends a newline -printf "$URL" | xclip -sel clip +printf "%s" "$URL" | xclip -sel clip rm "$IMAGEPATH$IMAGENAME.png" # Delete the image locally From 46c4c07729c27b87176f0f199de7a7ec7a14861f Mon Sep 17 00:00:00 2001 From: Charlie <45357714+Metacinnabar@users.noreply.github.com> Date: Sat, 2 Oct 2021 10:10:26 +1000 Subject: [PATCH 4/4] Clarify comment --- flameshot_example.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flameshot_example.sh b/flameshot_example.sh index b64529f..d87e3a0 100644 --- a/flameshot_example.sh +++ b/flameshot_example.sh @@ -2,7 +2,7 @@ IMAGEPATH="$HOME/Pictures/" # Where to store screenshots before they're deleted IMAGENAME="ass" # Not really important, tells Flameshot what file to send and delete KEY="" # Your ass upload token -DOMAIN="" # Your upload domain (without http(s)) +DOMAIN="" # Your upload domain (without http:// or https://) flameshot config -f "$IMAGENAME" # Make sure that Flameshot names the file correctly flameshot gui -r -p "$IMAGEPATH" # Prompt the screenshot GUI