Prevent flameshot scripts from uploading empty files on screenshot abortion
This commit is contained in:
parent
7457809df4
commit
96a2d1b8cf
@ -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
|
||||
|
@ -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…
Reference in New Issue
Block a user