Re: [dwm] Different window modes on different workspaces
Godsend, I luv it... The only thing is that I would like all the workspaces displayed at the top instead of 1/2 etc... ie. (1 2 3...) But This is exactly what I was looking for, and I figure that it's just a patch that I need to remove or something? Or is this even possible? Thanks, Jonny Christian Garbs wrote: On Fri, Mar 14, 2008 at 08:50:55PM -0700, Jonny Gerold wrote: I have a very simple question. I just upgraded to 4.8. And I would like to know if there is a simple way to assign one workspace to be say tiled mode, and another to be float mode. I would like to use tiling on some of my workspaces, but am always pissed when I move to another desktop with a float that gets moved out of place. You could have a look at dwm-mitch and it's patches, it uses workspaces instead of tags and has per-workspace settings of layout and mfwact. http://www.cgarbs.de/dwm-mitch.en.html It's only dwm 4.7, though. I don't have much time at the moment to update it and with all the things moving and me only having a single monitor setup, I think I can very well survive on 4.7 for the next time :-) (Although I want to try out two new layouts posted here some time ago, I think one of them was called "itile" or the like. Has anybody got a screenshot showing it?) Regards, Christian
Re: [dwm] Different window modes on different workspaces
On Fri, Mar 14, 2008 at 08:50:55PM -0700, Jonny Gerold wrote: > I have a very simple question. I just upgraded to 4.8. And I would > like to know if there is a simple way to assign one workspace to be > say tiled mode, and another to be float mode. I would like to use > tiling on some of my workspaces, but am always pissed when I move to > another desktop with a float that gets moved out of place. You could have a look at dwm-mitch and it's patches, it uses workspaces instead of tags and has per-workspace settings of layout and mfwact. http://www.cgarbs.de/dwm-mitch.en.html It's only dwm 4.7, though. I don't have much time at the moment to update it and with all the things moving and me only having a single monitor setup, I think I can very well survive on 4.7 for the next time :-) (Although I want to try out two new layouts posted here some time ago, I think one of them was called "itile" or the like. Has anybody got a screenshot showing it?) Regards, Christian -- Christian.Garbs.http://www.cgarbs.de sigmentation fault signature.asc Description: Digital signature
Re: [dwm] new setgeom in hg tip
On Sat, Mar 15, 2008 at 05:55:11PM -0300, Brendan MacDonell wrote: > On Sat, Mar 15, 2008 at 5:30 PM, Johannes Hofmann > <[EMAIL PROTECTED]> wrote: > > Huh? That's a config parser in dwm! > Luckily I'd say, since otherwise we'd seem to be stuck hardcoding > values for screen sizes as 24-line functions for each set of geoms. > This config parser isn't really much different from the regexes that > were used in config.h for matching windows, nor is it difficult to > understand, so I have no objections. What do you think of the attached patch (against 4.8)? It reduces the setgeoms() function a bit - agreed, not very much :-) But you only need a custom setgeoms () function for multiscreen setups anyway. Johannes diff --git a/config.anselm.h b/config.anselm.h --- a/config.anselm.h +++ b/config.anselm.h @@ -37,40 +37,34 @@ setanselmgeoms(void) { setanselmgeoms(void) { /* screen dimensions */ - sx = 0; - sy = 0; - sw = DisplayWidth(dpy, screen); - sh = DisplayHeight(dpy, screen); + scr.x = 0; + scr.y = 0; + scr.w = DisplayWidth(dpy, screen); + scr.h = DisplayHeight(dpy, screen); /* bar position */ - bx = sx; - by = sy; - bw = 1280; - bh = dc.font.height + 2; + bar = scr; + bar.w = 1280; + bar.h = dc.font.height + 2; /* window area */ - wx = sx; - wy = sy + bh; - ww = sw; - wh = sh - bh; + win = scr; + win.y += bar.h; + win.h -= bar.h; /* master area */ - mx = wx; - my = wy; - mw = 1280; - mh = 800 - bh; + mas = win; + mas.w = 1280; + mas.h = 800 - bar.h; /* tile area */ - tx = 1280; - ty = 0; - tw = sw - 1280; - th = sh; + til.x = 1280; + til.y = 0; + til.w = scr.w - 1280; + til.h = scr.h; /* monocle area */ - mox = mx; - moy = my; - mow = mw; - moh = mh; + mon = mas; } void diff --git a/dwm.c b/dwm.c --- a/dwm.c +++ b/dwm.c @@ -69,6 +69,10 @@ struct Client { Client *snext; Window win; }; + +typedef struct { + int x, y, w, h; +} Rectangle; typedef struct { int x, y, w, h; @@ -193,9 +197,10 @@ void zoom(const char *arg); /* variables */ char stext[256], buf[256]; -int screen, sx, sy, sw, sh; +int screen; int (*xerrorxlib)(Display *, XErrorEvent *); -int bx, by, bw, bh, blw, mx, my, mw, mh, mox, moy, mow, moh, tx, ty, tw, th, wx, wy, ww, wh; +int blw; +Rectangle scr, bar, win, mas, til, mon; unsigned int numlockmask = 0; void (*handler[LASTEvent]) (XEvent *) = { [ButtonPress] = buttonpress, @@ -296,7 +301,7 @@ ban(Client *c) { ban(Client *c) { if(c->isbanned) return; - XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); + XMoveWindow(dpy, c->win, c->x + 2 * scr.w, c->y); c->isbanned = True; } @@ -408,7 +413,7 @@ configurenotify(XEvent *e) { configurenotify(XEvent *e) { XConfigureEvent *ev = &e->xconfigure; - if(ev->window == root && (ev->width != sw || ev->height != sh)) { + if(ev->window == root && (ev->width != scr.w || ev->height != scr.h)) { setgeoms(); updatebarpos(); arrange(); @@ -426,17 +431,17 @@ configurerequest(XEvent *e) { c->border = ev->border_width; if(c->isfixed || c->isfloating || lt->isfloating) { if(ev->value_mask & CWX) - c->x = sx + ev->x; + c->x = scr.x + ev->x; if(ev->value_mask & CWY) - c->y = sy + ev->y; + c->y = scr.y + ev->y; if(ev->value_mask & CWWidth) c->w = ev->width; if(ev->value_mask & CWHeight) c->h = ev->height; - if((c->x - sx + c->w) > sw && c->isfloating) - c->x = sx + (sw / 2 - c->w / 2); /* center in x direction */ - if((c->y - sy + c->h) > sh && c->isfloating) - c->y = sy + (sh / 2 - c->h / 2); /* center in y direction */ + if((c->x - scr.x + c->w) > scr.w && c->isfloating) + c->x = scr.x + (scr.w / 2 - c->w / 2); /* center in x direction */ + if((c->y - scr.y + c->h) > scr.h && c->isfloating) + c->y = scr.y + (scr.h / 2 - c->h / 2); /* center in y direction */ if((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight))) configure(c); @@ -519,13 +524,13 @@ drawbar(void) { drawtext(lt->symbol, dc.norm, False); x = dc.x + dc.w; dc.w = textw(stext); - dc.x = b
Re: [dwm] new setgeom in hg tip
On Sat, Mar 15, 2008 at 5:30 PM, Johannes Hofmann <[EMAIL PROTECTED]> wrote: > Huh? That's a config parser in dwm! Luckily I'd say, since otherwise we'd seem to be stuck hardcoding values for screen sizes as 24-line functions for each set of geoms. This config parser isn't really much different from the regexes that were used in config.h for matching windows, nor is it difficult to understand, so I have no objections. Brendan
Re: [dwm] new setgeom in hg tip
Hi, first of all thanks a lot for dmw! Works great for me. On Sat, Mar 15, 2008 at 03:59:35PM +0100, Anselm R. Garbe wrote: > Hi there, > > I thought about all those feedback mails so far and implemented > a new setgeom function which expects a certain input syntax. I'm > not confident yet if this approach will stay, but what do you > think about it? Huh? That's a config parser in dwm! I'd prefer to stay with plain C to configure dwm. It has a well known syntax and is parsed at compile time. Cheers, Johannes
Re: [dwm] Different window modes on different workspaces
On Sat, Mar 15, 2008 at 10:01:43AM +0100, Sander van Dijk wrote: > On Sat, Mar 15, 2008 at 4:50 AM, Jonny Gerold <[EMAIL PROTECTED]> wrote: > > Hello, > > I have a very simple question. I just upgraded to 4.8. And I would like > > to know if there is a simple way to assign one workspace to be say tiled > > mode, and another to be float mode. I would like to use tiling on some > > of my workspaces, but am always pissed when I move to another desktop > > with a float that gets moved out of place. > > Thanks, Jonny > > There are no different desktops/workspaces, there is only one. > Applying one or more tags to a window, and selecting one or more tags > for viewing influences what is displayed on that _single_ workspace > (to which the currently selected layout always applies). > I suggest you search the archives, the differences between tags and > workspaces have been discussed many, many times before (basically, as > long as you never select more than one tag for viewing, tags can be > (ab)used as workspaces, but when you select multiple tags for viewing > it becomes obvious that things like 'layout per workspace' have no > meaning in the tagging paradigm). > Also, should you come to the conclusion that the workspaces paradigm > fits you better than the tags paradigm, xmonad (xmonad.org) might be > worth looking at. > > Greetings, Sander. another 2c: afaics the `tags' vs. `workspaces' dispute is essentially a matter of terminology. simply two different words for more or less the same thing, namely being able to view subgroups of all existing windows while hiding all the others. that not all (but anyway some) window managers calling their subgroups-of-visible-windows "workspaces" or "desktops" allow simultaneous visibility of a window on more than one workspace seems the main difference to `dwm'. if you use (not abuse!) the one-window-one-tag approach their is _no_ difference to the usual workspace paradigm, not from the user perspective. there sure is no reason which would prevent coupling the layout to the tags ('layout per tag'). apart from the ability to look at several tags at the same time, that is. this 'tag merging' of course is only sensible if one has a common layout for all tags... but that could be handled by allowing it only if all layouts of all affected tags are currently equal. even if a window has more than one tag this could be done. how much overhead the additional bookkeeping would produce is a question for anselm or the guys who seem to have provided patches in this direction. but coming to think of it: _if_ the layouts could be made a tag-specific thing (i.e. alowing a different layout for each tag) and if at the _same_ time the positions of a window in a floating layout could be memoized to enable restoration of the position if the layout is becoming 'floating' again, that would be really nice. I presume without remembering the 'floating position' one would not be happy if a window actually has two tags and one switches from tag one (floating) to tag two (tiling) and than again to tag one... this of course is the same problem one sees right now when switching floating to tiling and back: loss of previously manually arranged floating layout. it's not a bug, but sure it's not a feature, too... joerg
Re: [dwm] dwm 4.8
dwm 4.8 with monocle set as default is brilliant! Thanks! Best, Renick -- Renick Bell http://the3rd2nd.com
[dwm] new setgeom in hg tip
Hi there, I thought about all those feedback mails so far and implemented a new setgeom function which expects a certain input syntax. I'm not confident yet if this approach will stay, but what do you think about it? In config.h there is now the following default geometry: #define GEOMETRY"0 0 W B " \ "0 B W H-B " \ "0 B W*0.55 H-B " \ "W*0.55 B W*0.45 H-B " \ "0 B W H-B" The basic syntax consists of a string like " " where each value is separated by a space from each other. Each value can be of the form [[]+,-,*], whereas might be a number (integer or double) or one of "W", "H", "B". "W" is the screen width (DisplayWidth()), "H" is the screen height (DisplayHeight()) and "B" is the bar height. With this you can for example hide the bar with setgeom("0 H W B 0 0 W H 0 0 W*0.55 H W*0.55 0 W*0.45 H 0 0 W H"); Similiarly one can change the master/tile geometry with such a call. Kind regards, -- Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
Re: [dwm] Different window modes on different workspaces
On Sat, Mar 15, 2008 at 4:50 AM, Jonny Gerold <[EMAIL PROTECTED]> wrote: > Hello, > I have a very simple question. I just upgraded to 4.8. And I would like > to know if there is a simple way to assign one workspace to be say tiled > mode, and another to be float mode. I would like to use tiling on some > of my workspaces, but am always pissed when I move to another desktop > with a float that gets moved out of place. > Thanks, Jonny There are no different desktops/workspaces, there is only one. Applying one or more tags to a window, and selecting one or more tags for viewing influences what is displayed on that _single_ workspace (to which the currently selected layout always applies). I suggest you search the archives, the differences between tags and workspaces have been discussed many, many times before (basically, as long as you never select more than one tag for viewing, tags can be (ab)used as workspaces, but when you select multiple tags for viewing it becomes obvious that things like 'layout per workspace' have no meaning in the tagging paradigm). Also, should you come to the conclusion that the workspaces paradigm fits you better than the tags paradigm, xmonad (xmonad.org) might be worth looking at. Greetings, Sander.