Use built-in vuiet mode-line updating and fix vuiet hydra
This commit is contained in:
parent
a4509dda0e
commit
7e3b545dd7
@ -6210,24 +6210,12 @@ A music browser and player:
|
||||
vuiet--playing-track)
|
||||
:defer t
|
||||
:config
|
||||
(setq vuiet-update-mode-line-automatically t
|
||||
vuiet-update-mode-line-interval 1)
|
||||
(defun vuiet-mode-setup ()
|
||||
(set (make-local-variable 'org-link-elisp-confirm-function)
|
||||
nil))
|
||||
(add-hook 'vuiet-mode-hook #'vuiet-mode-setup)
|
||||
(defun vuiet-safe-update-mode-line ()
|
||||
(interactive)
|
||||
(with-local-quit
|
||||
(ignore-errors
|
||||
(vuiet-update-mode-line))))
|
||||
(defvar vuiet-mode-line-update-timer nil)
|
||||
(defun vuiet-reset-mode-line ()
|
||||
(interactive)
|
||||
(when vuiet-mode-line-update-timer
|
||||
(cancel-timer vuiet-mode-line-update-timer))
|
||||
(vuiet-safe-update-mode-line)
|
||||
(setq vuiet-mode-line-update-timer
|
||||
(run-at-time t 1 #'vuiet-safe-update-mode-line)))
|
||||
(vuiet-reset-mode-line)
|
||||
:general
|
||||
((normal motion visual) vuiet-mode-map "q" #'quit-window)
|
||||
((normal motion visual) vuiet-mode-map "C-m" #'org-open-at-point))
|
||||
@ -6256,7 +6244,7 @@ And a handy hydra for it:
|
||||
(format-time-string "%M:%S" (condition-case nil
|
||||
(mpv-get-playback-position)
|
||||
(error 0)))
|
||||
(format-time-string "%M:%S" (vuiet-track-duration track)))
|
||||
(s-pad-left 5 "0" (vuiet-track-duration track)))
|
||||
"[00:00/00:00]"))
|
||||
|
||||
(defvar hydra-vuiet-body-timer)
|
||||
|
Loading…
Reference in New Issue
Block a user