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

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