[StumpWM] Control media through playerctl rather than mpc directly

This commit is contained in:
Lucien Cartier-Tilet 2022-08-31 03:46:45 +02:00
parent 78d4736863
commit 0050fc966e
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -1416,10 +1416,10 @@ with Emacs buffers.
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: Keybinds-Media-and-Media-Control-hbv5uk91z5j0 :CUSTOM_ID: Keybinds-Media-and-Media-Control-hbv5uk91z5j0
:END: :END:
My music is managed through MPD, and I often use ~mpc~ commands in order My music is managed through MPD, and I often use ~playerctl~ commands in
to interact with it without any GUI application. So, well see a lot order to interact with it without any GUI application. So, well see a
of its usage here, and numerous commands used here come from the ~mpd~ lot of its usage here, and numerous commands used here come from the
minor mode loaded [[#Init-file-l3q4snd1u5j0][above]]. ~mpd~ minor mode loaded [[#Init-file-l3q4snd1u5j0][above]].
First, lets declare an interactive keymap in order to easily change First, lets declare an interactive keymap in order to easily change
several times in a row either the current song playing or the volume several times in a row either the current song playing or the volume
@ -1488,14 +1488,14 @@ Then, lets declare a keymap for our media controls.
| Keychord | Function | | Keychord | Function |
|----------+-----------------------------------| |----------+-----------------------------------|
| ~.~ | ~media-interactive~ | | ~.~ | ~media-interactive~ |
| ~«~ | ~mpd-prev~ | | ~«~ | ~exec playerctl previous~ |
| ~»~ | ~mpd-next~ | | ~»~ | ~exec playerctl next~ |
| ~a~ | ~'*my-mpd-add-map*~ | | ~a~ | ~'*my-mpd-add-map*~ |
| ~b~ | ~'*my-mpd-browse-map*~ | | ~b~ | ~'*my-mpd-browse-map*~ |
| ~c~ | ~mpd-clear~ | | ~c~ | ~mpd-clear~ |
| ~m~ | ~mpc-interactive~ | | ~m~ | ~mpc-interactive~ |
| ~p~ | ~mpd-toggle-pause~ | | ~p~ | ~exec playerctl play-pause~ |
| ~s~ | ~mpd-stop~ | | ~s~ | ~exec playerctl stop~ |
| ~u~ | ~mpd-update~ | | ~u~ | ~mpd-update~ |
| ~n~ | ~exec kitty ncmpcpp -q~ | | ~n~ | ~exec kitty ncmpcpp -q~ |
| ~v~ | ~exec kitty ncmpcpp -qs visualizer~ | | ~v~ | ~exec kitty ncmpcpp -qs visualizer~ |
@ -1527,11 +1527,11 @@ media-related, but Ill add keybinds for my screens backlight.
#+caption: Top-level media keys #+caption: Top-level media keys
| Keychord | Function | | Keychord | Function |
|-----------------------+-----------------------------------| |-----------------------+-----------------------------------|
| ~XF86AudioPlay~ | ~mpd-toggle-pause~ | | ~XF86AudioPlay~ | ~exec playerctl play-pause~ |
| ~XF86AudioPause~ | ~exec mpc pause~ | | ~XF86AudioPause~ | ~exec playerctl pause~ |
| ~XF86AudioStop~ | ~mpd-stop~ | | ~XF86AudioStop~ | ~exec playerctl stop~ |
| ~XF86AudioPrev~ | ~mpd-prev~ | | ~XF86AudioPrev~ | ~exec playerctl previous~ |
| ~XF86AudioNext~ | ~mpd-next~ | | ~XF86AudioNext~ | ~exec playerctl next~ |
| ~XF86AudioRaiseVolume~ | ~exec pamixer -i 2~ | | ~XF86AudioRaiseVolume~ | ~exec pamixer -i 2~ |
| ~XF86AudioLowerVolume~ | ~exec pamixer -d 2~ | | ~XF86AudioLowerVolume~ | ~exec pamixer -d 2~ |
| ~XF86AudioMute~ | ~exec pamixer -t~ | | ~XF86AudioMute~ | ~exec pamixer -t~ |