Add keybinfings

This commit is contained in:
Franck STAUFFER 2021-01-17 13:30:21 +01:00
parent fe0b3cd2cd
commit 560e005686
Signed by: franck.stauffer
GPG Key ID: AAF5A94045CEC261

View File

@ -4,7 +4,7 @@
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const int topbar = 0; /* 0 means bottom bar */
static const char *fonts[] = { "SauceCodePro Nerd Font Mono:size=20:antialias:true:autohint:true" };
static const char color_black[] = "#1D2021";
static const char color_green[] = "#98971A";
@ -54,44 +54,54 @@ static const Layout layouts[] = {
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "/usr/bin/dmenu_run", "-m", dmenumon, NULL };
static const char *pmenucmd[] = { "/usr/bin/passmenu", NULL };
static const char *termcmd[] = { "/usr/bin/xterm", NULL };
static const char *lockcmd[] = { "/usr/bin/slock", NULL };
static const char *mailcmd[] = { "/usr/bin/thunderbird", NULL };
static const char *webcmd[] = { "/usr/lib/firefox/firefox", NULL };
static const char *dmenucmd[] = { "/usr/bin/dmenu_run", "-m", dmenumon, NULL };
static const char *pmenucmd[] = { "/usr/bin/passmenu", NULL };
static const char *termcmd[] = { "/usr/bin/xterm", NULL };
static const char *lockcmd[] = { "/usr/bin/slock", NULL };
static const char *mailcmd[] = { "/usr/bin/thunderbird", NULL };
static const char *webcmd[] = { "/usr/lib/firefox/firefox", NULL };
static const char *volup[] = { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%", NULL};
static const char *voldown[] = { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%", NULL};
static const char *volmute[] = { "/usr/bin/pactl", "set-sink-mute", "0", "toggle", NULL};
static const char *brightup[] = { "/usr/bin/xbacklight", "-inc", "10%", NULL};
static const char *brightdown[] = { "/usr/bin/xbacklight", "-dec", "10%", NULL};
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_p, spawn, {.v = pmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY|ShiftMask, XK_l, spawn, {.v = lockcmd } },
{ MODKEY|ShiftMask, XK_m, spawn, {.v = mailcmd } },
{ MODKEY|ShiftMask, XK_w, spawn, {.v = webcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_c, setlayout, {.v = &layouts[3]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_p, spawn, {.v = pmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY|ShiftMask, XK_l, spawn, {.v = lockcmd } },
{ MODKEY|ShiftMask, XK_m, spawn, {.v = mailcmd } },
{ MODKEY|ShiftMask, XK_w, spawn, {.v = webcmd } },
{ 0, 0x1008ff02, spawn, {.v = brightup } },
{ 0, 0x1008ff03, spawn, {.v = brightdown } },
{ 0, 0x1008ff11, spawn, {.v = voldown } },
{ 0, 0x1008ff12, spawn, {.v = volmute } },
{ 0, 0x1008ff13, spawn, {.v = volup } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_c, setlayout, {.v = &layouts[3]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)