Added support for special x11 keys

This commit is contained in:
hellisabove
2024-01-14 16:14:13 +02:00
parent 1a6f9f7b13
commit bb23d258af
+16 -7
View File
@@ -1,5 +1,5 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#include <X11/XF86keysym.h>
/* appearance */ /* appearance */
static const unsigned int borderpx = 2; /* border pixel of windows */ static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */ static const unsigned int snap = 32; /* snap pixel */
@@ -74,11 +74,16 @@ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn()
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn",dmenufont, "-nb", norm_bg, "-nf", norm_fg, "-sb", sel_bg, "-sf", sel_fg, NULL }; static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn",dmenufont, "-nb", norm_bg, "-nf", norm_fg, "-sb", sel_bg, "-sf", sel_fg, NULL };
//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 *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
//sets st as the default terminal //sets st as the default terminal
static const char *termcmd[] = { "st", NULL }; static const char *termcmd[] = { "st", "-e", "zsh", NULL };
//volume controls /* volume controls */
static const char *upvol[] = { "amixer", "-q", "set", "Master", "5%+", "unmute", NULL }; static const char *upvol[] = { "amixer", "-q", "set", "Master", "5%+", "unmute", NULL };
static const char *downvol[] = { "amixer", "-q", "set", "Master", "5%-", "unmute", NULL }; static const char *downvol[] = { "amixer", "-q", "set", "Master", "5%-", "unmute", NULL };
static const char *mutevol[] = { "amixer", "-q", "set", "Master", "toggle", NULL }; static const char *mutevol[] = { "amixer", "-q", "set", "Master", "toggle", NULL };
/* brightness controls */
static const char *light_up[] = { "brightnessctl", "--device", "amdgpu_bl0", "set", "+10%", NULL };
static const char *light_down[] = { "brightnessctl", "--device", "amdgpu_bl0", "set", "10%-", NULL };
static const char *kbdl_up[] = { "brightnessctl", "--device", "asus::kbd_backlight", "set", "+10%", NULL };
static const char *kbdl_down[] = {"brightnessctl", "--device", "asus::kbd_backlight", "set", "10%-", NULL };
static Key keys[] = { static Key keys[] = {
/* modifier key function argument */ /* modifier key function argument */
@@ -108,10 +113,14 @@ static Key keys[] = {
{ MODKEY, XK_minus, setgaps, {.i = -1 } }, { MODKEY, XK_minus, setgaps, {.i = -1 } },
{ MODKEY, XK_equal, setgaps, {.i = +1 } }, { MODKEY, XK_equal, setgaps, {.i = +1 } },
{ MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } }, { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
{ MODKEY, XK_F3, spawn, {.v = upvol } }, { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } },
{ MODKEY, XK_F2, spawn, {.v = downvol } }, { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
{ MODKEY, XK_F1, spawn, {.v = mutevol } }, { 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
TAGKEYS( XK_1, 0) { 0, XF86XK_KbdBrightnessUp, spawn, {.v = kbdl_up } },
{ 0, XF86XK_KbdBrightnessDown, spawn, {.v = kbdl_down } },
{ 0, XF86XK_MonBrightnessUp, spawn, {.v = light_up } },
{ 0, XF86XK_MonBrightnessDown, spawn, {.v = light_down } },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1) TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2) TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3) TAGKEYS( XK_4, 3)