From 7fdcf60ed81f0773269ad9704781219b045cbc85 Mon Sep 17 00:00:00 2001 From: "P.P.A" Date: Thu, 13 Jul 2023 22:59:01 +0200 Subject: laptop controls for brightness & audio, taken from https://old.reddit.com/r/suckless/comments/c64pv8/controlling_audiobacklight_through_keys_in_dwm/es69te5/ --- config.def.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'config.def.h') 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 /* 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 */ -- cgit v1.2.3