#!/usr/bin/env sh # usage: notify-send [ -t display_sec ] [ message ] [ < stdin ] # send notifications and OSD messages through xwin-statusd # accepts message arguments or first line passed through stdin N_FIFO="$XDG_RUNTIME_DIR/.notify.$XDG_SESSION_ID" [ -p "$N_FIFO" ] || { echo "${0##*/}: Cannot write to '$N_FIFO', exiting." 1>&2; exit 1; } unset SECS case "$1" in -t) SECS="$2" && shift 2;; -h) { grep '^# ' | sed 's/# //'; } < "$0"; exit;; esac SECS="${SECS:-5}" # default is 5 seconds echo "$SECS ${@:-$(cat /dev/stdin)}" >> "$N_FIFO"