[Emacs] Fix issue with unknown function and swapped icons

This commit is contained in:
Lucien Cartier-Tilet 2021-10-25 16:56:58 +02:00
parent 03f1d9bef1
commit 248100e013
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -1990,31 +1990,33 @@ configuration [[file:mpd.org][here]]).
I also want to create a small hydra for manipulating MPD: I also want to create a small hydra for manipulating MPD:
#+name: emms-media-hydra #+name: emms-media-hydra
#+begin_src emacs-lisp :tangle no #+begin_src emacs-lisp :tangle no
(let ((shell-command-and-echo (lambda (command &optional echo) (defun shell-command-and-echo (command &optional echo)
(progn
(with-temp-buffer (with-temp-buffer
(shell-command command (shell-command command
(current-buffer) (current-buffer)
(current-buffer))) (current-buffer))
(when echo (when echo
(message "mpc %s" (message "mpc %s"
(string-trim (string-trim
(shell-command-to-string "mpc volume"))))))) (shell-command-to-string "mpc volume")))))))
(defhydra hydra-media ()
(defhydra hydra-media ()
" "
^Tracks^ ^Volume^ ^Other^ ^Tracks^ ^Volume^ ^Other^
^^^^^^^^---------------------------- ^^^^^^^^----------------------------
[_c_] %s(all-the-icons-material \"skip_previous\" :height 1.0 :v-adjust -0.2) [_t_] %s(all-the-icons-material \"volume_up\" :height 1.0 :v-adjust -0.2) [_p_] %s(all-the-icons-material \"play_arrow\" :height 1.0 :v-adjust -0.2) [_c_] %s(all-the-icons-material \"skip_previous\" :height 1.0 :v-adjust -0.2) [_t_] %s(all-the-icons-material \"volume_down\" :height 1.0 :v-adjust -0.2) [_p_] %s(all-the-icons-material \"play_arrow\" :height 1.0 :v-adjust -0.2)
[_r_] %s(all-the-icons-material \"skip_next\" :height 1.0 :v-adjust -0.2) [_s_] %s(all-the-icons-material \"volume_down\" :height 1.0 :v-adjust -0.2) [_S_] %s(all-the-icons-material \"stop\" :height 1.0 :v-adjust -0.2) [_r_] %s(all-the-icons-material \"skip_next\" :height 1.0 :v-adjust -0.2) [_s_] %s(all-the-icons-material \"volume_up\" :height 1.0 :v-adjust -0.2) [_S_] %s(all-the-icons-material \"stop\" :height 1.0 :v-adjust -0.2)
[_q_] quit [_q_] quit
" "
("c" emms-player-mpd-previous) ("c" emms-player-mpd-previous)
("r" emms-player-mpd-next) ("r" emms-player-mpd-next)
("t" (apply shell-command-and-echo '("mpc volume -2" "mpc volume"))) ("t" (shell-command-and-echo "mpc volume -2" "mpc volume"))
("s" (apply shell-command-and-echo '("mpc volume +2" "mpc volume"))) ("s" (shell-command-and-echo "mpc volume +2" "mpc volume"))
("p" (apply shell-command-and-echo '("mpc toggle"))) ("p" (shell-command-and-echo "mpc toggle"))
("S" emms-player-mpd-stop) ("S" emms-player-mpd-stop)
("q" nil :exit t))) ("q" nil :exit t))
#+end_src #+end_src
*** Nov *** Nov