aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEduardo Pedroni <e.pedroni91@gmail.com>2015-03-27 22:52:27 -0300
committerEduardo Pedroni <e.pedroni91@gmail.com>2015-03-27 22:52:27 -0300
commitbf8ae57f6a4d96ccd92125b80be55fd203498320 (patch)
tree4ba077e9620499ea29c2b253ce0af2bfd15055f2
parent48b7a7fca0ab766b89adb6730d89b73a654cf5ad (diff)
Tidied up, added boolean for title bar
-rw-r--r--config.h2
-rwxr-xr-xdwmbin41392 -> 41136 bytes
-rw-r--r--dwm.c44
-rw-r--r--dwm.obin62184 -> 61800 bytes
4 files changed, 14 insertions, 32 deletions
diff --git a/config.h b/config.h
index b854366..ef4bd24 100644
--- a/config.h
+++ b/config.h
@@ -16,7 +16,7 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const Bool showbar = True; /* False means no bar */
static const Bool topbar = False; /* False means bottom bar */
-static const Bool statusmarkup = True; /* True means use pango markup in status message */
+static const Bool showtitle = False; /* True means titles are shown on bar */
/* Display modes of the tab bar: never shown, always shown, shown only in */
/* monocle mode in presence of several windows. */
diff --git a/dwm b/dwm
index 8b4ce34..c8be690 100755
--- a/dwm
+++ b/dwm
Binary files differ
diff --git a/dwm.c b/dwm.c
index 8dd5785..91c014f 100644
--- a/dwm.c
+++ b/dwm.c
@@ -209,8 +209,7 @@ static void focuswin(const Arg* arg);
static void focusin(XEvent *e);
static void focusmon(const Arg *arg);
static void focusstack(const Arg *arg);
-static unsigned long getcolor(const char *colstr);
-static XftColor getcolorxft(const char *colstr);
+static XftColor getcolor(const char *colstr);
static Bool getrootptr(int *x, int *y);
static long getstate(Window w);
static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
@@ -821,7 +820,7 @@ drawbar(Monitor *m) {
dc.x = 0;
for(i = 0; i < LENGTH(tags); i++) {
dc.w = TEXTW(tags[i]);
- col = (m->tagset[m->seltags] & 1 << i ? 1:(urg & 1 << i ? 2:0));
+ col = (m->tagset[m->seltags] & 1 << i ? 1:(urg & 1 << i ? 2 : 0));
drawtext(dc.drawable, tags[i], col, True);
drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i, occ & 1 << i, col);
dc.x += dc.w;
@@ -841,16 +840,16 @@ drawbar(Monitor *m) {
}
else
dc.x = m->ww;
- /*if((dc.w = dc.x - x) > bh) {
+ if((dc.w = dc.x - x) > bh) {
dc.x = x;
- if(m->sel) {
- col = m == selmon ? dc.colors[1] : dc.colors[0];
- drawtext(dc.drawable, m->sel->name, col, True); // experiment1 - no win title
+ if(m->sel && showtitle) {
+ col = m == selmon ? 1 : 0;
+ drawtext(dc.drawable, m->sel->name, col, True);
drawsquare(m->sel->isfixed, m->sel->isfloating, col);
}
- else*/
+ else
drawtext(dc.drawable, NULL, 0, False);
- //}
+ }
XCopyArea(dpy, dc.drawable, m->barwin, dc.gc, 0, 0, m->ww, bh, 0, 0);
XSync(dpy, False);
}
@@ -1024,11 +1023,7 @@ drawtext(Drawable drawable, const char *text, int col, Bool pad) {
memcpy(buf, text, len);
if(len < olen)
for(i = len; i && i > len - 3; buf[--i] = '.');
- /*XSetForeground(dpy, dc.gc, dc.colors[col][ColFG]);
- if(dc.font.set)
- XmbDrawString(dpy, drawable, dc.font.set, dc.gc, x, y, buf, len);
- else
- XDrawString(dpy, drawable, dc.gc, x, y, buf, len);*/
+
d = XftDrawCreate(dpy, dc.drawable, DefaultVisual(dpy, screen), DefaultColormap(dpy,screen));
XftDrawStringUtf8(d, &dc.xftcolors[col][ColFG], dc.font.xfont, x, y, (XftChar8 *) buf, len);
@@ -1166,18 +1161,8 @@ getatomprop(Client *c, Atom prop) {
return atom;
}
-unsigned long
-getcolor(const char *colstr) {
- Colormap cmap = DefaultColormap(dpy, screen);
- XColor color;
-
- if(!XAllocNamedColor(dpy, cmap, colstr, &color, &color))
- die("error, cannot allocate color '%s'\n", colstr);
- return color.pixel;
-}
-
XftColor
-getcolorxft(const char *colstr) {
+getcolor(const char *colstr) {
XftColor color;
if(!XftColorAllocName(dpy, DefaultVisual(dpy, screen), DefaultColormap(dpy, screen), colstr, &color))
@@ -1846,12 +1831,9 @@ setup(void) {
cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
/* init appearance */
for(int i=0; i<NUMCOLORS; i++) {
- dc.colors[i][ColBorder] = getcolor( colors[i][ColBorder] );
- dc.colors[i][ColFG] = getcolor( colors[i][ColFG] );
- dc.colors[i][ColBG] = getcolor( colors[i][ColBG] );
- dc.xftcolors[i][ColBorder] = getcolorxft( colors[i][ColBorder] );
- dc.xftcolors[i][ColFG] = getcolorxft( colors[i][ColFG] );
- dc.xftcolors[i][ColBG] = getcolorxft( colors[i][ColBG] );
+ dc.xftcolors[i][ColBorder] = getcolor( colors[i][ColBorder] );
+ dc.xftcolors[i][ColFG] = getcolor( colors[i][ColFG] );
+ dc.xftcolors[i][ColBG] = getcolor( colors[i][ColBG] );
}
dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
dc.tabdrawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), th, DefaultDepth(dpy, screen));
diff --git a/dwm.o b/dwm.o
index 5bae886..e2e6800 100644
--- a/dwm.o
+++ b/dwm.o
Binary files differ