add audio and brightness keybinds

This commit is contained in:
lucy 2026-06-09 13:56:54 +02:00
commit c29331e9f2
3 changed files with 12 additions and 2 deletions

View file

@ -59,7 +59,12 @@ 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", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
static const char *termcmd[] = { "st", NULL };
static const char *quit_dwm[] = { "pkill", "xinit", NULL };
static const char *quit_dwm[] = { "pkill", "X", NULL };
static const char *vol_up[] = { "wpctl", "set-volume", "-l", "1.0", "@DEFAULT_AUDIO_SINK@", "5%+", NULL };
static const char *vol_down[] = { "wpctl", "set-volume", "-l", "1.0", "@DEFAULT_AUDIO_SINK@", "5%-", NULL };
static const char *brighter[] = { "brightnessctl", "set", "10%+", NULL };
static const char *dimmer[] = { "brightnessctl", "set", "10%-", NULL };
static const char *vol_mute[] = { "wpctl", "set-mute", "@DEFAULT_AUDIO_SINK@", "toggle", NULL };
/*
* Xresources preferences to load at startup
@ -79,7 +84,7 @@ ResourcePref resources[] = {
{ "resizehints", INTEGER, &resizehints },
{ "mfact", FLOAT, &mfact },
};
#include <X11/XF86keysym.h>
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
@ -116,6 +121,11 @@ static Key keys[] = {
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_r, quit, {0} },
{ MODKEY|ShiftMask, XK_q, spawn, {.v = quit_dwm} },
{ 0, XF86XK_MonBrightnessUp, spawn, {.v = brighter } },
{ 0, XF86XK_MonBrightnessDown, spawn, {.v = dimmer } },
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = vol_down } },
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = vol_up } },
{ 0, XF86XK_AudioMute, spawn, {.v = vol_mute } },
};
/* button definitions */

BIN
dwm

Binary file not shown.

BIN
dwm.o

Binary file not shown.