You are not logged in.
Bstack without nmaster
+
+void
+bstack(Monitor *m) {
+int x, y, h, w, mh;
+unsigned int i, n;
+Client *c;
+
+for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+if(n == 0)
+return;
+/* master */
+c = nexttiled(m->clients);
+mh = m->mfact * m->wh;
+resize(c, m->wx, m->wy, m->ww - 2 * c->bw, (n == 1 ? m->wh : mh) - 2 * c->bw, False);
+if(--n == 0)
+return;
+/* tile stack */
+x = m->wx;
+y = (m->wy + mh > c->y + c->h) ? c->y + c->h + 2 * c->bw : m->wy + mh;
+w = m->ww / n;
+h = (m->wy + mh > c->y + c->h) ? m->wy + m->wh - y : m->wh - mh;
+if(w < bh)
+w = m->ww;
+for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
+resize(c, x, y, /* remainder */ ((i + 1 == n)
+? m->wx + m->ww - x - 2 * c->bw : w - 2 * c->bw), h - 2 * c->bw, False);
+if(w != m->ww)
+x = c->x + WIDTH(c);
+}
+}
+
Offline
Awesome man, thanks! I will look at what you have done first before applying it, I really want to learn this and be able to do it myself! EDIT: Any good recommendations/tips on learing a bit of C?
Thanks again, mate
Last edited by Unia (2012-02-18 22:36:25)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Hi fellow dwm enthusiasts,
after a recent forced excursion to windows land I have realised that windows has come a long way in terms of usability since the XP days when I last used it. I would like to incorporate some key bindings that I liked into dwm in the following way:
1. pressing Mod-1 activates all clients tagged with 1 (this is standard behaviour)
2. if there are no clients tagged 1, pressing Mod-1 a second time will launch the standard program defined for this tag in config.h
3. if there is more than one client tagged with 1, pressing Mod-1 a second or more times will be equivalent to Mod-j, i.e. it will cycle through all clients tagged with 1
This is my first stab at hacking dwm so it would be great if sombody could give me a pointer where to look in dwm.c for the best place to add the additional logic described in 2. and 3.
Offline
Putting it in broad terms you would have to have Mod-1 bound to a new function that has an integer that increments and calls other functions depending on its' value and checks the number of windows.
You're just jealous because the voices only talk to me.
Offline
does anyone know where i can get a working xpm patch for dwm 6.0 ?
thanks
Offline
does anyone know where i can get a working xpm patch for dwm 6.0 ?
thanks
If you mean xbm patch...
https://github.com/ok100/dwm/blob/maste … icons.diff
Offline
Offline
Anyone able to get fibonacci layout to work (I'm trying to use the one from dwm's site, dwm-5.8.2-fibonacci.diff)
In file included from config.h:4:0,
from dwm.c:304:
fibonacci.c: In function ‘fibonacci’:
fibonacci.c:47:24: error: ‘Monitor’ has no member named ‘mfact’
Oh god it was already answered in this thread
Replace mon->mfact with mon->mfacts[mon->curtag]
My bad.
This made my evening to shine!
Last edited by Shinryuu (2012-02-29 20:38:57)
Offline
I created a patch focusrule i want to share. It allows to bind a shortcut to a rule. If the shortcut for a rule is pressed the next matching window is focused, pressing the shortcut multiple times switches between all matching windows.
For rules like this
static const Rule rules[] = {
/* class instance title tags mask isfloating monitor */
{ "Dwb", NULL, NULL, 0, False, -1 },
{ "Firefox", NULL, NULL, 1<<1, False, -1 },
...
};
the rule can be bound to a shortcut in the following way:
{ Mod4Mask, XK_d, focusrule, {.v = &rules[0] } },
{ Mod4Mask, XK_f, focusrule, {.v = &rules[1] } },
Offline
Hey all,
I need some help with the pertag2 patch that I found here: https://bbs.archlinux.org/viewtopic.php … 34#p734334 (I don't use nmaster so I don't want it)
Now I got it to patch correctly and I have added the right part to config.h, as per so:
/* tagging */
static const Tag tags[] = {
/* name layout mfact */
{ "web", &layouts[1], -1 },
{ "chill", &layouts[0], -1 },
{ "media", &layouts[1], -1 },
{ "werk", &layouts[1], -1 },
};
But when I run makepkg -efi, I get this output:
dwm build options:
CFLAGS = -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/include/X11 -DVERSION="6.0" -DXINERAMA
LDFLAGS = -s -L/usr/lib -lc -L/usr/lib/X11 -lX11 -L/usr/lib/X11 -lXinerama
CC = cc
CC dwm.c
In file included from dwm.c:300:0:
config.h:24:21: fout: ‘layouts’ undeclared here (not in a function)
make: *** [dwm.o] Fout 1
==> ERROR: A failure occurred in build().
Aborting...
What am I doing wrong? Oh, I had to modify the original patch to which I linked above a tiny bit, you can find it here: http://pastebin.com/0kQGQyiC
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
tags should be right after the layouts part in the config.. and that patch is so damn old..
Arch64/DWM || My Dropbox referral link
Offline
tags should be right after the layouts part in the config.. and that patch is so damn old..
Thanks! It applies cleanly now and seems to work - there's one issue though: on tiliing and bstack layout, the master area is really small (see this screenshot: http://ompldr.org/vZDB2Nw)
The other layouts (grid, monocle and free) do work as expected. How can I fix this?
EDIT: Nevermind, I just took all the patches with nmaster. It looks rather interesting, after all....
Last edited by Unia (2012-03-13 19:09:44)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Hi !
Can someone make a patch to hide the titlebar ?
Thanks.
Offline
Can someone make a patch to hide the titlebar ?
Not sure if I get it, but have you tried Alt+b ? (if you're using Alt as the mod key)
Offline
Thanks for your answer but I want to keep the tags and the status bar, I just want to remove the title of the current application.
Offline
Hi !
Can someone make a patch to hide the titlebar ?
Thanks.
Yes this https://gist.github.com/1335176
Offline
Thanks I'll try it when I'll get back !
Offline
Is it possible to use uselessgaps without having the gaps doubled up between windows? For example, the space is twice as large between each window (as there is a separate gap for each window) here: http://i.imgur.com/d1leF.jpg
edit: Well -- that was easier than I thought. Turns out it isn't because there is a separate gap for each window, just because it is like this by design. The code does 2 * x for these borders, if you remove the multiplier it works just great. You can see what to do here, it's very simple: https://github.com/cdown/dwm/commit/45a … 7ede501153
edit #2: actually, this removes the right and bottom borders. hmmmm
edit #3: disregard everything, i just noticed the exact patch for my issue is in the op
edit #4: took some work to get working in 5.8.2, here's the diff: https://github.com/cdown/dwm/commit/799 … 40ec4b1dcb
Last edited by neurolysis (2012-03-21 21:56:58)
Offline
Hello,
I am using the pidgin layout I found on Jokerboy's Bitbucket, I just changed the wm name to adapt to Emesene, which is what I'm using (find it here: http://pastebin.com/Eek3ZqQF) . However, occasionally I also use Skype and I would like to integrate this into the layout as well. Is there a way I can edit
+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++)
+ if(strstr(c->name, "emesene"))
+ bl = c;
that part and make it like name, "emesene" and/or "skype"?
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
if(strstr(c->name, "emesene") || strstr(c->name, "pidgin") || strstr(c->name, "skype"))
Arch64/DWM || My Dropbox referral link
Offline
Awesome, thanks!
EDIT: Wait, that's if/if, so I can't have Emesene's and Skype's contact list open at the same time. Is there some other way I can edit this patch so that that area is "split" between Emesene and Skype? Like:
_______________
| | | |
|_____|______|__|
| | | |
|_____|______|__|
Last edited by Unia (2012-03-23 16:22:24)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Ichigo-Roku wrote:Hi !
Can someone make a patch to hide the titlebar ?
Thanks.
Yes this https://gist.github.com/1335176
Is your patch working with dwm-6.0 ?
I just add the few lines of your .diff in my config.h and dwm.c, like that it's working very well !
Thanks.
Offline
Ah okay, so it's not working with "patch -p1 < path/to/patch.diff" on the 6.0. The lines have changed but applying it manually works too so it's fine to me.
Thanks for the patch !
Offline
I've been unable to find the statuscolors patch for 6.0, any ideas where I can find it?
Last edited by wolfcore (2012-03-28 20:36:40)
Offline