summaryrefslogtreecommitdiff
path: root/scripts/nsend
blob: 3d28683fea0f9f1c4e581b1b44ce1db791692171 (plain)
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
#!/bin/sh

. slib

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

exit 0
}

check_program "notify-send" "dunst must be installed"

case "${1}" in
"-s")
	[ "${#}" -gt 3 ] && invalid_use

	echo $(printf 'notify-send "%s" "%s"' "${1}" "${2}")

	exit 0
;;
"-h") help ;;

*) invalid_use ;;

esac