From 96ea525c9a3ed6472055b69fa5aaa0ee7be87005 Mon Sep 17 00:00:00 2001 From: jao Date: Tue, 7 Dec 2021 23:25:14 +0000 Subject: giving spotifd another try via jao-mpris --- init.org | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'init.org') diff --git a/init.org b/init.org index 4060754..b7cb1ec 100644 --- a/init.org +++ b/init.org @@ -2902,12 +2902,27 @@ #+begin_src emacs-lisp (jao-load-path "espotify") - (use-package espotify :demand t) + (use-package espotify + :demand t + :init (setq espotify-service-name "spotifyd")) (use-package consult-spotify :demand t) (defalias 'jao-spotify-album #'consult-spotify-album) (defalias 'jao-spotify-track #'consult-spotify-track) (defalias 'jao-spotify-artist #'consult-spotify-artist) (defalias 'jao-spotify-playlist #'consult-spotify-playlist) + + (use-package jao-mpris + :demand t + :config + (defun jao-mpris-setup-aliases () + (defalias 'jao-spotify-toggle #'jao-mpris-play-pause) + (defalias 'jao-spotify-next #'jao-mpris-next) + (defalias 'jao-spotify-prev #'jao-mpris-previous) + (defalias 'jao-spotify-current #'jao-mpris-show-osd))) + + (jao-mpris-setup-aliases) + (jao-mpris-register "spotifyd" nil (if jao-modeline-in-minibuffer-p -10 70)) + #+end_src *** mpc #+begin_src emacs-lisp @@ -2915,8 +2930,9 @@ :demand t :commands jao-mpc-setup) - (defvar jao-mopidy-port 6669) - (jao-mpc-setup jao-mopidy-port 70) + ;; (defvar jao-mopidy-port 6669) + (defvar jao-mopidy-port nil) + (jao-mpc-setup jao-mopidy-port (if jao-modeline-in-minibuffer-p -10 70)) (defun jao-mpc-pport () (when (jao-mpc--playing-p jao-mopidy-port) jao-mopidy-port)) @@ -2967,12 +2983,12 @@ (defun jao-player-seek--10 () (interactive) (jao-player-seek -10)) (defun jao-spotify-clear () (interactive) (jao-mpc-clear jao-mopidy-port)) + (defun jao-spotify-echo-current () (interactive) (jao-mpc-echo-current jao-mopidy-port)) - (defun jao-spotify-show-playlist () - (interactive) - (jao-mpc-show-playlist jao-mopidy-port)) + + (defalias 'jao-spotify-playlist #'jao-exwm-spt) (defun jao-player-seek-m10 () (interactive) @@ -2993,16 +3009,16 @@ ("t" "track" jao-spotify-track) ("P" "playlist" jao-spotify-playlist)] ["Play" - ("s" "toggle" espotify-play-pause) - ("n" "next" espotify-next) - ("p" "previous" espotify-previous)] + ("s" "toggle" jao-spotify-toggle) + ("n" "next" jao-spotify-next) + ("p" "previous" jao-spotify-prev)] ["Seek" ("f" "seek fwd" jao-player-seek-m10 :transient t) ("F" "seek bwd" jao-player-seek-m-10 :transient t)] ["Browse" ("l" "playing list" jao-spotify-show-playlist) - ("c" "clear list"jao-spotify-clear :transient t) - ("w" "currently playing" jao-spotify-echo-current)]]) + ;; ("c" "clear list"jao-spotify-clear :transient t) + ("w" "currently playing" jao-spotify-current)]]) (transient-define-prefix jao-transient-media () [["Play" -- cgit v1.2.3