summaryrefslogtreecommitdiff
path: root/.local/bin/notify
blob: fce103d300f9c69607d57e11dbb8a3c0397c3420 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

if [ $# -lt 2 ]
then
	echo "Usage: ${0##*/} summary body [args ...]" >&2
	exit 1
fi

if [ -t 2 ]
then
	printf "%s: %s\n" "$NOTIFY_SHORT" "$2" >&2
else
	t="$(echo "$NOTIFY_LONG" | tr a-z A-Z)"
	s="$1"
	b="$2"
	c="${b##*[![:punct:]]}"
	[ -z "$c" ] && b="$2."
	shift 2
	notify-send "$@" -a "$t" "$s" "$b"
fi