summary refs log tree commit diff
path: root/bin/hibiki/nag
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2022-11-18 18:12:15 +0100
committerRobert Günzler <r@gnzler.io>2022-11-18 18:38:22 +0100
commit0c950cd2bdc4914648bb9af2a2cab041776dfe03 (patch)
treeef0d58ffd8d870511e866a39cf63859338ea1985 /bin/hibiki/nag
parent15e75bb089540747fd66ae2229f5c828f28d8945 (diff)
bin: commit some more scripts
Diffstat (limited to 'bin/hibiki/nag')
-rwxr-xr-xbin/hibiki/nag33
1 files changed, 33 insertions, 0 deletions
diff --git a/bin/hibiki/nag b/bin/hibiki/nag
new file mode 100755
index 0000000..bf4225b
--- /dev/null
+++ b/bin/hibiki/nag
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+set -e
+[ -n "$DEBUG" ] && set -x
+
+prio=1
+while getopts p:h opt; do
+	case "$opt" in
+	p)	prio=${OPTARG} ;;
+	h|?)	printf "usage: %s [options]\n" "$(basename "$0")"
+		printf "\n"
+		printf "  -p PRIORITY\t (3 = swaynag, 2 = sticky notification)\n"
+		printf "\n"
+		exit 2 ;;
+	esac
+done
+shift $((OPTIND - 1))
+
+message="$1"
+shift
+desc="$@"
+
+if [ ${prio} = 1 ]; then
+	exe="notify-send -u normal -t 10000 ${message} ${desc}"
+fi
+if [ ${prio} = 2 ]; then
+	exe="notify-send -u normal -t 0 ${message} ${desc}"
+fi
+if [ ${prio} = 3 ]; then
+	exe="swaynag -s ok -m ${message} ${desc}"
+fi
+
+exec $exe