]> git.donarmstrong.com Git - bin.git/blob - update_org_ical
pipe yes to emacs to avoid dumb questions
[bin.git] / update_org_ical
1 #!/bin/bash
2
3 TMPDIR=~/tmp
4 export TMPDIR
5 . ~/.ssh/ssh_agent_info_$(hostname)
6 LOCKOPTS=-q
7 if [ -n "$PS1" ]; then
8     LOCKOPTS=-f;
9 fi;
10 with-lock-ex $LOCKOPTS $TMPDIR/update_org_ical emacsclient -n -e '(org-save-all-org-buffers)' >/dev/null 2>&1
11 yes|with-lock-ex $LOCKOPTS $TMPDIR/update_org_ical emacs --batch -l ~/.emacs \
12     --eval '(setq org-icalendar-combined-description "Don Armstrong’s Calendar (org-mode)")' \
13     --eval '(setq org-icalendar-combined-name "Don Armstrong (org-mode)")' \
14     --eval "(setq org-icalendar-combined-agenda-file \"$TMPDIR/org.ics\")" \
15     --eval '(org-icalendar-combine-agenda-files)' \
16     --eval '(org-save-all-org-buffers)';
17 with-lock-ex $LOCKOPTS $TMPDIR/update_org_ical rsync -av "$TMPDIR/org.ics" rzlab.ucr.edu:debian/.google_ical*/org.ics