Re: [dwm] Re: pertag patch
2009/1/3 henry atting nspm...@literaturlatenight.de On Fr, Jan 02 2009, v4hn wrote: dwm.c:1743: error: redefinition of 'viewnext' dwm.c:1709: error: previous definition of 'viewnext' was here dwm.c:1760: error: redefinition of 'viewprevious' dwm.c:1726: error: previous definition of 'viewprevious' was here make: *** [dwm.o] Fehler 1 As far as I see I have to decide for either the pertag or the arrownav patch, so I decided for the latter. Thanks henry Hi, I had the same problem some time ago but i managed to make them both work. I removed the pertag variables in dwm.c and put them into my config.h where I also put the viewnext() and viewprevious() functions. These two functions have to be modified as well to make them work with the pertag patch otherwise the values won't get stored when the function is called (which means if you use the arrowkeys to change tags the pertag patch stuff has no effect). I can't remember what exactly caused the redefiniton errors but it works for me this way... It looks like this: config.h - static int curtag = 1, prevtag = 1; static Layout *lts[LENGTH(tags) + 1]; static double mfacts[LENGTH(tags) + 1]; static Bool showbars[LENGTH(tags) + 1]; static void viewnext(const Arg *arg); static void viewprevious(const Arg *arg); void viewnext(const Arg *arg) { unsigned int i, j; for(i = 0; i LENGTH(tags); i++) { if((1 i TAGMASK) == tagset[seltags]) { seltags ^= 1; if(i == LENGTH(tags) - 1) tagset[seltags] = 1 0 TAGMASK; else tagset[seltags] = 1 (i + 1) TAGMASK; break; } } /* * pertag support * * * * * * * * * * * * * * * * * */ if(i TAGMASK){ prevtag = curtag; if(i == ~0) curtag = 0; else { for (j=0; !(i 1 j); j++); curtag = j + 1; } } else { prevtag= curtag ^ prevtag; curtag^= prevtag; prevtag= curtag ^ prevtag; } lt[sellt]= lts[curtag]; mfact = mfacts[curtag]; if(showbar != showbars[curtag]) togglebar(NULL); /* * * * * * * * * * * * * * * * * * * * * * * * * */ arrange(); } void viewprevious(const Arg *arg) { unsigned int i, j; for(i = 0; i LENGTH(tags); i++) { if((1 i TAGMASK) == tagset[seltags]) { seltags ^= 1; if(i == 0) tagset[seltags] = 1 (LENGTH(tags) - 1) TAGMASK; else tagset[seltags] = 1 (i - 1) TAGMASK; break; } } /* * pertag support * * * * * * * * * * * * * * * * * */ if(i TAGMASK){ prevtag = curtag; if(i == ~0) curtag = 0; else { for (j=0; !(i 1 j); j++); curtag = j + 1; } } else { prevtag= curtag ^ prevtag; curtag^= prevtag; prevtag= curtag ^ prevtag; } lt[sellt]= lts[curtag]; mfact = mfacts[curtag]; if(showbar != showbars[curtag]) togglebar(NULL); /* * * * * * * * * * * * * * * * * * * * * * * * * */ arrange(); } static Key keys[] = { ... -
[dwm] Re: pertag patch
On Sa, Jan 03 2009, daniel fusser wrote: 2009/1/3 henry atting nspm...@literaturlatenight.de On Fr, Jan 02 2009, v4hn wrote: dwm.c:1743: error: redefinition of 'viewnext' dwm.c:1709: error: previous definition of 'viewnext' was here dwm.c:1760: error: redefinition of 'viewprevious' dwm.c:1726: error: previous definition of 'viewprevious' was here make: *** [dwm.o] Fehler 1 As far as I see I have to decide for either the pertag or the arrownav patch, so I decided for the latter. Thanks henry Hi, I had the same problem some time ago but i managed to make them both work. I removed the pertag variables in dwm.c and put them into my config.h where I also put the viewnext() and viewprevious() functions. These two functions have to be modified as well to make them work with the pertag patch otherwise the values won't get stored when the function is called (which means if you use the arrowkeys to change tags the pertag patch stuff has no effect). I can't remember what exactly caused the redefiniton errors but it works for me this way... Unfortunately it does not work for me, dwm crashes when switching to another tag. But anyway it's a good start, thanks, I will further look into it when I have a little more time. henry
[dwm] Re: pertag patch
On Fr, Jan 02 2009, Valentin wrote: Yes, it is. I updated it a couple of days ago, but for some reason arg still hasn't put it one the wiki =P You can get it here: http://lists.suckless.org/dwm/0812/7209.html Very nice, thanks :) henry
[dwm] Re: pertag patch
Mmh, I must have got it wrong. I expected if I change the layout of one tag - let's say from tiled to bottomstack - it would not change the layout of all tags but only the current one. As far as I can see this is not what pertag does... henry
Re: [dwm] Re: pertag patch
On Fri, Jan 02, 2009 at 06:12:45PM +0100, henry atting wrote: Mmh, I must have got it wrong. I expected if I change the layout of one tag - let's say from tiled to bottomstack - it would not change the layout of all tags but only the current one. As far as I can see this is not what pertag does... That's what it _should_ do and does for me. What's the problem? v4hn pgpINg4ggs5k4.pgp Description: PGP signature
[dwm] Re: pertag patch
On Fr, Jan 02 2009, v4hn wrote: On Fri, Jan 02, 2009 at 06:12:45PM +0100, henry atting wrote: Mmh, I must have got it wrong. I expected if I change the layout of one tag - let's say from tiled to bottomstack - it would not change the layout of all tags but only the current one. As far as I can see this is not what pertag does... That's what it _should_ do and does for me. What's the problem? Okay, I have three tags, suppose the layout of all is tiled. I switch to the third tag and change the layout to floating. As a result all three tags now have a floating layout. henry
Re: [dwm] Re: pertag patch
On Fri, Jan 02, 2009 at 08:41:08PM +0100, henry atting wrote: Okay, I have three tags, suppose the layout of all is tiled. I switch to the third tag and change the layout to floating. As a result all three tags now have a floating layout. I suppose you didn't apply the patch clean/at all(?). Take a look at how to do so and give it another try. v4hn pgppjLIbflZxT.pgp Description: PGP signature
[dwm] Re: pertag patch
On Fr, Jan 02 2009, v4hn wrote: On Fri, Jan 02, 2009 at 08:41:08PM +0100, henry atting wrote: Okay, I have three tags, suppose the layout of all is tiled. I switch to the third tag and change the layout to floating. As a result all three tags now have a floating layout. I suppose you didn't apply the patch clean/at all(?). Take a look at how to do so and give it another try. I now gave it even more than one try. It applies well. Hunk #1 succeeded at 199 (offset 2 lines). Hunk #2 succeeded at 242 (offset 2 lines). Hunk #3 succeeded at 1251 (offset 15 lines). Hunk #4 succeeded at 1268 (offset 15 lines). Hunk #5 succeeded at 1316 (offset 15 lines). Hunk #6 succeeded at 1456 (offset 18 lines). Hunk #7 succeeded at 1489 (offset 18 lines). Hunk #8 succeeded at 1680 (offset 18 lines). But the moment this patch `dwm-5.4-arrownav.diff' comes into play it fails dwm.c:1743: error: redefinition of ‘viewnext’ dwm.c:1709: error: previous definition of ‘viewnext’ was here dwm.c:1760: error: redefinition of ‘viewprevious’ dwm.c:1726: error: previous definition of ‘viewprevious’ was here make: *** [dwm.o] Fehler 1 As far as I see I have to decide for either the pertag or the arrownav patch, so I decided for the latter. Thanks henry