From 8944a0ce51f300353ca410fec87757f3536581dc Mon Sep 17 00:00:00 2001 From: Kumar Damani Date: Thu, 3 Sep 2026 14:03:22 -0400 Subject: add media key binds, dmenu PATH wrapper, fix firefox rule --- config.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index ab59c05..a60dc7e 100644 --- a/config.h +++ b/config.h @@ -1,5 +1,7 @@ /* See LICENSE file for copyright and license details. */ +#include + /* appearance */ static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int snap = 32; /* snap pixel */ @@ -27,7 +29,7 @@ static const Rule rules[] = { * WM_NAME(STRING) = title */ /* class instance title tags mask isfloating monitor */ - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, + { "firefox", NULL, NULL, 1 << 7, 0, -1 }, }; /* layout(s) */ @@ -57,13 +59,24 @@ static const Layout layouts[] = { /* commands */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; +/* prepend common/scripts to PATH so dmenu lists custom scripts */ +static const char *dmenucmd[] = { "/bin/sh", "-c", "PATH=\"$HOME/.config/home-manager/common/scripts:$PATH\"; exec dmenu_run \"$@\"", "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; static const char *termcmd[] = { "st", NULL }; +static const char *volupcmd[] = { "/bin/sh", "-c", "pactl set-sink-mute @DEFAULT_SINK@ 0; pactl set-sink-volume @DEFAULT_SINK@ +5%", NULL }; +static const char *voldowncmd[] = { "/bin/sh", "-c", "pactl set-sink-mute @DEFAULT_SINK@ 0; pactl set-sink-volume @DEFAULT_SINK@ -5%", NULL }; +static const char *volmutecmd[] = { "/bin/sh", "-c", "pactl set-sink-mute @DEFAULT_SINK@ toggle", NULL }; +static const char *micmutecmd[] = { "/bin/sh", "-c", "pactl set-source-mute @DEFAULT_SOURCE@ toggle", NULL }; +static const char *mixercmd[] = { "st", "-e", "pulsemixer", NULL }; static const Key keys[] = { /* modifier key function argument */ { MODKEY, XK_p, spawn, {.v = dmenucmd } }, + { 0, XF86XK_AudioRaiseVolume, spawn, {.v = volupcmd } }, + { 0, XF86XK_AudioLowerVolume, spawn, {.v = voldowncmd } }, + { 0, XF86XK_AudioMute, spawn, {.v = volmutecmd } }, + { 0, XF86XK_AudioMicMute, spawn, {.v = micmutecmd } }, { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, + { MODKEY|ShiftMask, XK_a, spawn, {.v = mixercmd } }, { MODKEY, XK_b, togglebar, {0} }, { MODKEY, XK_j, focusstack, {.i = +1 } }, { MODKEY, XK_k, focusstack, {.i = -1 } }, -- cgit v1.2.3