You are not logged in.
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?
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
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
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)
Offline
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
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
Offline
@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
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
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)
Offline
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
look in this thread for any topic by jokerboy and visit his bitbucket repo 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
Offline
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
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
[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
~/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
~/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
martin@arch ~ % md5sum 01-dwm-5.9-pertag2.diff
93a67a21835df5cc4bcdd600ba545f39 01-dwm-5.9-pertag2.diff
Offline
[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
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
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
nvm
Last edited by the sad clown (2011-09-17 02:42:12)
I laugh, yet the joke is on me
Offline
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.
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.
Arch64/DWM || My Dropbox referral link
Offline
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.
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?
All configs @ https://github.com/w0ng
Offline