summaryrefslogtreecommitdiffhomepage
path: root/init.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-06-02 03:52:35 +0100
committerjao <jao@gnu.org>2021-06-02 03:52:35 +0100
commit9b090bda3663a12759ef2fb4f1b6cdd6e2b0b74f (patch)
tree8a2208b4c85894066340139b49c19b585b49bd51 /init.org
parent3d81e177f001cc4f8518cc9f3274ef5a264c022c (diff)
downloadelibs-9b090bda3663a12759ef2fb4f1b6cdd6e2b0b74f.tar.gz
elibs-9b090bda3663a12759ef2fb4f1b6cdd6e2b0b74f.tar.bz2
better media shortcuts definition
Diffstat (limited to 'init.org')
-rw-r--r--init.org33
1 files changed, 19 insertions, 14 deletions
diff --git a/init.org b/init.org
index 7004e26..f29c44d 100644
--- a/init.org
+++ b/init.org
@@ -2944,20 +2944,25 @@
(defvar jao-mopidy-port 6669)
(jao-mpc-setup jao-mopidy-port)
+ (defmacro jao-defun-play (name &optional mpc-name)
+ `(defun ,(intern (format "jao-player-%s" name)) ()
+ (interactive)
+ (,(intern (format "jao-mpc-%s" (or mpc-name name)))
+ (when (jao-mpc--playing-p jao-mopidy-port)
+ jao-mopidy-port))))
+
+ (jao-defun-play toggle)
+ (jao-defun-play next)
+ (jao-defun-play previous)
+ (jao-defun-play stop)
+ (jao-defun-play seek)
+ (jao-defun-play echo echo-current)
+ (jao-defun-play list show-playlist)
+ (jao-defun-play info lyrics-track-data)
+
+ (defalias 'jao-player-browse 'jao-mpc-show-albums)
(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 '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)
-
- (defun jao-player-info ()
- (jao-mpc-lyrics-track-data
- (when (jao-mpc--playing-p jao-mopidy-port) jao-mopidy-port)))
#+end_src
*** hydras
#+begin_src emacs-lisp
@@ -3007,6 +3012,7 @@
(global-map "s-m" :color blue :quit-key "q")
("Play"
(("m" jao-player-toggle "toggle")
+ ("s" (espotify-play-pause) "spotify")
("n" jao-player-next "next")
("p" jao-player-previous "previous")
("f" (jao-player-seek 10) "seek fwd" :color red)
@@ -3015,8 +3021,7 @@
(("b" jao-player-browse "browse")
("l" jao-player-list "show play list")
("L" jao-show-lyrics "show lyrics")
- ("w" jao-player-echo "now playing (text)")
- ("s" jao-player-search "search"))
+ ("w" jao-player-echo "now playing (text)"))
"Master volume"
(("d" jao-mixer-master-down "master down" :color red)
("u" jao-mixer-master-up "master up" :color red)