Prevent flameshot scripts from uploading empty files on screenshot abortion

This commit is contained in:
Alice Gaudon 2020-09-01 11:52:19 +02:00
parent 7457809df4
commit 96a2d1b8cf
2 changed files with 17 additions and 0 deletions

View File

@ -8,6 +8,14 @@ file_name+=$base_name
flameshot gui -r > $file_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) url=$(sh $(dirname $0)/upload_file.sh $file_name)
echo $url | xclip -selection clipboard echo $url | xclip -selection clipboard

View File

@ -7,6 +7,15 @@ base_name=$latest_screenshot
file_name+=$base_name 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) url=$(sh $(dirname $0)/upload_file.sh $file_name)
echo $url | xclip -selection clipboard echo $url | xclip -selection clipboard