aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/wiki/diary17
-rwxr-xr-xtools/wiki/notify7
2 files changed, 17 insertions, 7 deletions
diff --git a/tools/wiki/diary b/tools/wiki/diary
index 1ef77b9..aca7155 100755
--- a/tools/wiki/diary
+++ b/tools/wiki/diary
@@ -1,6 +1,8 @@
1#! /bin/bash 1#! /bin/bash
2 2
3pick_date() { 3today=~/vimwiki/diary/$(date --iso-8601).md
4
5specify_date() {
4 YEAR=${YEAR:-22} 6 YEAR=${YEAR:-22}
5 7
6 while read -p 'Month? ' -r MONTH; do 8 while read -p 'Month? ' -r MONTH; do
@@ -20,21 +22,22 @@ pick_date() {
20} 22}
21 23
22print_today() { 24print_today() {
23 cat ~/vimwiki/diary/$(date --iso-8601).md 25 cat $today
24} 26}
25 27
26edit_today() { 28edit_today() {
27 vim ~/vimwiki/diary/$(date --iso-8601).md 29 vim $today
28} 30}
29 31
30add_entry() { 32add_entry() {
31 echo - "$@" >>~/vimwiki/diary/$(date --iso-8601).md 33 [[ $# -ne 0 ]] && echo - "$@" >>$today
34 sed -E 's/\t/ /g; s/(^[[:space:]]*)/\1- /' >>$today
32} 35}
33 36
34case "$1" in 37case "$1" in
35 "") 38 specify)
36 pick_date ;; 39 specify_date ;;
37 p) 40 print)
38 print_today ;; 41 print_today ;;
39 today) 42 today)
40 edit_today ;; 43 edit_today ;;
diff --git a/tools/wiki/notify b/tools/wiki/notify
new file mode 100755
index 0000000..6e510d8
--- /dev/null
+++ b/tools/wiki/notify
@@ -0,0 +1,7 @@
1#! /bin/sh
2
3exec >/dev/pts/$(ls /dev/pts -t | head -1)
4
5echo
6echo
7cat