Setnmaster
This commit is contained in:
parent
eb66a70046
commit
a71ab5ffe9
4 changed files with 48 additions and 25 deletions
1
README
1
README
|
@ -14,6 +14,7 @@ Access nth Monitor
|
|||
Toggle Layout
|
||||
Toggle Border
|
||||
Actual Fullscreen
|
||||
Setnmaster
|
||||
|
||||
dwm - dynamic window manager
|
||||
============================
|
||||
|
|
58
config.def.h
58
config.def.h
|
@ -44,9 +44,15 @@ static const Rule rules[] = {
|
|||
* WM_CLASS(STRING) = instance, class
|
||||
* WM_NAME(STRING) = title
|
||||
*/
|
||||
/* class instance title tags mask isfloating monitor float x,y,w,h floatborderpx*/
|
||||
{ "Gimp", NULL, NULL, 0, 1, -1, 50,50,500,500, 5 },
|
||||
{ "Firefox", NULL, NULL, 1 << 8, 0, -1, 50,50,500,500, 5 },
|
||||
/* class instance title tags mask isfloating monitor float x,y,w,h floatborderpx*/
|
||||
{ "Emacs", NULL, NULL, 1 << 0, 0, -1, 50,50,500,500, 1 },
|
||||
{ NULL, "st", NULL, 1 << 1, 0, -1, 50,50,500,500, 1 },
|
||||
{ "qutebrowser", NULL, NULL, 1 << 2, 0, -1, 50,50,500,500, 1 },
|
||||
{ "Gcolor2", NULL, NULL, 1 << 3, 1, -1, 50,50,500,500, 5 },
|
||||
{ "Gimp", NULL, NULL, 1 << 3, 0, -1, 50,50,500,500, 1 },
|
||||
{ "HandBrake", NULL, NULL, 1 << 6, 0, -1, 50,50,500,500, 1 },
|
||||
{ "kguitar", NULL, NULL, 1 << 7, 0, -1, 50,50,500,500, 1 },
|
||||
{ "XConsole", NULL, NULL, 1 << 8, 0, -1, 50,50,500,500, 1 },
|
||||
{ NULL, "spterm", NULL, SPTAG(0), 1, -1, 50,50,500,500, 5 },
|
||||
{ NULL, "spfm", NULL, SPTAG(1), 1, -1, 50,50,500,500, 5 },
|
||||
{ NULL, "keepassxc", NULL, SPTAG(2), 0, -1, 50,50,500,500, 5 },
|
||||
|
@ -98,21 +104,25 @@ static const char *termcmd[] = { "st", NULL };
|
|||
|
||||
static const Key keys[] = {
|
||||
/* modifier key function argument */
|
||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||
{ MODKEY, XK_q, spawn, {.v = termcmd } },
|
||||
{ MODKEY, XK_e, spawn, SHCMD("emacs") },
|
||||
{ MODKEY|ShiftMask, XK_q, spawn, SHCMD("qutebrowser") },
|
||||
{ MODKEY, XK_g, spawn, SHCMD("gimp") },
|
||||
{ MODKEY, XK_c, spawn, SHCMD("gcolor2") },
|
||||
{ MODKEY, XK_b, togglebar, {0} },
|
||||
{ MODKEY|ShiftMask, XK_b, toggleborder, {0} },
|
||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||
{ MODKEY, XK_h, focusstack, {.i = +1 } },
|
||||
{ MODKEY, XK_t, focusstack, {.i = -1 } },
|
||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
||||
{ MODKEY|ControlMask, XK_i, incnstack, {.i = +1 } },
|
||||
{ MODKEY|ControlMask, XK_u, incnstack, {.i = -1 } },
|
||||
{ MODKEY, XK_l, setmfact, {.f = -0.05} },
|
||||
{ MODKEY, XK_h, setmfact, {.f = +0.05} },
|
||||
{ MODKEY|ShiftMask, XK_h, setcfact, {.f = +0.25} },
|
||||
{ MODKEY|ShiftMask, XK_l, setcfact, {.f = -0.25} },
|
||||
{ MODKEY|ShiftMask, XK_i, incnmaster, {.i = -1 } },
|
||||
{ MODKEY|ControlMask, XK_i, setnmaster, {.i = 1 } },
|
||||
// { MODKEY|ControlMask, , incnstack, {.i = +1 } },
|
||||
// { MODKEY|ControlMask, , incnstack, {.i = -1 } },
|
||||
{ MODKEY, XK_n, setmfact, {.f = -0.05} },
|
||||
{ MODKEY, XK_d, setmfact, {.f = +0.05} },
|
||||
{ MODKEY|ShiftMask, XK_d, setcfact, {.f = +0.25} },
|
||||
{ MODKEY|ShiftMask, XK_n, setcfact, {.f = -0.25} },
|
||||
{ MODKEY|ShiftMask, XK_o, setcfact, {.f = 0.00} },
|
||||
{ MODKEY, XK_Return, zoom, {0} },
|
||||
{ MODKEY|Mod4Mask, XK_u, incrgaps, {.i = +1 } },
|
||||
|
@ -132,19 +142,19 @@ static const Key keys[] = {
|
|||
{ MODKEY|Mod4Mask, XK_0, togglegaps, {0} },
|
||||
{ MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} },
|
||||
{ MODKEY, XK_Tab, view, {0} },
|
||||
{ MODKEY, XK_c, killclient, {0} },
|
||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||
{ MODKEY, XK_k, killclient, {0} },
|
||||
{ MODKEY, XK_s, setlayout, {.v = &layouts[0]} },
|
||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
||||
{ MODKEY|ShiftMask, XK_m, togglefullscr, {0} },
|
||||
{ MODKEY|ControlMask, XK_w, rotatelayoutaxis, {.i = +1 } }, /* flextile, 1 = layout axis */
|
||||
{ MODKEY|ControlMask, XK_e, rotatelayoutaxis, {.i = +2 } }, /* flextile, 2 = master axis */
|
||||
{ MODKEY|ControlMask, XK_r, rotatelayoutaxis, {.i = +3 } }, /* flextile, 3 = stack axis */
|
||||
{ MODKEY|ControlMask, XK_t, rotatelayoutaxis, {.i = +4 } }, /* flextile, 4 = secondary stack axis */
|
||||
{ MODKEY|ControlMask|ShiftMask, XK_w, rotatelayoutaxis, {.i = -1 } }, /* flextile, 1 = layout axis */
|
||||
{ MODKEY|ControlMask|ShiftMask, XK_e, rotatelayoutaxis, {.i = -2 } }, /* flextile, 2 = master axis */
|
||||
{ MODKEY|ControlMask|ShiftMask, XK_r, rotatelayoutaxis, {.i = -3 } }, /* flextile, 3 = stack axis */
|
||||
{ MODKEY|ControlMask|ShiftMask, XK_t, rotatelayoutaxis, {.i = -4 } }, /* flextile, 4 = secondary stack axis */
|
||||
{ MODKEY|ControlMask, XK_a, rotatelayoutaxis, {.i = +1 } }, /* flextile, 1 = layout axis */
|
||||
{ MODKEY|ControlMask, XK_o, rotatelayoutaxis, {.i = +2 } }, /* flextile, 2 = master axis */
|
||||
{ MODKEY|ControlMask, XK_e, rotatelayoutaxis, {.i = +3 } }, /* flextile, 3 = stack axis */
|
||||
{ MODKEY|ControlMask, XK_u, rotatelayoutaxis, {.i = +4 } }, /* flextile, 4 = secondary stack axis */
|
||||
{ MODKEY|ControlMask|ShiftMask, XK_a, rotatelayoutaxis, {.i = -1 } }, /* flextile, 1 = layout axis */
|
||||
{ MODKEY|ControlMask|ShiftMask, XK_o, rotatelayoutaxis, {.i = -2 } }, /* flextile, 2 = master axis */
|
||||
{ MODKEY|ControlMask|ShiftMask, XK_e, rotatelayoutaxis, {.i = -3 } }, /* flextile, 3 = stack axis */
|
||||
{ MODKEY|ControlMask|ShiftMask, XK_u, rotatelayoutaxis, {.i = -4 } }, /* flextile, 4 = secondary stack axis */
|
||||
{ MODKEY|ControlMask, XK_Return, mirrorlayout, {1} }, /* flextile, flip master and stack areas */
|
||||
{ MODKEY, XK_space, setlayout, {0} },
|
||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||
|
@ -155,7 +165,7 @@ static const Key keys[] = {
|
|||
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
||||
{ MODKEY, XK_y, togglescratch, {.ui = 0 } },
|
||||
{ MODKEY, XK_u, togglescratch, {.ui = 1 } },
|
||||
{ MODKEY, XK_z, togglescratch, {.ui = 1 } },
|
||||
{ MODKEY, XK_x, togglescratch, {.ui = 2 } },
|
||||
TAGKEYS( XK_1, 0)
|
||||
TAGKEYS( XK_2, 1)
|
||||
|
|
2
config.h
2
config.h
|
@ -116,7 +116,7 @@ static const Key keys[] = {
|
|||
{ MODKEY, XK_t, focusstack, {.i = -1 } },
|
||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_i, incnmaster, {.i = -1 } },
|
||||
// { MODKEY|ControlMask, XK_i, setnmaster, {.i = 1 } },
|
||||
{ MODKEY|ControlMask, XK_i, setnmaster, {.i = 1 } },
|
||||
// { MODKEY|ControlMask, , incnstack, {.i = +1 } },
|
||||
// { MODKEY|ControlMask, , incnstack, {.i = -1 } },
|
||||
{ MODKEY, XK_n, setmfact, {.f = -0.05} },
|
||||
|
|
12
dwm.c
12
dwm.c
|
@ -206,6 +206,7 @@ static int gettextprop(Window w, Atom atom, char *text, unsigned int size);
|
|||
static void grabbuttons(Client *c, int focused);
|
||||
static void grabkeys(void);
|
||||
static void incnmaster(const Arg *arg);
|
||||
static void setnmaster(const Arg *arg);
|
||||
static void keypress(XEvent *e);
|
||||
static void killclient(const Arg *arg);
|
||||
static void manage(Window w, XWindowAttributes *wa);
|
||||
|
@ -1120,6 +1121,17 @@ incnmaster(const Arg *arg)
|
|||
arrange(selmon);
|
||||
}
|
||||
|
||||
void
|
||||
setnmaster(const Arg *arg)
|
||||
{
|
||||
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(arg->i, 0);
|
||||
arrange(selmon);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef XINERAMA
|
||||
static int
|
||||
isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info)
|
||||
|
|
Loading…
Reference in a new issue