The following script allows Flamehost screenshots to be uploaded for your own server and so you can self host your screenshots. I personaly like to use the applet Command Launcher to run the script for convenience.
- Flameshot itself
- one ssh key that is allowed on your server without a password set
- scp to copy the file to the server
- notify-send to show notifications
- xclip to copy the url upon file upload
- Replace the values between [--- ---] ex: [---YourDomainName.com---] -> domain.com
- copy the code block below to a .sh file with executable permissions ex: chmod +x fshot.sh
#!/bin/bash
filename=$(date "+%Y-%m-%d_%H_%M_%S".png)
url=https://[---YourDomainName.com---]/$filename
echo "Saving $filename"
# change to whichever binary you use, in the following line flatpak is used
flatpak run org.flameshot.Flameshot gui -r > ~/Downloads/fshot/$filename
# create the directory ~/Downloads/fshot first or change accordingly
if [[ ! -s ~/Downloads/fshot/$filename ]]; then
echo "Empty removing file $filename"
# notify-send should be installed in order to be notified
notify-send -i "applets-screenshooter-symbolic" "fshot - Aborted"
rm -f ~/Downloads/fshot/$filename
exit
fi
echo "Uploading file $filename"
notify-send -i "applets-screenshooter-symbolic" "fshot - Uploading file" $filename
# you should have one ssh key that is allowed in the server without a password set for a user
scp ~/Downloads/fshot/$filename [---user---]@[---YourDomainName.com---]:~/[---HomeFolderOnDomain---]/
# xclip should be installed to copy the screenshot url
printf https://[---YourDomainName.com---]/$filename | xclip -selection c
echo "Copied to clipboard $url"
notify-send -i "applets-screenshooter-symbolic" "fshot - Copied to clipboard" $url