TatriX / pomidor

Pomidor is a simple and cool pomodoro technique timer.
239 stars 17 forks source link

Be notified of the end of breaks #9

Closed dariuskramer closed 6 years ago

dariuskramer commented 6 years ago

Title says it all. I'll be nice to have the same notification system, alert+sound, to mark the end of breaks.

TatriX commented 6 years ago

Sounds good. I'll try to add one.

dariuskramer commented 6 years ago

Or just a hook.

TatriX commented 6 years ago

You can use existing hook currently:

(defun my-pomidor-update-hook ()
  (let ((break-duration 30) ;; seconds
        (ellapsed (time-to-seconds (pomidor-break-duration))))
    (when (> ellapsed break-duration)
      (pomidor-play-sound-file-async pomidor-sound-overwork))))

(add-hook 'pomidor-update-hook #'my-pomidor-update-hook)
dariuskramer commented 6 years ago

That doesn't works. It plays the overwork sound every 30 seconds :/

TatriX commented 6 years ago

See pomidor-default-alert. You may want to add alert call to your hook

(alert (format "Work!\Break: [%s]"
                   (format-time-string "%H:%M:%S" (pomidor-break-duration) t))
           :severity 'normal
           :icon pomidor-icon
           :title "Pomidor"
           :category 'pomidor)
dariuskramer commented 6 years ago

I'm sorry I have not been clear. It plays the overwork sound every 30 seconds, even when work time.

vfinotti commented 6 years ago

I am experiencing the same problem. This issue is caused by the pomidor-break-duration function, that returns a big number when :break is nil. I have describe the issue and presented a possible fix in pull request #11.

TatriX commented 6 years ago

Closed in https://github.com/TatriX/pomidor/commit/5780ce2aaa98882a79e92f5eefaaf10fd8dbee3a