diff --git a/flameshot_upload.sh b/flameshot_upload.sh index c925fe2..c21afd7 100755 --- a/flameshot_upload.sh +++ b/flameshot_upload.sh @@ -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 diff --git a/flameshot_upload_latest.sh b/flameshot_upload_latest.sh index 72ce40b..535612f 100755 --- a/flameshot_upload_latest.sh +++ b/flameshot_upload_latest.sh @@ -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