blob: 5e75fd8f6e5c5e265189cacc837a65cfd0079ccb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/bin/sh
# sends xnotify a notification
unset TAG SEC
exec > ${XNOTIFY_FIFO:=$HOME_CACHE/xnotify$DISPLAY.fifo}
ug_err()
{
echo "${1}" 1>&2 && return "${2:-1}"
}
usage()
{
ug_err "usage: ${0##*/} [ -s seconds ] [ -t tag ] <TITLE> [BODY]
-s seconds seconds for notification to live
-t tag category of notification"
exit
}
while getopts s:t: arg; do
case ${arg} in
s) SEC=${OPTARG};;
t) TAG=${OPTARG};;
*) 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
|