--- wmii-20060511-rc4-baikal/cmd/wm/wm.h Thu May 11 01:25:23 2006 +++ mywmii-20060511-rc4-baikal/cmd/wm/wm.h Thu May 11 11:41:06 2006 @@ -54,6 +54,7 @@ FsFdata, FsFcolors, FsFfont, + FsFfocuscolors, FsFselcolors, FsFnormcolors, FsFkeys, @@ -149,9 +150,11 @@ /* default values */ typedef struct { + char focuscolor[24]; char selcolor[24]; char normcolor[24]; char *font; + BlitzColor focus; BlitzColor sel; BlitzColor norm; unsigned int border; --- wmii-20060511-rc4-baikal/cmd/wm/wm.c Thu May 11 01:25:23 2006 +++ mywmii-20060511-rc4-baikal/cmd/wm/wm.c Thu May 11 11:49:23 2006 @@ -143,7 +143,7 @@ gcv.subwindow_mode = IncludeInferiors; gcv.function = GXxor; - gcv.foreground = def.sel.bg; + gcv.foreground = def.focus.bg; gcv.plane_mask = AllPlanes; gcv.graphics_exposures = False; xorgc = XCreateGC(dpy, root, GCForeground | GCGraphicsExposures @@ -302,7 +302,9 @@ def.border = 2; def.colmode = Coldefault; def.colw = 0; - cext_strlcpy(def.selcolor, BLITZ_SELCOLORS, sizeof(def.selcolor)); + cext_strlcpy(def.focuscolor, BLITZ_SELCOLORS, sizeof(def.focuscolor)); + blitz_loadcolor(dpy, &def.focus, screen, def.focuscolor); + cext_strlcpy(def.selcolor, BLITZ_NORMCOLORS, sizeof(def.selcolor)); blitz_loadcolor(dpy, &def.sel, screen, def.selcolor); cext_strlcpy(def.normcolor, BLITZ_NORMCOLORS, sizeof(def.normcolor)); blitz_loadcolor(dpy, &def.norm, screen, def.normcolor); --- wmii-20060511-rc4-baikal/cmd/wm/fs.c Thu May 11 01:25:23 2006 +++ mywmii-20060511-rc4-baikal/cmd/wm/fs.c Thu May 11 11:38:29 2006 @@ -35,6 +35,7 @@ * /def/ FsDdef * /def/border FsFborder 0..n * /def/font FsFfont xlib font name + * /def/focuscolors FsFfocuscolors focused colors * /def/selcolors FsFselcolors selected colors * /def/normcolors FsFnormcolors normal colors * /def/rules FsFrules rules @@ -195,6 +196,7 @@ snprintf(buf, sizeof(buf), "%u", i3); return buf; break; + case FsFfocuscolors: return "focuscolors"; break; case FsFselcolors: return "selcolors"; break; case FsFnormcolors: return "normcolors"; break; case FsFfont: return "font"; break; @@ -296,6 +298,8 @@ return FsFgeom; if(!strncmp(name, "colors", 7)) return FsFcolors; + if(!strncmp(name, "focuscolors", 10)) + return FsFfocuscolors; if(!strncmp(name, "selcolors", 10)) return FsFselcolors; if(!strncmp(name, "normcolors", 11)) @@ -456,6 +460,7 @@ case FsFfont: case FsFcolw: case FsFrules: + case FsFfocuscolors: case FsFselcolors: case FsFnormcolors: case FsFkeys: @@ -608,6 +613,7 @@ } break; case FsFcolors: + case FsFfocuscolors: case FsFselcolors: case FsFnormcolors: return pack_stat(stat, wqid, qsel, name, 23, IXP_DMREAD | IXP_DMWRITE); @@ -1035,6 +1041,8 @@ case FsDdef: fcall->count = stat_of_name(&stat, "border", m->wqid, m->sel); p = ixp_pack_stat(p, &stat); + fcall->count += stat_of_name(&stat, "focuscolors", m->wqid, m->sel); + p = ixp_pack_stat(p, &stat); fcall->count += stat_of_name(&stat, "selcolors", m->wqid, m->sel); p = ixp_pack_stat(p, &stat); fcall->count += stat_of_name(&stat, "normcolors", m->wqid, m->sel); @@ -1204,6 +1212,10 @@ if((fcall->count = strlen(bar.data[i1]->colstr))) memcpy(p, bar.data[i1]->colstr, fcall->count); break; + case FsFfocuscolors: + if((fcall->count = strlen(def.focuscolor))) + memcpy(p, def.focuscolor, fcall->count); + break; case FsFselcolors: if((fcall->count = strlen(def.selcolor))) memcpy(p, def.selcolor, fcall->count); @@ -1406,6 +1418,15 @@ blitz_loadcolor(dpy, &bar.data[i1]->color, screen, bar.data[i1]->colstr); draw_bar(); break; + case FsFfocuscolors: + if((fcall->count != 23) || (fcall->data[0] != '#') + || (fcall->data[8] != '#') || (fcall->data[16] != '#')) + return Ebadvalue; + memcpy(def.focuscolor, fcall->data, fcall->count); + def.focuscolor[fcall->count] = 0; + blitz_loadcolor(dpy, &def.focus, screen, def.focuscolor); + draw_clients(); + break; case FsFselcolors: if((fcall->count != 23) || (fcall->data[0] != '#') || (fcall->data[8] != '#') || (fcall->data[16] != '#')) --- wmii-20060511-rc4-baikal/cmd/wm/bar.c Thu May 11 01:25:23 2006 +++ mywmii-20060511-rc4-baikal/cmd/wm/bar.c Thu May 11 11:30:53 2006 @@ -46,8 +46,8 @@ b->id = id++; b->intern = intern; cext_strlcpy(b->name, name, sizeof(b->name)); - cext_strlcpy(b->colstr, def.selcolor, sizeof(b->colstr)); - b->color = def.sel; + cext_strlcpy(b->colstr, def.focuscolor, sizeof(b->colstr)); + b->color = def.focus; cext_vattach(vector_of_bars(&bar), b); qsort(bar.data, bar.size, sizeof(Bar *), comp_bar_name); qsort(bar.data, bar.size, sizeof(Bar *), comp_bar_intern); @@ -120,7 +120,7 @@ b = bar.data[i]; if(b->intern) { if(view.size && !strncmp(b->name, view.data[sel]->name, sizeof(b->name))) - b->color = def.sel; + b->color = def.focus; else b->color = def.norm; } --- wmii-20060511-rc4-baikal/cmd/wm/client.c Thu May 11 01:25:23 2006 +++ mywmii-20060511-rc4-baikal/cmd/wm/client.c Thu May 11 11:34:29 2006 @@ -271,9 +271,12 @@ d.gc = c->gc; if(c == sel_client()) - d.color = def.sel; + d.color = def.focus; else - d.color = def.norm; + if(f->area->sel == fidx) + d.color = def.sel; + else + d.color = def.norm; /* draw border */ if(def.border) { @@ -299,19 +302,10 @@ d.rect.x = f->rect.width - d.rect.width; d.data = buf; - if(f->area->sel == fidx) - d.color = def.sel; - else - d.color = def.norm; blitz_drawlabel(dpy, &d); blitz_drawborder(dpy, &d); d.rect.x = 0; - if(c == sel_client()) - d.color = def.sel; - else - d.color = def.norm; - /* tag bar */ d.rect.width = d.rect.height + blitz_textwidth(dpy, &blitzfont, c->tags); if(d.rect.width + w > f->rect.width) --- wmii-20060511-rc4-baikal/cmd/wmiimenu.c Thu May 11 01:25:23 2006 +++ mywmii-20060511-rc4-baikal/cmd/wmiimenu.c Thu May 11 11:24:27 2006 @@ -354,11 +354,11 @@ if (!fontstr) fontstr = strdup(BLITZ_FONT); blitz_loadfont(dpy, &draw.font, fontstr); - normcolstr = getenv("WMII_NORMCOLORS"); + normcolstr = getenv("WMII_MENU_NORMCOLORS"); if (!normcolstr || strlen(normcolstr) != 23) normcolstr = strdup(BLITZ_NORMCOLORS); blitz_loadcolor(dpy, &normcolor, screen, normcolstr); - selcolstr = getenv("WMII_SELCOLORS"); + selcolstr = getenv("WMII_MENU_SELCOLORS"); if (!selcolstr || strlen(selcolstr) != 23) selcolstr = strdup(BLITZ_SELCOLORS); blitz_loadcolor(dpy, &selcolor, screen, selcolstr); --- wmii-20060511-rc4-baikal/rc/wmiirc Thu May 11 01:25:23 2006 +++ mywmii-20060511-rc4-baikal/rc/wmiirc Thu May 11 11:56:06 2006 @@ -10,6 +10,13 @@ ls -lL "$@" 2>/dev/null | awk 'NF>2 && $1 ~ /^[^d].*x/ {print $NF}' | sort -u } +# give wmiiwm a chance to start +while : +do + echo Start wmiirc | wmiir write /event >/dev/null 2>&1 && break + sleep 1 +done + MODKEY=Mod1 UP=k DOWN=j @@ -17,23 +24,19 @@ RIGHT=l WMII_FONT='fixed' -WMII_SELCOLORS='#ffffff #285577 #4c7899' -WMII_NORMCOLORS='#222222 #eeeeee #666666' +WMII_NORMCOLORS='#000000 #888888 #888888' +WMII_FOCUSCOLORS='#ffffff #bb0000 #bb0000' +WMII_SELCOLORS='#000000 #dd7700 #dd7700' # dark background #WMII_NORMCOLORS='#e0e0e0 #0a0a0a #202020' +WMII_MENU_NORMCOLORS=$WMII_NORMCOLORS +WMII_MENU_SELCOLORS=$WMII_FOCUSCOLORS +export WMII_FONT WMII_NORMCOLORS WMII_FOCUSCOLORS WMII_SELCOLORS WMII_MENU_NORMCOLORS WMII_MENU_SELCOLORS -export WMII_FONT WMII_NORMCOLORS WMII_SELCOLORS - -# give wmiiwm a chance to start -while : -do - echo Start wmiirc | wmiir write /event >/dev/null 2>&1 && break - sleep 1 -done - # WM CONFIGURATION xwrite /def/border 2 xwrite /def/font $WMII_FONT +xwrite /def/focuscolors $WMII_FOCUSCOLORS xwrite /def/selcolors $WMII_SELCOLORS xwrite /def/normcolors $WMII_NORMCOLORS xwrite /def/colmode default