Re: [dwm] [patch] Stack columns patch for dwm-4.4.1
I have integrated your stack columns patch into my own branch. There are some changes of keybindings and the code to fix some things that I feel anoying. The keybindings are mixed with the nmaster one which I feel quite powerful. Here's my keybindings { MODKEY|ShiftMask, XK_l, setncols, "+1" }, \ { MODKEY|ShiftMask, XK_h, setncols, "-1" }, \ { MODKEY|ShiftMask, XK_j, setnmaster, "+1" }, \ { MODKEY|ShiftMask, XK_k, setnmaster, "-1" }, \ Some tips: config.default.h: //#define NCOLS 1 /* maximum number of stacking area columns */ #define NCOLS 1 /* default number of stacking area columns */ The i<0 condition has been changed to i<1 to avoid strange situations. You can check this code here: http://news.nopcode.org/pvcroot/dwm-4.4.1-pancake.tar.gz On Sun, 9 Sep 2007 17:57:31 +0100 Chris Webb <[EMAIL PROTECTED]> wrote: > Below is a patch for the current release (4.4.1) of dwm which enables > multiple columns in the stacking area. It introduces variables nrows and > ncols with corresponding default values NROWS and NCOLS in > config.h.default, and corresponding setnrows() and setncols() for use in > keybindings. > > If nrows == ncols == 0, tile() behaves in the normal manner. When nrows > > 0, tile() creates an extra column if adding another window to the current > one would cause it to exceed nrows clients. If ncols > 0, the maximum > number of columns created cannot exceed ncols, overriding the nrows > setting. The patch also reintroduces nmaster in a similar way to the > existing nmaster patch, but allows it to be zero to simulate a grid mode. > Where there are not enough windows to fill all the columns evenly, the > extra space is used by the top-most client in the first column. > > I'd be interested in any feedback. (I use this 'extended tiling' mode > myself, and so intend to maintain the patch going forward.) > > Best wishes, > > Chris. --pancake
Re: [dwm] Updated bottom stack patch
On Sat, Sep 15, 2007 at 06:24:35PM -0400, James Turner wrote: > I've updated the bottom stack patch to work with the new "micromizied" > version of dwm. It includes my previous main patch as well, so if your > operating system doesn't support strlcpy you will need to remove that > part from the patch. Let me know if you experience any issues. > > -- > James Turner > BSD Group Consulting > http://www.bsdgroup.org Oops, forgot to attach the actual patch. -- James Turner BSD Group Consulting http://www.bsdgroup.org --- config.hSat Sep 15 18:10:36 2007 +++ config.hSat Sep 15 18:12:32 2007 @@ -26,6 +26,7 @@ static Layout layouts[] = { /* symbol function */ { "[]=",tile }, /* first entry is default */ { "><>",floating }, +{ "TTT",bstack }, }; #define RESIZEHINTSTrue/* False - respect size hints in tiled resizals */ #define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */ --- dwm.c Sat Sep 15 18:10:36 2007 +++ dwm.c Sat Sep 15 17:53:58 2007 @@ -177,6 +177,7 @@ static void tag(const char *arg); static unsigned int textnw(const char *text, unsigned int len); static unsigned int textw(const char *text); static void tile(void); +static void bstack(void); static void togglebar(const char *arg); static void togglefloating(const char *arg); static void togglemax(const char *arg); @@ -479,7 +480,7 @@ initbar(void) { XDefineCursor(dpy, barwin, cursor[CurNormal]); updatebarpos(); XMapRaised(dpy, barwin); - strcpy(stext, "dwm-"VERSION); + strlcpy(stext, "dwm-"VERSION, sizeof(stext)); dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen)); dc.gc = XCreateGC(dpy, root, 0, 0); XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); @@ -1723,7 +1724,7 @@ static void setmwfact(const char *arg) { double delta; - if(!isarrange(tile)) + if(!isarrange(tile) && !isarrange(bstack)) return; /* arg handling, manipulate mwfact */ if(arg == NULL) @@ -1780,11 +1781,48 @@ tile(void) { } } +void +bstack(void) { +unsigned int i, n, nx, ny, nw, nh, mh, tw, th; +Client *c; + +for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) +n++; + +/* window geoms */ +mh = (n > 1) ? (wah * mwfact) / 1 : wah / (n > 0 ? n : 1); +th = (n > 1) ? (wah * (1 - mwfact)) / 1 : 0; +tw = (n > 1) ? waw / (n - 1) : 0; + +for(i = 0, c = nexttiled(clients); c; c = nexttiled(c->next), i++) { +c->ismax = False; +nx = wax; +ny = way; +if(i < 1) { +ny += i * mh; +nw = waw - 2 * c->border; +nh = mh - 2 * c->border; +} +else { +nx += (i - 1) * tw; +ny += mh * 1; +if(i + 1 == n) { /* remainder */ +nw = (wax + waw) - nx - 2 * c->border; +} +else { +nw = tw - 2 * c->border; +} +nh = th - 2 * c->border + 1; +} +resize(c, nx, ny, nw, nh, RESIZEHINTS); +} +} + static void zoom(const char *arg) { Client *c; - if(!sel || !isarrange(tile) || sel->isfloating) + if(!sel || (!isarrange(tile) && !isarrange(bstack)) || sel->isfloating) return; if((c = sel) == nexttiled(clients)) if(!(c = nexttiled(c->next)))
[dwm] Updated bottom stack patch
I've updated the bottom stack patch to work with the new "micromizied" version of dwm. It includes my previous main patch as well, so if your operating system doesn't support strlcpy you will need to remove that part from the patch. Let me know if you experience any issues. -- James Turner BSD Group Consulting http://www.bsdgroup.org
Re: [dwm] Proper way of monitoring battery level in DWM
On Sat, Sep 15, 2007 at 11:04:15PM +0200, pancake wrote: > You will probably be using acpi instead of apm. > > Install 'powersave' or just type 'acpitool'. > > $ powersave -b > Battery: 100 % > AC is online. > > $ acpitool > Battery #1 : charged, 100.0%, -462:00:00 > AC adapter : on-line > Thermal zone 1 : ok, 63 C > > $ acpitool -b > Battery #1 : charged, 100.0%, -462:00:00 > There is another little tool just called acpi : http://grahame.angrygoats.net/acpi.shtml $ acpi Battery 1: charged, 100%
Re: [dwm] Proper way of monitoring battery level in DWM
* Amit <[EMAIL PROTECTED]> [070916 00:51]: > Hey guys, > > I've tried modifying the .xinitrc to contain the battery percentage > level from apm but I cannot seem to get it. What is the proper way to > do this? I am sure many of you have this on your status bar. Any hints > or suggestions on how to approach this issue? > > Thanks, > Amit AFAIK apm is not supported in new models of notebooks. I made a small tool for myself [1]. It shows battery charge (via acpi), cpu frequency, network interface traffic, time and load. It's linux specific. Looks like this: bat0: 100% cpu0: 800 | ppp0: [5205Kb|2215Kb] | 01:02 | 0.03 [1] http://rootshell.be/~polachok/statusd-46.tar.gz -- Alexander Polakov | http://polachok.livejournal.com Russian DWM users | http://community.livejournal.com/ru_dwm/
Re: [dwm] Proper way of monitoring battery level in DWM
You will probably be using acpi instead of apm. Install 'powersave' or just type 'acpitool'. $ powersave -b Battery: 100 % AC is online. $ acpitool Battery #1 : charged, 100.0%, -462:00:00 AC adapter : on-line Thermal zone 1 : ok, 63 C $ acpitool -b Battery #1 : charged, 100.0%, -462:00:00 --pancake On Sat, 15 Sep 2007 13:49:17 -0700 Amit <[EMAIL PROTECTED]> wrote: > Hey guys, > > I've tried modifying the .xinitrc to contain the battery percentage > level from apm but I cannot seem to get it. What is the proper way to > do this? I am sure many of you have this on your status bar. Any hints > or suggestions on how to approach this issue? > > Thanks, > Amit >
[dwm] Proper way of monitoring battery level in DWM
Hey guys, I've tried modifying the .xinitrc to contain the battery percentage level from apm but I cannot seem to get it. What is the proper way to do this? I am sure many of you have this on your status bar. Any hints or suggestions on how to approach this issue? Thanks, Amit
Re: [dwm] Mouse over tile ...
2007/9/15, Anselm R. Garbe <[EMAIL PROTECTED]>: > On Fri, Sep 14, 2007 at 11:36:41PM +0200, Damjan Vrencur wrote: > > Hi! > > > > Today I spent a few hours working under Xmonad window manager. Curiosity ... > > There was one feature I found quite useful: > > When you use mouse to move or resize a tiled client, the touched client > > becomes floating and you are free to do it. > > > > It feeled logical and very natural for me. Note that I'm not talking about > > changing tiled porportions with mouse; here I prefer keyboard. > > This functionality is included in my offscreen windows patch (http://www.suckless.org/pipermail/dwm/2007-August/003336.html). I don't know how it works in xmonad, with my patch windows are moved when they are moved more than the snap value. I also find it very useful. greets, -- - yiyus || JGL .
Re: [dwm] Strange problem with feh and latest tip
On 15/09/2007, Anselm R. Garbe <[EMAIL PROTECTED]> wrote: > Which version of feh do you use? % feh -v feh version 1.3.4 On Arch Linux. It happens in tiled and floating mode. Adding a floating rule to config.h doesn't make a difference. It's no big deal, actually, just thought it might point to a dwm bug.
[dwm] simplified config.*.h handling
I removed the config.h creation from config.default.h now. The both shipped config.h's only differed in appearance definitions I will revert the fallback to fixed font if a specific font is not installed again that those things work smoothly - since the terminus font was/is the only reason I hesitated this change for quite a long period. Regards, -- Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
Re: [dwm] Strange problem with feh and latest tip
On Fri, Sep 14, 2007 at 09:29:32PM +0200, Felix Leckow wrote: > Running feh in fullscreen mode under dwm gives me the following warning: > > "feh WARNING: Window Manager does not support MWM hints. To get a > borderless window I have to bypass your wm." > > After that the feh window appears fullscreen but doesn't seem to have > focus, it doesn't accept keyboard input. > > The problem disappears if Firefox is running or has been run once > before using feh. > > This seems to be dwm-specific, it doesn't happen under wmii. Well, dwm ignores MWM hints, because that is ICCCM compliant (and they basically define wether a window should have a border or not, meaning a parent frame or not - but in dwm there are no parent frames at all). Which version of feh do you use? I have no problem with feh wether in floating nor in tiled mode running feh -F .png I tried to reproduce with [EMAIL PROTECTED]:~$ feh -v feh version 1.3.4 Regards, -- Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
Re: [dwm] Mouse over tile ...
On Fri, Sep 14, 2007 at 11:36:41PM +0200, Damjan Vrencur wrote: > Hi! > > Today I spent a few hours working under Xmonad window manager. Curiosity ... > There was one feature I found quite useful: > When you use mouse to move or resize a tiled client, the touched client > becomes floating and you are free to do it. > > It feeled logical and very natural for me. Note that I'm not talking about > changing tiled porportions with mouse; here I prefer keyboard. > > What do others think about this? Sounds like an acceptable improvement ;) Regards, -- Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361