aboutsummaryrefslogtreecommitdiff
path: root/notify
blob: f3d996e8a7ccbc6801a1a8cf667c921f129a1c0d (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
#!/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
		;;
esac

Generated with cgit - Back to sebastiano.tronto.net