You are not logged in.
Pages: 1
Is it possible to change the default tiling layout of dwm? What I'd like to do is have the master window occupy the top half of the screen -- essentially rotate the default layout 90 degrees clockwise.
Offline
Offline
If you are using a dwm version circa 4.7, I've got an old bstack.diff laying around.
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
Yup, there's a patch for that called bottom stack.
Thanks; I looked right past it this morning.
Offline
Got the patch applied, but the install failed with:
cleaning
dwm build options:
CFLAGS = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/X11R6/include -DVERSION="5.4.1"
LDFLAGS = -s -L/usr/lib -lc -L/usr/X11R6/lib -lX11
CC = cc
CC dwm.c
In file included from config.h:35,
from dwm.c:242:
bstack.c: In function 'bstack':
bstack.c:13: error: too few arguments to function 'resize'
bstack.c:27: error: too few arguments to function 'resize'
make: *** [dwm.o] Error 1
Is there a workaround for this? I can't locate it searching the forums, or with google. I'm also a Debian user, came to this forum since dwm is pretty popular with this group.
Offline
Are you patching against the correct version? Patches are against a specific version of the code. If the code has changed, you have to dig in and modify the patch to work with the new code.
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
I have bottom stack layout added to my config.h, makes upgrades cleaner and no need for diff. Let me know if you want me to paste relevant code.
Gnome -> Openbox -> Awesome -> XMonad -> dwm .
http://github.com/dusanx/uzbl/
Offline
@dusanx
Please paste the code your using.
Pretty sure I patched dwm-5.4 with the dwm-5.4-bstack.diff patch (am I missing something?) so I'll try patching again, but may need to give your code a shot.
Thanks.
Last edited by landwell (2009-03-17 17:43:52)
Offline
No problem.
#1: Add this (there should be custom functions... comment already, just add function declaration below):
/* custom functions declarations */
static void bstack(void);
#2: Add bstack to layouts:
static Layout layouts[] = {
/* symbol arrange function */
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
{ "TTT", bstack },
};
#3: Paste complete bstack function below /* custom functions */ header:
/* custom functions */
void
bstack(void) {
int x, y, h, w, mh;
unsigned int i, n;
Client *c;
for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next), n++);
if(n == 0)
return;
c = nexttiled(clients);
mh = mfact * wh;
adjustborder(c, n == 1 ? 0 : borderpx);
resize(c, wx, wy, ww - 2 * c->bw, (n == 1 ? wh : mh) - 2 * c->bw, resizehints);
if(--n == 0)
return;
x = wx;
y = (wy + mh > c->y + c->h) ? c->y + c->h + 2 * c->bw : wy + mh;
w = ww / n;
h = (wy + mh > c->y + c->h) ? wy + wh - y : wh - mh;
if(h < bh)
h = wh;
for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
adjustborder(c, borderpx);
resize(c, x, y, ((i + 1 == n) ? wx + ww - x : w) - 2 * c->bw,
h - 2 * c->bw, resizehints);
if(w != ww)
x = c->x + WIDTH(c);
}
}
If something goes wrong here is my complete config.h:
http://pastebin.com/f7d7d4f2f
I always like to add something to config.h and keep dwm.c clean for upgrades.
Gnome -> Openbox -> Awesome -> XMonad -> dwm .
http://github.com/dusanx/uzbl/
Offline
Thanks; pasting in your code worked.
Offline
Pages: 1