Add brightness and volume keys

This commit is contained in:
Alexander Weidinger
2018-07-18 17:49:06 +02:00
parent c2d1a260ba
commit f7b4983523
2 changed files with 12 additions and 1 deletions

View File

@@ -19,7 +19,7 @@ source=(http://dl.suckless.org/dwm/dwm-$pkgver.tar.gz
0001-add-support-for-_NET_SUPPORTING_WM_CHECK.patch
0002-add-support-for-columns-layout.patch)
md5sums=('f0b6b1093b7207f89c2a90b848c008ec'
'd76bce66ac9a5e64df5e82eee0f5799c'
'10f97f39800ac5151ab860a87f7eec9b'
'939f403a71b6e85261d09fc3412269ee'
'2491115ff8327a4526a3361228071bc2'
'33569a6627811e3de3185753a23db5f8')

View File

@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
#include <X11/XF86keysym.h>
/* appearance */
static const char *fonts[] = {
@@ -51,6 +52,11 @@ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont,
static const char *termcmd[] = { "urxvt", NULL };
static const char *lockcmd[] = { "physlock", "-m", NULL };
static const char *scrot[] = { "scrot", "/home/alex/Pictures/Screenshots/%Y-%m-%d-%H%M%S_$wx$h.png", NULL };
static const char *brightnessup[] = { "xbacklight", "+1", NULL };
static const char *brightnessdown[] = { "xbacklight", "-1", NULL };
static const char *voldown[] = { "amixer", "sset", "'Master'", "3%-", "-q", NULL };
static const char *volup[] = { "amixer", "sset", "'Master'", "3%+", "-q", NULL };
static const char *togglemute[] = { "amixer", "sset", "'Master'", "toggle", "-q", NULL };
static Key keys[] = {
/* modifier key function argument */
@@ -91,6 +97,11 @@ static Key keys[] = {
{ MODKEY|ShiftMask, XK_l, spawn, {.v = lockcmd } },
{ 0, XK_Print, spawn, {.v = scrot } },
{ ShiftMask, XK_Print, spawn, SHCMD("sleep 0.2; scrot -s '/home/alex/Pictures/Screenshots/%Y-%m-%d-%H%M%S_$wx$h.png'") },
{ 0, XF86XK_MonBrightnessUp, spawn, {.v = brightnessup } },
{ 0, XF86XK_MonBrightnessDown, spawn, {.v = brightnessdown } },
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = voldown } },
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = volup } },
{ 0, XF86XK_AudioMute, spawn, {.v = togglemute } },
};
/* button definitions */