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

@@ -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 */