Compare commits
No commits in common. "0c7b4a637388778743c676f08787fb44b2420368" and "db916a23d2f180bd98dc7151890fa07c1e9771b5" have entirely different histories.
0c7b4a6373
...
db916a23d2
45
org/init.el
45
org/init.el
|
@ -360,55 +360,24 @@
|
||||||
; long break is 30 mins
|
; long break is 30 mins
|
||||||
; every 3rd pomodoro give 30 minute break
|
; every 3rd pomodoro give 30 minute break
|
||||||
|
|
||||||
; actual values
|
|
||||||
(setq pomidor-seconds (* 60 60)) ; total work period
|
(setq pomidor-seconds (* 60 60)) ; total work period
|
||||||
(setq pomidor-warmup-seconds (* 15 60)) ; warmup time
|
(setq pomidor-warmup-seconds (* 15 60)) ; warmup time
|
||||||
(setq pomidor-break-seconds (* 10 60))
|
(setq pomidor-break-seconds (* 10 60))
|
||||||
(setq pomidor-breaks-before-long 3)
|
(setq pomidor-breaks-before-long 3)
|
||||||
(setq pomidor-long-break-seconds (* 30 60))
|
(setq pomidor-long-break-seconds (* 30 60))
|
||||||
|
|
||||||
; setup emoji separators to enhance visual state indicators
|
; setup 'warmup period' functionality
|
||||||
(defun my-pomidor-separator-hook ()
|
(defun my-pomidor-update-hook ()
|
||||||
(let* ((state (pomidor--current-state))
|
(let* ((state (pomidor--current-state))
|
||||||
(total (pomidor--total-duration state))
|
(total (pomidor--total-duration state))
|
||||||
(elapsed (round (time-to-seconds total))))
|
(ellapsed (round (time-to-seconds total))))
|
||||||
(cond ; watch out for the order of this conditional
|
(if (<= ellapsed pomidor-warmup-seconds)
|
||||||
; there are overlapping states and this order is meaninful
|
(setq pomidor-header-separator " 🌡️↑ ")
|
||||||
((or (pomidor-overwork-p) (pomidor-break-over-p))
|
(setq pomidor-header-separator " — ")
|
||||||
(setq pomidor-header-separator " ⚠️ "))
|
|
||||||
((pomidor-should-long-break-p)
|
|
||||||
(setq pomidor-header-separator " 🪁 "))
|
|
||||||
((pomidor--break state)
|
|
||||||
(setq pomidor-header-separator " 🚶 "))
|
|
||||||
((<= elapsed pomidor-warmup-seconds)
|
|
||||||
(setq pomidor-header-separator " 🌡️↑ "))
|
|
||||||
(t (setq pomidor-header-separator " 🏢 "))
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
; add separator logic as std pomidor update hook to ensure the emoji separators get displayed
|
(add-hook 'pomidor-update-hook #'my-pomidor-update-hook)
|
||||||
; this will be delayed up to the pomidor-update-interval for display
|
|
||||||
(add-hook 'pomidor-update-hook #'my-pomidor-separator-hook)
|
|
||||||
; trigger the emoji separator for common operations so it 'triggers' faster than via the std pomidor update hook
|
|
||||||
; this should show the emoji separators 'faster' than relying on just the update hook
|
|
||||||
(advice-add #'pomidor-reset :after #'my-pomidor-separator-hook)
|
|
||||||
(advice-add #'pomidor-stop :after #'my-pomidor-separator-hook)
|
|
||||||
(advice-add #'pomidor-break :after #'my-pomidor-separator-hook)
|
|
||||||
|
|
||||||
; 'hold' visual indicator
|
|
||||||
(defun my-pomidor-hold-separator ()
|
|
||||||
(interactive)
|
|
||||||
(setq pomidor-header-separator " 💤 ")
|
|
||||||
(pomidor--update)
|
|
||||||
)
|
|
||||||
(advice-add #'pomidor-hold :before #'my-pomidor-hold-separator)
|
|
||||||
; 'unhold' -- reset visual indicator
|
|
||||||
(defun my-pomidor-unhold-separator ()
|
|
||||||
(interactive)
|
|
||||||
(my-pomidor-separator-hook)
|
|
||||||
(pomidor--update)
|
|
||||||
)
|
|
||||||
(advice-add #'pomidor-unhold :before #'my-pomidor-unhold-separator)
|
|
||||||
|
|
||||||
; position cursor @ top of pomidor buffer after rendering
|
; position cursor @ top of pomidor buffer after rendering
|
||||||
(defun my-pomidor-beginning-of-buffer (buffer states)
|
(defun my-pomidor-beginning-of-buffer (buffer states)
|
||||||
|
|
Reference in a new issue