aboutsummaryrefslogtreecommitdiff
path: root/notify
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-06-19 10:09:47 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2023-06-19 10:09:47 +0200
commitc5d101ab2c9db3b1a001cb56953cb90b24f8fdcf (patch)
tree1286eccbd051723e443c26b43e739007ee53dc06 /notify
parent2c065927ff405b2d8b2eec6fc1fbee9c4f93e0a8 (diff)
downloadscripts-c5d101ab2c9db3b1a001cb56953cb90b24f8fdcf.tar.gz
scripts-c5d101ab2c9db3b1a001cb56953cb90b24f8fdcf.zip
Added notify
Diffstat (limited to '')
-rwxr-xr-xnotify36
1 files changed, 36 insertions, 0 deletions
diff --git a/notify b/notify
new file mode 100755
index 0000000..f3d996e
--- /dev/null
+++ b/notify
@@ -0,0 +1,36 @@
1#!/bin/sh
2
3# Simple notification manager.
4# Notifications are sent to a log file together with a time stamp.
5# Requires: xroot-update (optional)
6
7# Usage: notify [push MESSAGE | clean | edit | show]
8
9update=xroot-update
10file="${XDG_DATA_HOME:-.local/share}/notify"
11date=$(date +'%H:%M')
12
13usage() {
14 echo "Usage: notify [push MESSAGE | clean | edit | show]"
15}
16
17touch "$file"
18case "$1" in
19 push)
20 echo "(Notified $date) $2" >> "$file"
21 $update
22 ;;
23 clean)
24 printf "" > "$file"
25 $update
26 ;;
27 edit)
28 $EDITOR "$file"
29 ;;
30 show)
31 cat "$file"
32 ;;
33 *)
34 usage
35 ;;
36esac

Generated with cgit - Back to sebastiano.tronto.net