You are not logged in.

#626 2012-02-18 22:19:08

ivoarch
Member
From: the six feet under the ground
Registered: 2011-03-31
Posts: 436

Re: DWM Hackers Unite! Share (or request) dwm patches.

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);
+}
+}
+  

I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#627 2012-02-18 22:35:59

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,472
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

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 smile

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

#628 2012-02-26 11:42:49

akuschki
Member
Registered: 2009-10-17
Posts: 40

Re: DWM Hackers Unite! Share (or request) dwm patches.

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

#629 2012-02-26 11:58:41

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,024

Re: DWM Hackers Unite! Share (or request) dwm patches.

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

#630 2012-02-26 16:38:14

Beastie
Member
Registered: 2012-01-14
Posts: 39

Re: DWM Hackers Unite! Share (or request) dwm patches.

does anyone know where i can get a working xpm patch for dwm 6.0 ?
thanks

Offline

#631 2012-02-26 17:49:30

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 453

Re: DWM Hackers Unite! Share (or request) dwm patches.

Beastie wrote:

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

#632 2012-02-26 21:09:02

Beastie
Member
Registered: 2012-01-14
Posts: 39

Re: DWM Hackers Unite! Share (or request) dwm patches.

yes thanks smile i

Offline

#633 2012-02-29 19:00:40

Shinryuu
Member
From: 俺のコスモス
Registered: 2010-02-27
Posts: 338

Re: DWM Hackers Unite! Share (or request) dwm patches.

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

JokerBoy wrote:

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

#634 2012-03-11 00:21:53

portix
Member
Registered: 2009-01-13
Posts: 757

Re: DWM Hackers Unite! Share (or request) dwm patches.

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

#635 2012-03-12 22:04:39

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,472
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

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

#636 2012-03-12 22:21:42

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

tags should be right after the layouts part in the config.. and that patch is so damn old..

Offline

#637 2012-03-13 12:03:23

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,472
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

JokerBoy wrote:

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

#638 2012-03-20 16:56:19

Ichigo-Roku
Member
Registered: 2012-01-15
Posts: 35

Re: DWM Hackers Unite! Share (or request) dwm patches.

Hi !

Can someone make a patch to hide the titlebar ?

Thanks.

Offline

#639 2012-03-20 17:00:04

karol
Archivist
Registered: 2009-05-06
Posts: 25,431

Re: DWM Hackers Unite! Share (or request) dwm patches.

Ichigo-Roku wrote:

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

#640 2012-03-20 17:58:01

Ichigo-Roku
Member
Registered: 2012-01-15
Posts: 35

Re: DWM Hackers Unite! Share (or request) dwm patches.

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

#641 2012-03-21 00:50:52

ivoarch
Member
From: the six feet under the ground
Registered: 2011-03-31
Posts: 436

Re: DWM Hackers Unite! Share (or request) dwm patches.

Ichigo-Roku wrote:

Hi !

Can someone make a patch to hide the titlebar ?

Thanks.

Yes this https://gist.github.com/1335176


I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#642 2012-03-21 05:55:36

Ichigo-Roku
Member
Registered: 2012-01-15
Posts: 35

Re: DWM Hackers Unite! Share (or request) dwm patches.

Thanks I'll try it when I'll get back !

Offline

#643 2012-03-21 21:01:44

neurolysis
Member
Registered: 2011-02-23
Posts: 112
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

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 big_smile

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

#644 2012-03-23 13:42:17

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,472
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

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

#645 2012-03-23 15:23:50

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

if(strstr(c->name, "emesene") || strstr(c->name, "pidgin") || strstr(c->name, "skype"))

Offline

#646 2012-03-23 15:57:21

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,472
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

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

#647 2012-03-24 21:36:04

Ichigo-Roku
Member
Registered: 2012-01-15
Posts: 35

Re: DWM Hackers Unite! Share (or request) dwm patches.

ivoarch wrote:
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

#648 2012-03-24 23:12:40

ivoarch
Member
From: the six feet under the ground
Registered: 2011-03-31
Posts: 436

Re: DWM Hackers Unite! Share (or request) dwm patches.

@Ichigo-Roku 

This patch is not mine, is from @ lolilolicon
I used the patch on version 5.9


I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#649 2012-03-25 06:14:47

Ichigo-Roku
Member
Registered: 2012-01-15
Posts: 35

Re: DWM Hackers Unite! Share (or request) dwm patches.

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

#650 2012-03-28 19:42:41

wolfcore
Member
From: California
Registered: 2012-03-06
Posts: 137

Re: DWM Hackers Unite! Share (or request) dwm patches.

I've been unable to find the statuscolors patch for 6.0, any ideas where I can find it? smile

Last edited by wolfcore (2012-03-28 20:36:40)

Offline

Board footer

Powered by FluxBB