aboutsummaryrefslogtreecommitdiff
path: root/notify
blob: 38e1793d2fcea9d0544023e788d0d7c89132eacd (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 "[$date $2]" >> "$file"
		$update
		;;
	clean)
		printf "" > "$file"
		$update
		;;
	edit)
		$EDITOR "$file"
		;;
	show)
		cat "$file"
		;;
	*)
		usage
		exit 1
		;;
esac

Generated with cgit - Back to sebastiano.tronto.net