summaryrefslogtreecommitdiff
path: root/.local/bin/notify
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-11-04 23:01:55 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-11-04 23:01:55 +0100
commit7b68345ead9a3f5030a5aeb7eeb2d54b9a367191 (patch)
tree4baa41612157e017ba49c1314100e1bf04d57d6c /.local/bin/notify
parent54a957bf5b27d0d8bc73365b5f3509bff9963bda (diff)
notify: Add the notify script
Diffstat (limited to '.local/bin/notify')
-rwxr-xr-x.local/bin/notify18
1 files changed, 18 insertions, 0 deletions
diff --git a/.local/bin/notify b/.local/bin/notify
new file mode 100755
index 0000000..39669fe
--- /dev/null
+++ b/.local/bin/notify
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+if [ $# -lt 4 ]
+then
+ echo "Usage: ${0##*/} short long summary body [args ...]" >&2
+ exit 1
+fi
+
+if [ -t 2 ]
+then
+ printf "%s: %s\n" "$1" "$4" >&2
+else
+ t="$(echo "$2" | tr a-z A-Z)"
+ s="$3"
+ b="$4."
+ shift 4
+ notify-send "$@" -a "$t" "$s" "$b"
+fi