Last active
March 24, 2022 21:43
Flameshot upload script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Base: https://github.com/notmeta/flameshot-s3-uploader | |
url="url" | |
key="secretkey" | |
temp_file="/tmp/screenshot.png" | |
flameshot gui -r > $temp_file | |
if [[ $(file --mime-type -b $temp_file) != "image/png" ]]; then | |
rm -rf $temp_file | |
notify-send "Screenshot aborted" -a "Flameshot" && exit 1 | |
fi | |
image_url=$(curl -s -F file=@$temp_file "$url?key=$key&onlyURL=1") | |
echo -n $image_url | xclip -sel c | |
notify-send "Image URL copied to clipboard" "$image_url" -a "Flameshot" -i $temp_file | |
rm -rf $temp_file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment