From ac5b105c8c1d8c8043d7b8be17e331e871d1c597 Mon Sep 17 00:00:00 2001 From: Pranav Jha Date: Thu, 17 Oct 2024 23:42:22 -0700 Subject: [PATCH] amixer integration --- config.def.h | 4 ++++ dwm.c | 1 + 2 files changed, 5 insertions(+) diff --git a/config.def.h b/config.def.h index 9efa774..e9d980d 100644 --- a/config.def.h +++ b/config.def.h @@ -59,6 +59,8 @@ static const Layout layouts[] = { 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 }; static const char *termcmd[] = { "st", NULL }; +static const char *incvol[] = {"/usr/bin/amixer", "set", "Master", "5+", NULL}; +static const char *decvol[] = {"/usr/bin/amixer", "set", "Master", "5-", NULL}; static const Key keys[] = { /* modifier key function argument */ @@ -95,6 +97,8 @@ static const Key keys[] = { TAGKEYS( XK_8, 7) TAGKEYS( XK_9, 8) { MODKEY|ShiftMask, XK_q, quit, {0} }, + { 0, XF86XK_AudioLowerVolume,spawn,{.v = decvol} }, + { 0, XF86XK_AudioRaiseVolume,spawn,{.v = incvol} }, }; /* button definitions */ diff --git a/dwm.c b/dwm.c index 1443802..5439d3e 100644 --- a/dwm.c +++ b/dwm.c @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef XINERAMA #include #endif /* XINERAMA */ -- 2.34.1