aboutsummaryrefslogtreecommitdiff
path: root/bard-elisp
diff options
context:
space:
mode:
authorBardofSprites <[email protected]>2025-04-22 18:10:04 -0400
committerBardofSprites <[email protected]>2025-04-22 18:10:04 -0400
commit0ea15ba2625ab1ecb902b883efb5f94a273015f1 (patch)
tree7e40d85b08c17f16a747368fa4756ab6f11a1de1 /bard-elisp
parent480dfe2c09070cf4c710e6806cb3a6cbdc93f7cf (diff)
study session with sowon cl script
study.lisp found on my dotfiles-stow repo
Diffstat (limited to 'bard-elisp')
-rw-r--r--bard-elisp/bard-calendar.el23
1 files changed, 19 insertions, 4 deletions
diff --git a/bard-elisp/bard-calendar.el b/bard-elisp/bard-calendar.el
index d14a133..7c2efc6 100644
--- a/bard-elisp/bard-calendar.el
+++ b/bard-elisp/bard-calendar.el
@@ -3,11 +3,26 @@
;; Org Clock
(defun bard/auto-clock-in ()
- "Automatically clock in when task marked in progress (INPROG)."
+ "Automatically clock in when task marked in progress (INPROG),
+ and start study session."
(when (equal (org-get-todo-state) "INPROG")
- (org-clock-in))
- (when (equal (org-get-todo-state) "DONE")
- (org-clock-out)))
+ (org-clock-in)
+ (bard/study-session)))
+
+(defun bard/study-session ()
+ "Prompt for study parameters, run study session, and clock out when done."
+ (interactive)
+ (let* ((study-time (read-string "Study time (minutes): "))
+ (break-time (read-string "Break time (minutes): "))
+ (sessions (read-string "Number of sessions: "))
+ (command (format "study %s %s %s" study-time break-time sessions))
+ (process (start-process-shell-command "study-session" "*study*" command)))
+ (set-process-sentinel
+ process
+ (lambda (_proc event)
+ (when (string= event "finished\n")
+ (progn (org-clock-out)
+ (pop-to-buffer-same-window "todo.org")))))))
(defun bard/org-clock-report ()
(interactive)