add multimedia keys

This commit is contained in:
Chay 2024-04-24 07:20:58 +03:00
parent 3903c59f8d
commit 086b563de5
2 changed files with 12 additions and 0 deletions

View file

@ -19,3 +19,4 @@ necessary as root):
- Preserve on restart
- Pertag with selection
- Resize corners
- Multimedia keys

View file

@ -1,3 +1,4 @@
#include <X11/XF86keysym.h>
/* See LICENSE file for copyright and license details. */
/* appearance */
@ -60,6 +61,11 @@ 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", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *termcmd[] = { "st", NULL };
static const char *up_vol[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+10%", NULL };
static const char *down_vol[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "-10%", NULL };
static const char *mute_vol[] = { "pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL };
static const char *brighter[] = { "light", "-A", "10%+", NULL };
static const char *dimmer[] = { "light", "-U", "10%-", NULL };
static const Key keys[] = {
/* modifier key function argument */
@ -89,6 +95,11 @@ static const Key keys[] = {
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
{ 0, XF86XK_AudioMute, spawn, {.v = mute_vol } },
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = down_vol } },
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = up_vol } },
{ 0, XF86XK_MonBrightnessDown, spawn, {.v = dimmer } },
{ 0, XF86XK_MonBrightnessUp, spawn, {.v = brighter } },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)