Browse Source

Prevent flameshot scripts from uploading empty files on screenshot abortion

master
Alice Gaudon 10 months ago
parent
commit
96a2d1b8cf
2 changed files with 17 additions and 0 deletions
  1. +8
    -0
      flameshot_upload.sh
  2. +9
    -0
      flameshot_upload_latest.sh

+ 8
- 0
flameshot_upload.sh View File

@ -8,6 +8,14 @@ file_name+=$base_name
flameshot gui -r > $file_name
sum1=$(cat $file_name | md5sum)
sum2=$(echo -e "screenshot aborted" | md5sum)
if test "$sum1" = "$sum2"; then
notify-send "Screenshot aborted" "$url" --icon=flameshot.svg
exit
fi
url=$(sh $(dirname $0)/upload_file.sh $file_name)
echo $url | xclip -selection clipboard


+ 9
- 0
flameshot_upload_latest.sh View File

@ -7,6 +7,15 @@ base_name=$latest_screenshot
file_name+=$base_name
sum1=$(cat $file_name | md5sum)
sum2=$(echo -e "screenshot aborted" | md5sum)
if test "$sum1" = "$sum2"; then
notify-send "Last screenshot was aborted" "$url" --icon=flameshot.svg
exit
fi
url=$(sh $(dirname $0)/upload_file.sh $file_name)
echo $url | xclip -selection clipboard


Loading…
Cancel
Save