From 7b68345ead9a3f5030a5aeb7eeb2d54b9a367191 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 4 Nov 2023 23:01:55 +0100 Subject: notify: Add the notify script --- .local/bin/notify | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 .local/bin/notify (limited to '.local/bin/notify') 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 -- cgit v1.2.3