From c2f0c17feda6aad92f4c235cc733a40da831374a Mon Sep 17 00:00:00 2001 From: Jarkko Toivanen Date: Sat, 27 Jul 2024 19:18:32 +0300 Subject: [PATCH] Implementing keyboard media controls --- config.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config.h b/config.h index 98220dd..780b76e 100644 --- a/config.h +++ b/config.h @@ -74,6 +74,10 @@ static const char *termcmd[] = { "st", NULL }; static const char *upvol[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%", NULL }; static const char *downvol[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%", NULL }; static const char *mutevol[] = { "pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL }; +static const char *plstop[] = { "playerctl", "stop", NULL }; +static const char *plpause[] = { "playerctl", "play-pause", NULL }; +static const char *plnext[] = { "playerctl", "previous", NULL }; +static const char *plprev[] = { "playerctl", "next", NULL }; static const Key keys[] = { /* modifier key function argument */ @@ -131,6 +135,14 @@ static const Key keys[] = { { WINKEY, XK_F10, spawn, {.v = downvol } }, { WINKEY, XK_F11, spawn, {.v = upvol } }, { WINKEY, XK_F9, spawn, {.v = mutevol } }, + { WINKEY, XK_F5, spawn, {.v = plprev } }, + { WINKEY, XK_F6, spawn, {.v = plnext } }, + { WINKEY, XK_F7, spawn, {.v = plpause } }, + { WINKEY, XK_F8, spawn, {.v = plstop } }, + { WINKEY, XF86XK_AudioPrev, spawn, {.v = plprev } }, + { WINKEY, XF86XK_AudioNext, spawn, {.v = plnext } }, + { WINKEY, XF86XK_AudioPause, spawn, {.v = plpause } }, + { WINKEY, XF86XK_AudioStop, spawn, {.v = plstop } }, }; /* button definitions */