#!/bin/sh # Inspired by grimblast (https://github.com/hyprwm/contrib/blob/main/grimblast/grimblast) # Helper functions die() { MSG="${1}" ERR_CODE="${2:-1}" URGENCY="${3:-critical}" >&2 echo "$MSG" if [ "$NOTIFY" = "yes" ]; then notify-send -a screenshot -u "$URGENCY" "Error ($ERR_CODE)" "$MSG" fi exit "$ERR_CODE" } # Argument parsing SAVE_METHOD= SAVE_FILE= TARGET= NOTIFY=no CURSOR=no EDIT=no DELAY=0 while [ "${1-}" ]; do case "$1" in -h | --help) >&2 cat <