From 31eafd787e4eb5a5278a58306169917e0d8acaa0 Mon Sep 17 00:00:00 2001 From: Jacob Herd Date: Mon, 31 May 2021 15:08:09 -0400 Subject: [PATCH] Flameshot Uploader script --- flameshot_example.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 flameshot_example.sh diff --git a/flameshot_example.sh b/flameshot_example.sh new file mode 100644 index 0000000..c5f0d23 --- /dev/null +++ b/flameshot_example.sh @@ -0,0 +1,22 @@ +#!/bin/bash +IMAGEPATH="$HOME/Pictures/" #where to hold the screenshots before they are deleted +IMAGENAME="ass" #Not really important, tells flameshot what file to send and delete +KEY="" #Enter auth key +DOMAIN="" #your upload domain + +flameshot config -f $IMAGENAME #Make sure that flameshot names the file correctly +flameshot gui -r -p $IMAGEPATH #Prompt the screenshot GUI + +#Upload the image and copy the response URL +URL=$(curl -X POST \ + -H "Content-Type: multipart/form-data" \ + -H "Accept: application/json" \ + -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 + +rm $IMAGEPATH$IMAGENAME.png #Delete the image locally + + +