From 27b5aab26529f24f7b4ed3dde3acfd317666698f Mon Sep 17 00:00:00 2001 From: mrsu Date: Fri, 14 Jun 2024 14:00:12 +0100 Subject: [PATCH] fixed keybindings added scratchpads --- config.def.h | 63 +++++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/config.def.h b/config.def.h index eea3ce8..452f27b 100644 --- a/config.def.h +++ b/config.def.h @@ -6,6 +6,7 @@ static unsigned int borderpx = 6; /* border pixel of windows */ static const unsigned int gappx = 10; /* gaps between windows */ static unsigned int snap = 32; /* snap pixel */ +static const int swallowfloating = 0; /* 1 means swallow floating windows by default */ static int showbar = 1; /* 0 means no bar */ static int topbar = 1; /* 0 means bottom bar */ static const char font[] = "monospace:size=14"; @@ -65,18 +66,17 @@ static Sp scratchpads[] = { /* tagging */ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - */ - /* class instance title tags mask isfloating monitor */ - { "Gimp", NULL, NULL, 0, 1, -1 }, - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, - { NULL, "spterm", NULL, SPTAG(0), 1, -1 }, - { NULL, "spfm", NULL, SPTAG(1), 1, -1 }, - { NULL, "keepassxc", NULL, SPTAG(2), 0, -1 }, + /* class instance title tags mask isfloating monitor */ + { NULL, "spterm0", NULL, SPTAG(0), 1, -1 }, + { NULL, "spterm1", NULL, SPTAG(1), 1, -1 }, + { NULL, "spterm2", NULL, SPTAG(2), 1, -1 }, + { NULL, "spterm3", NULL, SPTAG(3), 1, -1 }, + { NULL, "spterm4", NULL, SPTAG(4), 1, -1 }, + { NULL, "spterm5", NULL, SPTAG(5), 1, -1 }, + { NULL, "spterm6", NULL, SPTAG(6), 1, -1 }, }; + /* layout(s) */ static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ static const int nmaster = 1; /* number of clients in master area */ @@ -103,20 +103,22 @@ static const Layout layouts[] = { /* commands */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_base01, "-nf", col_base04, "-sb", col_base0D, "-sf", col_base00, NULL }; +static const char *dmenuwifi[] = { "dmenu-wifi.sh", NULL }; static const char *termcmd[] = { "st", NULL }; static const Key keys[] = { /* modifier key function argument */ { MODKEY, XK_r, spawn, {.v = dmenucmd } }, + { MODKEY, XK_w, spawn, {.v = dmenuwifi } }, { MODKEY, XK_Return, spawn, {.v = termcmd } }, { 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|ShiftMask, XK_i, incnmaster, {.i = +1 } }, + { MODKEY|ShiftMask, 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|ShiftMask, XK_Return, zoom, {0} }, { MODKEY, XK_Tab, view, {0} }, { MODKEY, XK_q, killclient, {0} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, @@ -143,25 +145,30 @@ static const Key keys[] = { TAGKEYS( XK_9, 8) { MODKEY|ShiftMask, XK_q, quit, {0} }, { MODKEY|ControlMask|ShiftMask, XK_q, quit, {1} }, - { MODKEY, XK_y, togglescratch, {.ui = 0 } }, - { MODKEY, XK_u, togglescratch, {.ui = 1 } }, - { MODKEY, XK_x, togglescratch, {.ui = 2 } }, - { MODKEY, XK_o, togglescratch, {.ui = -1 } }, + + // Scratchpads + { MODKEY, XK_y, togglescratch, {.ui = 0 } }, + { MODKEY, XK_u, togglescratch, {.ui = 1 } }, + { MODKEY, XK_i, togglescratch, {.ui = 2 } }, + { MODKEY, XK_c, togglescratch, {.ui = 3 } }, + { MODKEY|ShiftMask, XK_c, togglescratch, {.ui = 4 } }, + { MODKEY, XK_a, togglescratch, {.ui = 5 } }, + { MODKEY, XK_p, togglescratch, {.ui = 6 } }, + { MODKEY, XK_o, togglescratch, {.ui = -1 } }, }; /* button definitions */ /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ static const Button buttons[] = { /* click event mask button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button1, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, + { ClkLtSymbol, 0, Button1, setlayout, {0} }, + { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, + { ClkWinTitle, 0, Button2, zoom, {0} }, + { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, + { ClkClientWin, MODKEY, Button1, movemouse, {0} }, + { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, + { ClkClientWin, MODKEY, Button1, resizemouse, {0} }, + { ClkTagBar, 0, Button1, view, {0} }, + { ClkTagBar, 0, Button3, toggleview, {0} }, + { ClkTagBar, MODKEY, Button1, tag, {0} }, };