diff options
Diffstat (limited to 'bin/notif')
-rwxr-xr-x | bin/notif | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/bin/notif b/bin/notif index 5e75fd8..ad1b625 100755 --- a/bin/notif +++ b/bin/notif @@ -1,7 +1,7 @@ #!/bin/sh # sends xnotify a notification unset TAG SEC -exec > ${XNOTIFY_FIFO:=$HOME_CACHE/xnotify$DISPLAY.fifo} +exec > "${XNOTIFY_FIFO:=$HOME_CACHE/xnotify.fifo}" ug_err() { echo "${1}" 1>&2 && return "${2:-1}" @@ -20,16 +20,5 @@ while getopts s:t: arg; do *) usage;; esac done -if [ -n "$SEC" ]; then - printf 'SEC:%s\t' "$SEC" - shift 2 -fi -if [ -n "$TAG" ]; then - printf 'TAG:%s\t' "$TAG" - shift 2 -fi -case "$#" in - 1) printf '%s\n' "$1";; - 2) printf '%s\t%s\n' "$1" "$2";; - *) exit;; -esac +shift $((OPTIND - 1)) +printf ${SEC+SEC:%s"\t"}${TAG+TAG:%s"\t"}${2+%s"\t"}'%s\n' $SEC $TAG "$1" "$2" |