summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@gmail.com>2007-09-15 20:39:31 +0200
committerAnselm R. Garbe <garbeam@gmail.com>2007-09-15 20:39:31 +0200
commit2091200c957783deed032380d56c4199a23c6b81 (patch)
treedc878b437a2ebbe9cfbe79eced7dc50ae8f4fc55
parentmoved bar-related stuff to bar.c (merged draw.c into that) (diff)
downloaddwm-2091200c957783deed032380d56c4199a23c6b81.tar.gz
dwm-2091200c957783deed032380d56c4199a23c6b81.zip
new colorscheme (16-bit compliant)
-rw-r--r--bar.c13
-rw-r--r--config.h14
-rw-r--r--dwm.h1
-rw-r--r--main.c1
4 files changed, 14 insertions, 15 deletions
diff --git a/bar.c b/bar.c
index 9e3c386..91689cf 100644
--- a/bar.c
+++ b/bar.c
@@ -69,7 +69,8 @@ initfont(const char *fontstr) {
69 if(dc.font.xfont) 69 if(dc.font.xfont)
70 XFreeFont(dpy, dc.font.xfont); 70 XFreeFont(dpy, dc.font.xfont);
71 dc.font.xfont = NULL; 71 dc.font.xfont = NULL;
72 if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))) 72 if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))
73 || !(dc.font.xfont = XLoadQueryFont(dpy, "fixed")))
73 eprint("error, cannot load font: '%s'\n", fontstr); 74 eprint("error, cannot load font: '%s'\n", fontstr);
74 dc.font.ascent = dc.font.xfont->ascent; 75 dc.font.ascent = dc.font.xfont->ascent;
75 dc.font.descent = dc.font.xfont->descent; 76 dc.font.descent = dc.font.xfont->descent;
@@ -186,9 +187,7 @@ drawbar(void) {
186} 187}
187 188
188void 189void
189initbar(void) { 190initstyle(void) {
190 XSetWindowAttributes wa;
191
192 dc.norm[ColBorder] = initcolor(NORMBORDERCOLOR); 191 dc.norm[ColBorder] = initcolor(NORMBORDERCOLOR);
193 dc.norm[ColBG] = initcolor(NORMBGCOLOR); 192 dc.norm[ColBG] = initcolor(NORMBGCOLOR);
194 dc.norm[ColFG] = initcolor(NORMFGCOLOR); 193 dc.norm[ColFG] = initcolor(NORMFGCOLOR);
@@ -197,6 +196,12 @@ initbar(void) {
197 dc.sel[ColFG] = initcolor(SELFGCOLOR); 196 dc.sel[ColFG] = initcolor(SELFGCOLOR);
198 initfont(FONT); 197 initfont(FONT);
199 dc.h = bh = dc.font.height + 2; 198 dc.h = bh = dc.font.height + 2;
199}
200
201void
202initbar(void) {
203 XSetWindowAttributes wa;
204
200 wa.override_redirect = 1; 205 wa.override_redirect = 1;
201 wa.background_pixmap = ParentRelative; 206 wa.background_pixmap = ParentRelative;
202 wa.event_mask = ButtonPressMask | ExposureMask; 207 wa.event_mask = ButtonPressMask | ExposureMask;
diff --git a/config.h b/config.h
index cf24e67..f946407 100644
--- a/config.h
+++ b/config.h
@@ -4,19 +4,11 @@
4#define BARPOS BarTop /* BarBot, BarOff */ 4#define BARPOS BarTop /* BarBot, BarOff */
5#define BORDERPX 1 5#define BORDERPX 1
6#define FONT "-*-terminus-medium-r-*-*-12-*-*-*-*-*-iso10646-*" 6#define FONT "-*-terminus-medium-r-*-*-12-*-*-*-*-*-iso10646-*"
7#define DARK /* LIGHT */ 7#define NORMBORDERCOLOR "#333"
8#ifdef DARK
9#define NORMBORDERCOLOR "#222"
10#define NORMBGCOLOR "#000" 8#define NORMBGCOLOR "#000"
11#define NORMFGCOLOR "#ddd" 9#define NORMFGCOLOR "#ccc"
12#define SELBORDERCOLOR "#09f"
13#else
14#define NORMBORDERCOLOR "#666"
15#define NORMBGCOLOR "#eee"
16#define NORMFGCOLOR "#222"
17#define SELBORDERCOLOR "#f00" 10#define SELBORDERCOLOR "#f00"
18#endif 11#define SELBGCOLOR "#00f"
19#define SELBGCOLOR "#369"
20#define SELFGCOLOR "#fff" 12#define SELFGCOLOR "#fff"
21 13
22/* tagging */ 14/* tagging */
diff --git a/dwm.h b/dwm.h
index 6ab6bc3..8c9a141 100644
--- a/dwm.h
+++ b/dwm.h
@@ -91,6 +91,7 @@ extern Window root, barwin;
91/* bar.c */ 91/* bar.c */
92void drawbar(void); /* draw the bar */ 92void drawbar(void); /* draw the bar */
93void initbar(void); /* initializes the bar */ 93void initbar(void); /* initializes the bar */
94void initstyle(void); /* initializes colors and font */
94unsigned int textw(const char *text); /* return the width of text in px*/ 95unsigned int textw(const char *text); /* return the width of text in px*/
95void togglebar(const char *arg); /* shows/hides the bar */ 96void togglebar(const char *arg); /* shows/hides the bar */
96void updatebarpos(void); /* updates the bar position */ 97void updatebarpos(void); /* updates the bar position */
diff --git a/main.c b/main.c
index de38cbc..1e1ad4c 100644
--- a/main.c
+++ b/main.c
@@ -148,6 +148,7 @@ setup(void) {
148 sx = sy = 0; 148 sx = sy = 0;
149 sw = DisplayWidth(dpy, screen); 149 sw = DisplayWidth(dpy, screen);
150 sh = DisplayHeight(dpy, screen); 150 sh = DisplayHeight(dpy, screen);
151 initstyle();
151 initlayouts(); 152 initlayouts();
152 initbar(); 153 initbar();
153 /* multihead support */ 154 /* multihead support */