Update zipline/flameshot.sh

This commit is contained in:
Seaswimmer 2024-06-13 05:53:42 +00:00
parent 1ce349ec5c
commit ab41b066b0
Signed by: CoastalCommitsManagement
GPG key ID: 7E73189F651A553F

View file

@ -7,8 +7,10 @@ trap 'rm -f "$temp_file"' EXIT
# Replace TOKEN and ZIPLINE_URL with your authorization token and the url to your Zipline instance before use, nothing else needs modified # Replace TOKEN and ZIPLINE_URL with your authorization token and the url to your Zipline instance before use, nothing else needs modified
if curl -sS -fH "authorization: TOKEN" https://ZIPLINE_URL/api/upload -F file=@/tmp/ss.png -H "Content-Type: multipart/form-data" >"$temp_file" 2>&1; then if curl -sS -fH "authorization: TOKEN" https://ZIPLINE_URL/api/upload -F file=@/tmp/ss.png -H "Content-Type: multipart/form-data" >"$temp_file" 2>&1; then
jq -r '.files[0]' <"$temp_file" | tr -d '\n' | xsel -ib link=$(jq -r '.files[0]' <"$temp_file" | tr -d '\n')
notify-send -a "Flameshot" -u low -h "string:desktop-entry:org.flameshot.Flameshot" "Upload Successful" "Link copied to clipboard" echo "$link" | xsel -ib
notify-send -a "Flameshot" -u low -i /tmp/ss.png -h "string:desktop-entry:org.flameshot.Flameshot" "Upload Successful" "Link copied to clipboard:\n$link"
rm -f /tmp/ss.png
else else
notify-send -a "Flameshot" -u critical -h "string:desktop-entry:org.flameshot.Flameshot" "Upload Failed" "$(<"$temp_file")" notify-send -a "Flameshot" -u critical -h "string:desktop-entry:org.flameshot.Flameshot" "Upload Failed" "$(<"$temp_file")"
fi fi