diff options
| author | P.P.A <adolphs@moselle.moe> | 2023-07-13 22:59:01 +0200 |
|---|---|---|
| committer | P.P.A <adolphs@moselle.moe> | 2023-07-13 22:59:01 +0200 |
| commit | 7fdcf60ed81f0773269ad9704781219b045cbc85 (patch) | |
| tree | 25075d1790671cbfb915b75a936ba80979786387 | |
| parent | 6dab34d099b404679a5852dccc4f3cacc5555bec (diff) | |
laptop controls for brightness & audio, taken from https://old.reddit.com/r/suckless/comments/c64pv8/controlling_audiobacklight_through_keys_in_dwm/es69te5/
| -rw-r--r-- | config.def.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/config.def.h b/config.def.h index a72ccc0..5eabd1a 100644 --- a/config.def.h +++ b/config.def.h @@ -1,5 +1,5 @@ /* See LICENSE file for copyright and license details. */ - +#include <X11/XF86keysym.h> /* appearance */ static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int gappx = 3; /* gaps between windows */ @@ -74,6 +74,12 @@ static const char scratchpadname[] = "scratchpad"; static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL }; static const char *screenshot[] = { "scrot", "-e", "mv $f ~/Bilder", NULL }; static const char *windowshot[] = { "scrot", "--focused", "-e", "mv $f ~/Bilder", NULL }; +static const char *brupcmd[] = { "xbacklight", "-inc", "5", NULL }; +static const char *brdowncmd[] = { "xbacklight", "-dec", "5", NULL }; +static const char *mutecmd[] = { "amixer", "-q", "set", "Master", "toggle", NULL }; +static const char *volupcmd[] = { "amixer", "-q", "set", "Master", "5%+", "unmute", NULL }; +static const char *voldowncmd[] = { "amixer", "-q", "set", "Master", "5%-", "unmute", NULL }; +static const char *miccmd[] = { "amixer", "set", "Capture", "toggle", NULL }; static const Key keys[] = { /* modifier key function argument */ @@ -119,6 +125,12 @@ static const Key keys[] = { { MODKEY|ShiftMask, XK_q, quit, {0} }, { 0, XK_Print, spawn, {.v = screenshot } }, { Mod1Mask, XK_Print, spawn, {.v = windowshot } }, + { 0, XF86XK_MonBrightnessUp, spawn, {.v = brupcmd} }, + { 0, XF86XK_MonBrightnessDown, spawn, {.v = brdowncmd } }, + { 0, XF86XK_AudioMute, spawn, {.v = mutecmd } }, + { 0, XF86XK_AudioLowerVolume, spawn, {.v = voldowncmd } }, + { 0, XF86XK_AudioRaiseVolume, spawn, {.v = volupcmd } }, + { 0, XF86XK_AudioMicMute, spawn, {.v = miccmd } }, }; /* button definitions */ |
