diff options
author | Colin Okay <colin@cicadas.surf> | 2022-08-16 08:48:00 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-08-16 08:48:00 -0500 |
commit | fc2d0024730849bc20a39581ea51e027df506812 (patch) | |
tree | 91ac0c315e12933686435c1b7bd6023ebb49ad72 | |
parent | 2fa5c0c4dee78cc3b1edd67ff360a8da3fe4bf2f (diff) |
[add] advice to publish what i'm doing on cicadas.surf
-rw-r--r-- | init-el.org | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/init-el.org b/init-el.org index d670954..5258165 100644 --- a/init-el.org +++ b/init-el.org @@ -229,7 +229,7 @@ So, to use this file for the very first time you must ** Org Mode Main Config #+name: org-mode-main-config -#+begin_src elisp :noweb no-export +#+begin_src elisp :noweb no-export :results none (package-install 'org) (setq org-duration-format 'h:mm) @@ -269,8 +269,26 @@ So, to use this file for the very first time you must (insert "\n") (insert (format "#+begin_src %s :noweb no-export\n\n#+end_src" lang))) +(defvar +cicadas-surf-task-status-file+ "/ssh:colin@cicadas.surf:~/.task") + +(defun clock-in-external-log-advice (&rest args) + "to be added as advice to org-clock-in" + (when +cicadas-surf-task-status-file+ + (with-temp-buffer + (insert (org-clock-get-clock-string)) + (write-file +cicadas-surf-task-status-file+)))) + +(defun clock-out-external-log-advice (&rest args) + (when +cicadas-surf-task-status-file+ + (with-temp-buffer + (write-file +cicadas-surf-task-status-file+)))) + +(advice-add 'org-clock-in :after #'clock-in-external-log-advice) +(advice-add 'org-clock-out :after #'clock-out-external-log-advice) #+end_src +#+RESULTS: org-mode-main-config + ** Org Mode and Babel Configuration |