#!/bin/bash directory="$HOME/images/screenshots" file="$directory/$(date +%F_%s).jpg" notify() { notify-send "Screenshot saved" "images/screenshots/$(date +%F_%H-%M)" } case "$1" in "full") flameshot full -r > "$file" && notify ;; "select") flameshot gui -r > "$file" if [[ "$(stat $file | grep 'Size' | awk '{print $2}')" == "0" ]]; then rm "$file" else notify fi ;; *) notify-send "Error" "Couldn't save screenshot" ;; esac