summaryrefslogtreecommitdiffhomepage
path: root/lib/media
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-06-02 02:07:12 +0100
committerjao <jao@gnu.org>2021-06-02 02:07:12 +0100
commitf1d177c63964f5cf9bf65093461a43772dbf5a27 (patch)
tree7859cfe3a9fbdbee0a220beac683f4d05135d866 /lib/media
parent1714cfa554801badd34bfcb9523c3f69746b2b3a (diff)
downloadelibs-f1d177c63964f5cf9bf65093461a43772dbf5a27.tar.gz
elibs-f1d177c63964f5cf9bf65093461a43772dbf5a27.tar.bz2
mpris: drop dep on jao-emms, and not needed in minibuffer
Diffstat (limited to 'lib/media')
-rw-r--r--lib/media/jao-mpris.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/media/jao-mpris.el b/lib/media/jao-mpris.el
index 597eb94..36cde05 100644
--- a/lib/media/jao-mpris.el
+++ b/lib/media/jao-mpris.el
@@ -25,8 +25,8 @@
;;; Code:
(require 'dbus)
+(require 'jao-themes)
(require 'jao-minibuffer)
-(require 'jao-emms-info-track)
(defun jao-mpris--playerctl (&rest args)
(shell-command-to-string (format "playerctl %s"
@@ -72,6 +72,9 @@
(defun jao-mpris--get (k &optional l)
(alist-get k (or l jao-mpris--current)))
+(defun jao-mpris--fmt-time (x suffix)
+ (if x (format "%02d:%02d%s" (/ x 60) (mod x 60) (or suffix "")) ""))
+
(defun jao-mpris--format (&optional info)
(let* ((artist (jao-mpris--get 'artist info))
(title (jao-mpris--get 'title info))
@@ -81,13 +84,13 @@
(duration (jao-mpris--get 'duration info))
(duration (cond (duration duration)
((stringp len) len)
- ((numberp len) (jao-emms--fmt-time (/ len 1e6) "")))))
+ ((numberp len) (jao-mpris--fmt-time (/ len 1e6) "")))))
(format " %s %s %s%s%s"
- (jao--put-face (format "%s" (or track "")) 'jao-emms-font-lock-track)
- (jao--put-face title 'jao-emms-font-lock-title)
- (jao--put-face artist 'jao-emms-font-lock-artist)
+ (jao--put-face (format "%s" (or track "")) 'jao-themes-f00)
+ (jao--put-face title 'jao-themes-f01)
+ (jao--put-face artist 'jao-themes-f11)
(jao--put-face (if album (format " (%s)" album) "")
- 'jao-emms-font-lock-album)
+ 'jao-themes-f01)
(if duration (format " [%s]" duration) ""))))
(defun jao-mpris--track (&optional info)
@@ -111,7 +114,7 @@
(defun jao-mpris-minibuffer-order (order)
(jao-minibuffer-add-msg-variable 'jao-mpris-track-string order))
-(defun jao-mpris--handler (iname properties &rest args)
+(defun jao-mpris--handler (_iname properties &rest _args)
(when properties
(let ((st (caadr (assoc "PlaybackStatus" properties)))
(md (caadr (assoc "Metadata" properties))))