mirror of
https://github.com/SqrtMinusOne/pomm.el.git
synced 2025-12-10 14:43:03 +03:00
fix: do not play sounds on non-working periods
This commit is contained in:
parent
c7eef01fba
commit
e26a8f9470
1 changed files with 5 additions and 4 deletions
9
pomm.el
9
pomm.el
|
|
@ -316,7 +316,7 @@ which can be played by `pomm-audio-player-executable'."
|
||||||
(setq pomm-audio-enabled nil))
|
(setq pomm-audio-enabled nil))
|
||||||
(when-let (sound (alist-get kind pomm-audio-files))
|
(when-let (sound (alist-get kind pomm-audio-files))
|
||||||
(start-process
|
(start-process
|
||||||
"pomm audio player"
|
"pomm-audio-player"
|
||||||
nil
|
nil
|
||||||
pomm-audio-player-executable
|
pomm-audio-player-executable
|
||||||
sound))))
|
sound))))
|
||||||
|
|
@ -327,8 +327,8 @@ which can be played by `pomm-audio-player-executable'."
|
||||||
((eq (alist-get 'status pomm--state) 'stopped)
|
((eq (alist-get 'status pomm--state) 'stopped)
|
||||||
(pomm--maybe-play-sound 'stop))
|
(pomm--maybe-play-sound 'stop))
|
||||||
((eq (alist-get 'status pomm--state) 'running)
|
((eq (alist-get 'status pomm--state) 'running)
|
||||||
(pomm--maybe-play-sound (alist-get 'kind
|
(pomm--maybe-play-sound
|
||||||
(alist-get 'current pomm--state))))))
|
(alist-get 'kind (alist-get 'current pomm--state))))))
|
||||||
|
|
||||||
(defun pomm--dispatch-notification (kind)
|
(defun pomm--dispatch-notification (kind)
|
||||||
"Dispatch a notification about a start of a period.
|
"Dispatch a notification about a start of a period.
|
||||||
|
|
@ -441,7 +441,8 @@ The condition is: (effective-start-time + length) < now."
|
||||||
(when (pomm--need-switch-p)
|
(when (pomm--need-switch-p)
|
||||||
(pomm--switch-to-next))
|
(pomm--switch-to-next))
|
||||||
(run-hooks 'pomm-on-tick-hook)
|
(run-hooks 'pomm-on-tick-hook)
|
||||||
(pomm--maybe-play-sound 'tick)))))
|
(when (eq (alist-get 'kind (alist-get 'current pomm--state)) 'work)
|
||||||
|
(pomm--maybe-play-sound 'tick))))))
|
||||||
|
|
||||||
(defun pomm--get-time-remaning ()
|
(defun pomm--get-time-remaning ()
|
||||||
"Get time remaining in the current pomodoro period.
|
"Get time remaining in the current pomodoro period.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue