On Sat 28-06-2008 12:25 -0700, Scytrin dai Kinthra wrote: > Since the loss of DEFGEOM, which I enjoyed in terms of the ease > of setting up the basic parameters of display logic, attaining my > favoured setup has become a little obscured. > > What would be the simplest way to define the status bar be only > half the screen width? My intent would be to use dzen for misc info > display, piping persistant information to dwm. I tend to jump to > different machines with different stups and having a particular setup > per host has become standard for me. Some have multiple displays, some > have one, some are wifi only, some are wired only, some are mixed, > etc... > > I had poked around in drawbar() this morning, seeing about possibly > removing the stdin/status section of the bar or restricting the width > of the bar and could only deduce that (int)ww determined the width > bound of the bar, and the setting of dc.x = 0; determined the origin. > Am I correct in this appraisal?
Hi Scytrin, Just today I wrote a small patch to fix the status bar to a specific width - it's attached to this email. I also liked DEFGEOM since I'm using a two screen setup. It was a nice first try to make multi screen setups enjoyable - I'm looking forward to the next attempt. Greetings. -- Jan Christoph Ebersbach But by the grace of God I am what I am. 1. Cor 15,10
diff -r 8d58433a1bc7 config.def.h
--- a/config.def.h Sat Jun 28 14:24:04 2008 +0200
+++ b/config.def.h Sat Jun 28 15:57:21 2008 +0200
@@ -10,6 +10,7 @@
static const char selfgcolor[] = "#ffffff";
static uint borderpx = 1; /* border pixel of windows */
static uint snap = 32; /* snap pixel */
+static uint barwidth = 1400;
static Bool showbar = True; /* False means no bar */
static Bool topbar = True; /* False means bottom bar */
diff -r 8d58433a1bc7 dwm.c
--- a/dwm.c Sat Jun 28 14:24:04 2008 +0200
+++ b/dwm.c Sat Jun 28 15:57:21 2008 +0200
@@ -513,10 +513,10 @@
else
x = dc.x;
dc.w = TEXTW(stext);
- dc.x = ww - dc.w;
+ dc.x = barwidth - dc.w;
if(dc.x < x) {
dc.x = x;
- dc.w = ww - x;
+ dc.w = barwidth - x;
}
drawtext(stext, dc.norm, False);
if((dc.w = dc.x - x) > bh) {
@@ -528,7 +528,7 @@
else
drawtext(NULL, dc.norm, False);
}
- XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, ww, bh, 0, 0);
+ XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, barwidth, bh, 0, 0);
XSync(dpy, False);
}
@@ -1364,7 +1364,7 @@
wa.background_pixmap = ParentRelative;
wa.event_mask = ButtonPressMask|ExposureMask;
- barwin = XCreateWindow(dpy, root, wx, by, ww, bh, 0, DefaultDepth(dpy, screen),
+ barwin = XCreateWindow(dpy, root, wx, by, barwidth, bh, 0, DefaultDepth(dpy, screen),
CopyFromParent, DefaultVisual(dpy, screen),
CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
XDefineCursor(dpy, barwin, cursor[CurNormal]);
@@ -1549,8 +1549,8 @@
updatebar(void) {
if(dc.drawable != 0)
XFreePixmap(dpy, dc.drawable);
- dc.drawable = XCreatePixmap(dpy, root, ww, bh, DefaultDepth(dpy, screen));
- XMoveResizeWindow(dpy, barwin, wx, by, ww, bh);
+ dc.drawable = XCreatePixmap(dpy, root, barwidth, bh, DefaultDepth(dpy, screen));
+ XMoveResizeWindow(dpy, barwin, wx, by, barwidth, bh);
}
void
signature.asc
Description: Digital signature
