diff options
author | jao <jao@gnu.org> | 2021-11-15 21:41:30 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-11-15 21:41:30 +0000 |
commit | 9c9cff59c4c78c7eea637fec7cd2d43b6832a897 (patch) | |
tree | e0eb0dd9e88f5fe575b51b6f4c250f8ce71efc3a | |
parent | 0af6989d4d638f109e4cd7beb6ff37a4e97e426a (diff) | |
download | elibs-9c9cff59c4c78c7eea637fec7cd2d43b6832a897.tar.gz elibs-9c9cff59c4c78c7eea637fec7cd2d43b6832a897.tar.bz2 |
jao-mpris nits
-rw-r--r-- | lib/media/jao-mpris.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/media/jao-mpris.el b/lib/media/jao-mpris.el index 36cde05..fe89865 100644 --- a/lib/media/jao-mpris.el +++ b/lib/media/jao-mpris.el @@ -91,7 +91,7 @@ (jao--put-face artist 'jao-themes-f11) (jao--put-face (if album (format " (%s)" album) "") 'jao-themes-f01) - (if duration (format " [%s]" duration) "")))) + (if duration (format " %s" duration) "")))) (defun jao-mpris--track (&optional info) (let ((info (or info (jao-playerctl--status)))) @@ -109,10 +109,13 @@ (defun jao-mpris-show-osd () (interactive) (when jao-mpris--current - (jao-notify (format "%s: %s" (jao-mpris--get 'status) (jao-mpris--format))))) + (jao-notify (format "%s%s" (if-let (s (jao-mpris--get 'status)) + (format "%s: " s) + "") + (jao-mpris--format))))) (defun jao-mpris-minibuffer-order (order) - (jao-minibuffer-add-msg-variable 'jao-mpris-track-string order)) + (jao-minibuffer-add-variable 'jao-mpris-track-string order)) (defun jao-mpris--handler (_iname properties &rest _args) (when properties @@ -137,13 +140,14 @@ (jao-mpris--track jao-mpris--current))))))) ;;;###autoload -(defun jao-mpris-minibuffer-register (name &optional bus) +(defun jao-mpris-register (name &optional bus order) (dbus-register-signal (or bus :session) name "/org/mpris/MediaPlayer2" "org.freedesktop.DBus.Properties" "PropertiesChanged" - 'jao-mpris--handler)) + 'jao-mpris--handler) + (when order (jao-mpris-minibuffer-order order))) (provide 'jao-mpris) |