sites

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

dwm-horizontal-6.4.diff (1386B)


      1 diff --git a/config.def.h b/config.def.h
      2 index 9efa774..24d44e0 100644
      3 --- a/config.def.h
      4 +++ b/config.def.h
      5 @@ -39,6 +39,7 @@ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen win
      6  
      7  static const Layout layouts[] = {
      8  	/* symbol     arrange function */
      9 +	{ "III",      horizontal },
     10  	{ "[]=",      tile },    /* first entry is default */
     11  	{ "><>",      NULL },    /* no layout function means floating behavior */
     12  	{ "[M]",      monocle },
     13 diff --git a/dwm.c b/dwm.c
     14 index f1d86b2..9a188d9 100644
     15 --- a/dwm.c
     16 +++ b/dwm.c
     17 @@ -175,6 +175,7 @@ static long getstate(Window w);
     18  static int gettextprop(Window w, Atom atom, char *text, unsigned int size);
     19  static void grabbuttons(Client *c, int focused);
     20  static void grabkeys(void);
     21 +static void horizontal(Monitor *m);
     22  static void incnmaster(const Arg *arg);
     23  static void keypress(XEvent *e);
     24  static void killclient(const Arg *arg);
     25 @@ -977,6 +978,22 @@ grabkeys(void)
     26  	}
     27  }
     28  
     29 +void
     30 +horizontal(Monitor *m)
     31 +{
     32 +	Client *c;
     33 +	unsigned int n, i;
     34 +
     35 +	/* Count windows */
     36 +	for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
     37 +
     38 +	if(!n)
     39 +		return;
     40 +	else /* Split vertically */
     41 +		for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
     42 +			resize(c, m->wx + i * m->mw / n, m->wy, m->mw / n - (2 * c->bw), m->wh - (2 * c->bw), False);
     43 +}
     44 +
     45  void
     46  incnmaster(const Arg *arg)
     47  {