sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-resetnmaster-pertag-6.3.diff (1469B)


      1 diff -r -u a/config.def.h b/config.def.h
      2 --- a/config.def.h	2022-01-07 06:42:18.000000000 -0500
      3 +++ b/config.def.h	2022-01-23 16:03:42.521951418 -0500
      4 @@ -69,6 +69,7 @@
      5  	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
      6  	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
      7  	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
      8 +	{ MODKEY,                       XK_o,      resetnmaster,   {0} },
      9  	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
     10  	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
     11  	{ MODKEY,                       XK_Return, zoom,           {0} },
     12 diff -r -u a/dwm.c b/dwm.c
     13 --- a/dwm.c	2022-01-23 16:06:01.221948285 -0500
     14 +++ b/dwm.c	2022-01-23 16:05:35.949948855 -0500
     15 @@ -191,6 +191,7 @@
     16  static void propertynotify(XEvent *e);
     17  static void quit(const Arg *arg);
     18  static Monitor *recttomon(int x, int y, int w, int h);
     19 +static void resetnmaster(const Arg *arg);
     20  static void resize(Client *c, int x, int y, int w, int h, int interact);
     21  static void resizeclient(Client *c, int x, int y, int w, int h);
     22  static void resizemouse(const Arg *arg);
     23 @@ -1296,6 +1297,13 @@
     24  }
     25  
     26  void
     27 +resetnmaster(const Arg *arg)
     28 +{
     29 +	selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = 1;
     30 +	arrange(selmon);
     31 +}
     32 +
     33 +void
     34  resize(Client *c, int x, int y, int w, int h, int interact)
     35  {
     36  	if (applysizehints(c, &x, &y, &w, &h, interact))