You are not logged in.

#276 2011-08-20 05:40:54

c0r73x
Member
From: Sweden
Registered: 2011-05-06
Posts: 14

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

Hi I'm still very new to dwm (been using it for 3 days) but i managed to make tilemovemouse.c (http://lists.suckless.org/dwm/0903/7773.html) work in dwm 5.9.

The thing is that I only have one monitor on this computer atm and would like to know if it works on dual monitors aswell, maybe someone could try it? smile

Here is the diff file for the new tilemovemouse.c

--- tilemovemouse.c	2009-03-20 20:12:04.000000000 +0100
+++ tilemovemouse.c	2011-08-19 13:19:16.814201666 +0200
@@ -1,7 +1,8 @@
 void
 insertbefore(Client *a, Client *b)	/* insert a before b in the client list */
 {
-	Client **x = &clients;
+	Monitor *m = a->mon;
+	Client **x = &m->clients;
 	
 	while(*x != b && *x)
 		x = & (*x)->next;
@@ -20,13 +21,21 @@ void
 tilemovemouse(const Arg *arg) {
 	/* Could EnterNotify events be used instead? */
 	Client *c, *d;
+	Monitor *m;
 	XEvent ev;
 	int x, y;
 	Bool after;
 
-	if(!(c = sel))
+	if(!(c = selmon->sel))
 		return;
-	if(c->isfloating || !lt[sellt]->arrange){
+
+	if((m = ptrtomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) {
+		sendmon(c, m);
+		selmon = m;
+		focus(NULL);
+	}
+
+	if(c->isfloating || !selmon->lt[selmon->sellt]->arrange){
 		movemouse(NULL);
 		return;
 	}
@@ -45,13 +54,13 @@ tilemovemouse(const Arg *arg) {
 			x = ev.xmotion.x;
 			y = ev.xmotion.y;
 			after = False;
-			for(d = nexttiled(clients); d; d = nexttiled(d->next)){
+			for(d = nexttiled(m->clients); d; d = nexttiled(d->next)){
 				if(d == c)
 					after = True;
 				else if(INRECT(x, y, d->x, d->y, d->w+2*borderpx, d->h+2*borderpx)){
 					detach(c);
 					after ? insertafter(c, d) : insertbefore(c,d);
-					arrange();
+					arrange(c->mon);
 					break;
 				}
 			}

Offline

#277 2011-08-21 05:06:39

Cloudef
Member
Registered: 2010-10-12
Posts: 636

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

I liked how you could cycle windows in pyTyle, and could not find native function for it in DWM.
My DWM differs a lot from vanilla DWM, so I won't bother doing patches for now. Adding it will be simple however.

In dwm.c throws these functions:

void
attachend(Client *c) {
   Client *e = c->mon->clients;
   if(!e)
   {
      attach(c);
      return;
   }

   while(e->next)
      e = e->next;

   e->next = c;
   c->next = NULL;
}     

void
cyclezoom(const Arg *arg)
{
   Client *c = selmon->clients;
   if(!c)
      return;

   if(!selmon->lt[selmon->sellt]->arrange
         || selmon->lt[selmon->sellt]->arrange == monocle
         || (selmon->sel && selmon->sel->isfloating))
      return;

   detach(c);
   if(c->next) focus(c->next);
   attachend(c);
   arrange(c->mon);
}             

and in config.h add new shortcut:

 { MODKEY, XK_Whatever, cyclezoom,  {0} },   

The master window will always become focused.
It's possible to make it cycle other way too with minor modifications.

Last edited by Cloudef (2011-08-21 05:07:41)

Offline

#278 2011-08-21 10:09:30

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

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

Noticed a problem in the fibonacci layout probably occuring because of the rounding errors accumulation.
It made the 'no double gap' test of the jokerboy's useless gap patch version fails.
It seems the problem is not totally fixed because there's still a shift of one pixel occuring on the transition from six to seven clients.

Here's the patch:

--- dwm-5.8.2-fibonacci.diff	2011-08-21 12:04:07.484332668 +0200
+++ fibonacci-missing-pixels.diff	2011-08-21 12:02:31.901372109 +0200
@@ -19,7 +19,7 @@
 @@ -0,0 +1,66 @@
 +void
 +fibonacci(Monitor *mon, int s) {
-+	unsigned int i, n, nx, ny, nw, nh;
++	unsigned int i, n, nx, ny, nw, nh, oldnh;
 +	Client *c;
 +
 +	for(n = 0, c = nexttiled(mon->clients); c; c = nexttiled(c->next), n++);
@@ -34,6 +34,7 @@
 +	for(i = 0, c = nexttiled(mon->clients); c; c = nexttiled(c->next)) {
 +		if((i % 2 && nh / 2 > 2 * c->bw)
 +		   || (!(i % 2) && nw / 2 > 2 * c->bw)) {
++			oldnh = nh;
 +			if(i < n - 1) {
 +				if(i % 2)
 +					nh /= 2;
@@ -42,7 +43,7 @@
 +				if((i % 4) == 2 && !s)
 +					nx += nw;
 +				else if((i % 4) == 3 && !s)
-+					ny += nh;
++					ny += nh + ((oldnh % 2 == 1) ? 1 : 0);
 +			}
 +			if((i % 4) == 0) {
 +				if(s)

gh · da · ds

Offline

#279 2011-08-26 16:20:24

danilo
Member
From: Switzerland
Registered: 2010-12-10
Posts: 25
Website

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

I hope this wasn't requested before...

It would be great if someone could make a fix that makes the nametag patch compatible with the pertag patch... (I want to rename tags, but keep separate tags on each screen.)

I tried to fix it myself, but didn't manage to do so as I'm not really into C programming.


"Freedom is the freedom to say that two plus two make four. If that is granted, all else follows." - George Orwell

Offline

#280 2011-09-02 18:14:22

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

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

The original uselessgap patch for dwm introduces "double gaps" between client windows in most layouts except tile and bstack, so I wrote several patches to fix it.
Here are the patches: https://gist.github.com/1189290
The patches applies to vanilla dwm 5.9. Conflict with other patches may happen, but should be easily resolvable.

There's a block of description text at the head of each patch, so it should be clear what each of those does. But still, two things of note:
- You must define gappx in config.h:

static const unsigned int gappx = 3;

Note since this approach adds margin around every client window, as well as the whole "window area", the actual gap you see is (gappx * 2).
- If you use bstack, which highly resembles the tile layout, you need to adjust it just like I did tile in gap-03layout_margin.patch.

Feedback is welcome & enjoy!


This silver ladybug at line 28...

Offline

#281 2011-09-03 11:00:59

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

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

Guys, is there a way to modify the default layout "tile" and decrease the client width. The left "window" width is more important than the right.
I just wanna  fix the same width (as if you push "Alt+h")


Github -- My terminal font Envypn

Offline

#282 2011-09-03 11:27:37

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

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

@Ypnose, set mfact = 0.5 in config.h to make the master window as wide as slaves, if that's what you meant.


This silver ladybug at line 28...

Offline

#283 2011-09-03 11:35:15

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

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

Thanks a lot lad. Exactly what i was looking for.
You rock.


Github -- My terminal font Envypn

Offline

#284 2011-09-06 01:36:21

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 569
Website

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

Did someone find out yet how to pass mouse clicks directly to an unfocused program when the focus is not following the mouse?
(Normally, the first click only focuses a window and the second one is passed to the program.)


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#285 2011-09-11 22:08:24

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

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

Hey lads,
Can someone give me a pertag patch for the dwm-5.9? I didn't find anything.
I'm still with 5.8.2 and I wanna take a look to 5.9.

And have you got a good font (no TTF) for the bar. I use terminus but i wanna see something different, now.

Last edited by Ypnose (2011-09-11 22:23:59)


Github -- My terminal font Envypn

Offline

#286 2011-09-11 22:49:18

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

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

Even though the version of a patch is older than current dwm, then they many times still work when taken from dwm's homepages patches section...

The pertag patch offered there, i've tested myself to work fine with dwm 5.9, even though it's listed for v5.8.2...

For fonts, I dunno; I just used 7x14 when i've played around with dwm last time...

Offline

#287 2011-09-11 23:26:59

el mariachi
Member
Registered: 2007-11-30
Posts: 595

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

look in this thread for any topic by jokerboy and visit his bitbucket repo wink he uses 5.9 with pertag2 and the same font as me: "-misc-fixed-medium-r-semicondensed--12-110-75-75-c-*-iso8859-2" although I'm going to try "lime" from the artwiz pack

Offline

#288 2011-09-12 09:36:50

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

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

Hum. It seems to be a great advice. Jokerboy's repo is substantial.

Really like this forum. Thanks.

Last edited by Ypnose (2011-09-12 12:14:58)


Github -- My terminal font Envypn

Offline

#289 2011-09-16 19:32:05

beepressure
Member
Registered: 2009-10-29
Posts: 80

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

I've been using 5.7.2 for about a year now and decided to update. I have everything how I like it except that i am trying to patch pertag2 and not getting anywhere. Can anyone tell me what I am doing wrong? I have 5.7.2 patched fine with pertag.

[al@boddicker dwm-5.9]$ ls
01-dwm-5.9-pertag2.diff  config.h   dwm    dwm.c  LICENSE   pertag2.diff
config.def.h             config.mk  dwm.1  dwm.o  Makefile  README
[al@boddicker dwm-5.9]$ patch -p1 < pertag2.diff 
patch: **** Only garbage was found in the patch input.
[al@boddicker dwm-5.9]$ patch -p1 < 01-dwm-5.9-pertag2.diff 
patch: **** Only garbage was found in the patch input.
[al@boddicker dwm-5.9]$ 

Offline

#290 2011-09-16 23:27:22

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

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

The error message sounds like you have non-standard/corrupted patch files, so open them in an editor and check that they are allright!

It works fine for me, so try with a fresh untared dwm-5.9 from suckless.org and pertag2 from jokerboy's mercurial repo.

Btw, the '-p1' is redundant, as patch by default just uses the pathless filename...

Offline

#291 2011-09-17 01:33:06

beepressure
Member
Registered: 2009-10-29
Posts: 80

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

[al@boddicker dwm-5.9]$ patch -p1 < pertag2.diff 
patching file dwm.c
Hunk #1 FAILED at 124.
Hunk #2 FAILED at 140.
Hunk #3 FAILED at 244.
Hunk #4 FAILED at 434.
Hunk #5 FAILED at 506.
Hunk #6 FAILED at 651.
Hunk #7 FAILED at 735.
Hunk #8 FAILED at 1498.
Hunk #9 FAILED at 1513.
Hunk #10 FAILED at 1650.
Hunk #11 FAILED at 1691.
Hunk #12 FAILED at 1967.
Hunk #13 succeeded at 2080 with fuzz 1 (offset 31 lines).
12 out of 13 hunks FAILED -- saving rejects to file dwm.c.rej
[al@boddicker dwm-5.9]$ 

That was with the new file saved from his site.

Offline

#292 2011-09-17 01:57:25

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

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

~/dwm-5.9 % patch < ../01-dwm-5.9-pertag2.diff 
patching file dwm.c

I just go to the first google hit of "jokerboy dwm", select the pertag2 patch so it's contents shows, rightclicks on 'raw' and select to dowload linked content, and which gives the above posted result...

Last edited by mhertz (2011-09-17 02:01:11)

Offline

#293 2011-09-17 02:00:08

beepressure
Member
Registered: 2009-10-29
Posts: 80

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

mhertz wrote:
~/dwm-5.9 % patch < ../01-dwm-5.9-pertag2.diff 
patching file dwm.c

I don't know what you're doung wrong...

I just go to the first google hit of "jokerboy dwm", select the pertag2 patch so it's contents shows, rightclicks on 'raw' and select to dowload linked content, and which gives the above posted result...

I did exactly that, and got the hunk errors.

Offline

#294 2011-09-17 02:04:32

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

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

martin@arch ~ % md5sum 01-dwm-5.9-pertag2.diff 
93a67a21835df5cc4bcdd600ba545f39  01-dwm-5.9-pertag2.diff

Offline

#295 2011-09-17 02:07:36

beepressure
Member
Registered: 2009-10-29
Posts: 80

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

[al@boddicker dwm-5.9]$ md5sum 01-dwm-5.9-pertag2.diff 
93a67a21835df5cc4bcdd600ba545f39  01-dwm-5.9-pertag2.diff

The patch says it worths at hunk #13 but then when I would try to makepkg -efi it spits out errors and aborts.

Offline

#296 2011-09-17 02:18:22

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

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

Obviously your dwm source files are clean, right? ..Some other patch could easilly interferre, and in this case, we have to test out differen't order of applying the patches, and if needed, manually fix the failling parts...

Anyway, after having applied the patch(without getting any errors!), then you'ed also have to add some definitions in config.h, for per-layout mfact, nmaster etc. Check out jokerboy's config.h to locate what's missing...

Last edited by mhertz (2011-09-17 02:23:28)

Offline

#297 2011-09-17 02:32:30

beepressure
Member
Registered: 2009-10-29
Posts: 80

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

Is it because im trying to patch it on 5.9.2? Totally clean, no patches. In fact I copied the stuff from abs all over so it was fresh.

Last edited by beepressure (2011-09-17 02:33:14)

Offline

#298 2011-09-17 02:40:49

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

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

nvm

Last edited by the sad clown (2011-09-17 02:42:12)


I laugh, yet the joke is on me

Offline

#299 2011-09-17 06:10:43

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

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

beepressure wrote:

Is it because im trying to patch it on 5.9.2? Totally clean, no patches. In fact I copied the stuff from abs all over so it was fresh.

pertag2 for dwm-5.9.

What 5.9.2 are you using, the latest version in hg repo is 5.9.1. Maybe you are trying to say arch package 5.9-2, but then it should work fine.

Offline

#300 2011-09-17 11:28:41

w0ng
Member
From: Australia
Registered: 2009-06-04
Posts: 88
Website

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

JokerBoy wrote:
beepressure wrote:

Is it because im trying to patch it on 5.9.2? Totally clean, no patches. In fact I copied the stuff from abs all over so it was fresh.

pertag2 for dwm-5.9.

What 5.9.2 are you using, the latest version in hg repo is 5.9.1. Maybe you are trying to say arch package 5.9-2, but then it should work fine.

hey JokerBoy,
just wondering. is there an nbstack with your pertag2 patch or do you recommend using simon's pertag2 + nbstack?

Offline

Board footer

Powered by FluxBB