summaryrefslogtreecommitdiff
path: root/scripts/notify
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-05-06 08:30:49 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2026-05-06 08:30:49 +0200
commit60052659b98832c78c902e4f27ecee2663d8e913 (patch)
tree9efc1388569c43456557aa1975b4bec99bf06c94 /scripts/notify
parent10e16c2fb2266bb2b46ec7ea64d721de0c29a0d9 (diff)
downloadconfig-60052659b98832c78c902e4f27ecee2663d8e913.tar.gz
config-60052659b98832c78c902e4f27ecee2663d8e913.zip
Added scripts
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