summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-06-02 02:10:06 +0100
committerjao <jao@gnu.org>2021-06-02 02:10:06 +0100
commite235059e0150e5740f864769fa29c430e94cff97 (patch)
treec55ae98be402dd503a0a1d1c530ca394b4438506
parente8f15c0b4df43c8d57b623c2c73053b3bdd09930 (diff)
downloadelibs-e235059e0150e5740f864769fa29c430e94cff97.tar.gz
elibs-e235059e0150e5740f864769fa29c430e94cff97.tar.bz2
control mopidy with espotify and mpc
-rw-r--r--init.org34
1 files changed, 10 insertions, 24 deletions
diff --git a/init.org b/init.org
index f5008f6..a7f57f3 100644
--- a/init.org
+++ b/init.org
@@ -2945,36 +2945,20 @@
:demand t
:commands jao-mpc-setup)
- (jao-mpc-setup)
-
- (defun jao-mpc-seek-forward () (interactive) (jao-mpc-seek 10))
- (defun jao-mpc-seek-backward () (interactive) (jao-mpc-seek -10))
+ (defvar jao-mopidy-port 6669)
+ (jao-mpc-setup jao-mopidy-port)
(defalias 'jao-player-connect 'jao-mpc-connect)
(defalias 'jao-player-toggle 'jao-mpc-toggle)
(defalias 'jao-player-next 'jao-mpc-next)
(defalias 'jao-player-previous 'jao-mpc-previous)
(defalias 'jao-player-stop 'jao-mpc-stop)
- (defalias 'jao-player-seek-forward 'jao-mpc-seek-forward)
- (defalias 'jao-player-seek-backward 'jao-mpc-seek-backward)
+ (defalias 'jao-player-seek 'jao-mpc-seek)
(defalias 'jao-player-play 'jao-mpc-play)
(defalias 'jao-player-echo 'jao-mpc-echo-current)
(defalias 'jao-player-list 'jao-mpc-show-playlist)
(defalias 'jao-player-browse 'jao-mpc-show-albums)
#+end_src
-*** mopidy
- #+begin_src emacs-lisp
- (defvar jao-mopidy-port 6669)
-
- (defmacro jao-mopidy-def (name args &rest body)
- `(defun ,name ,args
- (interactive)
- (let ((jao-mpc-port jao-mopidy-port)) ,@body)))
-
- (jao-mopidy-def jao-mopidy-show-playlist () (jao-mpc-show-playlist))
- (jao-mopidy-def jao-mopidy-clear () (jao-mpc-clear))
-
- #+end_src
*** hydras
#+begin_src emacs-lisp
(require 'jao-lyrics)
@@ -3017,10 +3001,12 @@
(("s" espotify-play-pause "toggle")
("n" espotify-next "next")
("p" espotify-previous "previous")
- ("w" jao-mpris-show-osd "currently playing"))
+ ("f" (jao-mpc-seek 10 jao-mopidy-port) "seek fwd" :color red)
+ ("F" (jao-mpc-seek -10 jao-mopidy-port) "seek bwd" :color red))
"Browse"
- (("l" jao-mopidy-show-playlist "playing list")
- ("c" jao-mopidy-clear "clear list" :color red)
+ (("l" (jao-mpc-show-playlist jao-mopidy-port) "playing list")
+ ("c" (jao-mpc-clear jao-mopidy-port) "clear list" :color red)
+ ("w" (jao-mpc-echo-current jao-mopidy-port) "currently playing")
("s-s" jao-hydra-spotify/body nil))))
(pretty-hydra-define jao-hydra-media
@@ -3029,8 +3015,8 @@
(("m" jao-player-toggle "toggle")
("n" jao-player-next "next")
("p" jao-player-previous "previous")
- ("f" jao-player-seek-forward "seek fwd" :color red)
- ("F" jao-player-seek-backward "seek bwd" :color red))
+ ("f" (jao-player-seek 10) "seek fwd" :color red)
+ ("F" (jao-player-seek -10) "seek bwd" :color red))
"Browse"
(("b" jao-player-browse "browse")
("l" jao-player-list "show play list")