summaryrefslogtreecommitdiff
path: root/scripts/notify
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/notify')
-rwxr-xr-xscripts/notify37
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/notify b/scripts/notify
new file mode 100755
index 0000000..38e1793
--- /dev/null
+++ b/scripts/notify
@@ -0,0 +1,37 @@
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 "[$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 exit 1
36 ;;
37esac

Generated with cgit - Back to sebastiano.tronto.net