From 960d0661f6ed5ab6fd9c371c53a5f5b137864da1 Mon Sep 17 00:00:00 2001 From: Nikita Langer Date: Fri, 10 Apr 2026 18:10:00 +0200 Subject: Media Keys --- config.def.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'config.def.h') diff --git a/config.def.h b/config.def.h index 851abbb..0777892 100644 --- a/config.def.h +++ b/config.def.h @@ -176,8 +176,8 @@ static const int cursor_timeout = 5; #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } /* commands */ -// static const char *termcmd[] = { "foot", NULL }; -static const char *termcmd[] = { "kitty", NULL }; +static const char *termcmd[] = { "foot", NULL }; +// static const char *termcmd[] = { "kitty", NULL }; static const char *menucmd[] = { "wmenu-run", "-f", wmenufont, NULL }; static const char *firefox[] = { "firefox", NULL }; static const char *steam[] = { "steam", NULL }; @@ -193,6 +193,11 @@ static const char *minecraft[] = { "prismlauncher", NULL }; static const char *lockcmd[] = { "swaylock", NULL }; static const char *brighter[] = { "/usr/local/bin/dwm-scripts/bright.sh", "5", NULL }; static const char *dimmer[] = { "/usr/local/bin/dwm-scripts/bright.sh", "-5", NULL }; +static const char *playpause[] = { "playerctl", "play-pause", NULL }; +static const char *nexttrack[] = { "playerctl", "next", NULL }; +static const char *prevtrack[] = { "playerctl", "previous", NULL }; +static const char *stoptrack[] = { "playerctl", "stop", NULL }; +static const char *mutemic[] = { "pactl", "set-source-mute", "@DEFAULT_SOURCE@", "toggle", NULL }; static const Key keys[] = { /* Note that Shift changes certain key codes: 2 -> at, etc. */ @@ -219,7 +224,21 @@ static const Key keys[] = { { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, zoom, {0} }, { MODKEY, XKB_KEY_Tab, view, {0} }, - { MODKEY, XKB_KEY_x, movecenter, {0} }, + { MODKEY, XKB_KEY_x, movecenter, {0} }, + /* Media Control Keys */ + { 0, XKB_KEY_XF86AudioPlay, spawn, {.v = playpause} }, + { 0, XKB_KEY_XF86AudioNext, spawn, {.v = nexttrack} }, + { 0, XKB_KEY_XF86AudioPrev, spawn, {.v = prevtrack} }, + { 0, XKB_KEY_XF86AudioStop, spawn, {.v = stoptrack} }, + { 0, XKB_KEY_XF86AudioRaiseVolume, spawn, {.v = upvol} }, + { 0, XKB_KEY_XF86AudioLowerVolume, spawn, {.v = downvol} }, + { 0, XKB_KEY_XF86AudioMute, spawn, {.v = mutevol} }, + { 0, XKB_KEY_XF86AudioMicMute, spawn, {.v = mutemic} }, + { 0, XKB_KEY_XF86MonBrightnessUp, spawn, {.v = brighter} }, + { 0, XKB_KEY_XF86MonBrightnessDown, spawn, {.v = dimmer } }, + { MODKEY, XKB_KEY_F11, spawn, {.v = dimmer } }, + { MODKEY, XKB_KEY_F12, spawn, {.v = brighter } }, + /* Vanity gaps */ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_h, incgaps, {.i = +1 } }, -- cgit