From 40ec9acb94ee96e0afafcddcfb2d4b35b4623ad7 Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 27 Aug 2022 03:31:47 +0100 Subject: mpc: auto-random fixed and nicer transient --- init.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 2bccb48..9dea2ae 100644 --- a/init.el +++ b/init.el @@ -3046,6 +3046,8 @@ (setq jao-mpc-last-port (unless jao-mpc-last-port jao-mopidy-port) jao-mpc-port jao-mpc-last-port)) +(defsubst jao-mpc-mopidy-p () (equal jao-mpc-last-port jao-mopidy-port)) + (jao-mpc-setup jao-mopidy-port (if jao-modeline-in-minibuffer -10 70)) (defun jao-mpc-pport (&optional mop) @@ -3142,7 +3144,12 @@ ("K" "dislike" jao-streaming-dislike)]]) (transient-define-prefix jao-transient-media () - [["Play" + [:description + (lambda () + (format "[%s %s]\n" + (if (jao-mpc-mopidy-p) "mopidy" "mpd") + (jao-mpc--current-timestr t))) + ["Play" ("m" "toggle" jao-player-toggle) ("n" "next" jao-player-next) ("p" "previous" jao-player-previous) @@ -3172,10 +3179,7 @@ ("r" (lambda () (concat (if jao-random-album-p "dis" "en") "able random album")) jao-random-album-toggle) - ("P" (lambda () - (concat "Toggle to " - (if (equal jao-mpc-last-port jao-mopidy-port) - "mpd" "mopidy"))) + ("P" (lambda () (concat "Toggle to " (if (jao-mpc-mopidy-p) "mpd" "mopidy"))) jao-mpc-toggle-port)]]) (global-set-key (kbd "s-m") #'jao-transient-media) -- cgit v1.2.3