blob: 48b7eee533569b5c1801b840294452f95c312e77 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/bin/sh
# Simple notification manager.
# Notifications are sent to a log file together with a time stamp.
# Requires: xroot-update (optional)
# Usage: notify [push MESSAGE | clean | edit | show]
update=xroot-update
file="${XDG_DATA_HOME:-.local/share}/notify"
date=$(date +'%H:%M')
usage() {
echo "Usage: notify [push MESSAGE | clean | edit | show]"
}
touch "$file"
case "$1" in
push)
echo "(Notified $date) $2" >> "$file"
$update
;;
clean)
printf "" > "$file"
$update
;;
edit)
$EDITOR "$file"
;;
show)
cat "$file"
;;
*)
usage
exit 1
;;
esac
|