#!/bin/sh help() { cat << EOF ${0}: Wrapper script to send notifications options: -s [Name] [Msg] Send Msg with Name -s [Msg] Send Msg Without Name -h Print this message and exit EOF } err() { for line in "${@}"; do echo "${line}" >&2 done exit 1 } if ! command -v notify-send > /dev/null 2>&1; then err "${0}: dunst must be installed" fi case "${1}" in "-s") [ ${#} -gt 3 ] && err "${0}: Invalid usage" "Try '${0} -h' for help." notify-send "${2}" "${3}" > /dev/null 2>&1 || err "${0}: Failed to send notification" exit 0 ;; "-h") help; exit 0 ;; *) err "${0}: Invalid usage" "Try '${0} -h' for help." ;; esac