summaryrefslogtreecommitdiffhomepage
path: root/lib/media/jao-mpris.el
diff options
context:
space:
mode:
Diffstat (limited to 'lib/media/jao-mpris.el')
-rw-r--r--lib/media/jao-mpris.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/media/jao-mpris.el b/lib/media/jao-mpris.el
index ad4b452..5551f03 100644
--- a/lib/media/jao-mpris.el
+++ b/lib/media/jao-mpris.el
@@ -49,8 +49,14 @@
"{{album}}"
"{{duration(mpris:length)}}")
sep))
- (m (jao-mpris--playerctl "metadata" "--format" fmt)))
- (split-string (car (split-string m "\n")) sep)))
+ (m (jao-mpris--playerctl "metadata" "--format" fmt))
+ (e (split-string (car (split-string m "\n")) sep)))
+ `((status . ,(car e))
+ (track . ,(cadr e))
+ (title . ,(caddr e))
+ (artist . ,(cadddr e))
+ (album . ,(elt e 4))
+ (duration . ,(last e)))))
;;;###autoload
(defun jao-mpris-status-times ()
@@ -72,7 +78,9 @@
(track (jao-mpris--get 'track info))
(album (jao-mpris--get 'album info))
(len (jao-mpris--get 'length info))
- (duration (cond ((stringp len) len)
+ (duration (jao-mpris--get 'duration info))
+ (duration (cond (duration duration)
+ ((stringp len) len)
((numberp len) (jao-emms--fmt-time (/ len 1e6) "")))))
(format " %s %s %s%s%s"
(jao--put-face (format "%s" (or track "")) 'jao-emms-font-lock-track)