summaryrefslogtreecommitdiff
path: root/scripts/gui/nsend
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gui/nsend')
-rwxr-xr-xscripts/gui/nsend32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/gui/nsend b/scripts/gui/nsend
new file mode 100755
index 0000000..80e1764
--- /dev/null
+++ b/scripts/gui/nsend
@@ -0,0 +1,32 @@
+#!/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" "libnotify must be installed"
+
+case "${1}" in
+"-s")
+ [ "${#}" -gt 3 ] && invalid_use
+
+ shift
+ eval $(printf 'notify-send "%s" "%s"' "${1}" "${2}")
+
+ exit 0
+;;
+"-h") help ;;
+
+*) invalid_use ;;
+
+esac