org-create-files-for-current-year 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. YEAR=`date +"%Y"`
  3. # Create the journal file
  4. if [ ! -e "${HOME}/org/journal/${YEAR}.org.gpg" ] ; then
  5. touch "${HOME}/org/journal/${YEAR}.org"
  6. cat <<EOF > "${HOME}/org/journal/${YEAR}.org"
  7. # -*- epa-file-encrypt-to: ("266596F4") -*-
  8. #+Title: Journal ${YEAR}
  9. #+AUTHOR: Sam Flint
  10. #+EMAIL: swflint@flintfam.org
  11. #+DATE: \today
  12. #+INFOJS_OPT: view:info toc:nil path:http://flintfam.org/org-info.js
  13. #+OPTIONS: toc:nil H:5 ':t *:t d:nil stat:nil todo:nil
  14. #+LATEX_CLASS_OPTIONS: [10pt,twocolumn]
  15. #+LATEX_HEADER: \usepackage[landscape,margin=0.125 in]{geometry}
  16. #+LATEX_HEADER: \pagestyle{empty}
  17. EOF
  18. gpg -e -r 266596F4 "${HOME}/org/journal/${YEAR}.org"
  19. rm "${HOME}/org/journal/${YEAR}.org"
  20. fi
  21. echo "${HOME}/org/journal/${YEAR}.org.gpg"
  22. if [ ! -e "${HOME}/org/notes/${YEAR}.org" ] ; then
  23. touch "${HOME}/org/notes/${YEAR}.org"
  24. cat <<EOF > "${HOME}/org/notes/${YEAR}.org"
  25. #+Title: Notes from ${YEAR}
  26. #+AUTHOR: Sam Flint
  27. #+EMAIL: swflint@flintfam.org
  28. #+DATE: \today
  29. #+INFOJS_OPT: view:info toc:nil path:http://flintfam.org/org-info.js
  30. #+OPTIONS: toc:nil H:5 ':t *:t d:nil stat:nil todo:nil
  31. #+LATEX_CLASS_OPTIONS: [10pt,twocolumn]
  32. #+LATEX_HEADER: \usepackage[landscape,margin=0.125 in]{geometry}
  33. #+LATEX_HEADER: \pagestyle{empty}
  34. EOF
  35. fi
  36. echo "${HOME}/org/notes/${YEAR}.org"
  37. cd "${HOME}/org/" || exit 1
  38. git add "journal/${YEAR}.org.gpg" && git commit -m "Added the journal file for ${YEAR}"
  39. git add "notes/${YEAR}.org" && git commit -m "Added the notes file for ${YEAR}"