[ALL] change basic color, Add color option for layout symbol...

This commit is contained in:
Martin Duquesnoy 2008-09-15 09:26:02 +02:00
parent 845982db81
commit bc984d9848
5 changed files with 43 additions and 38 deletions

View File

@ -150,7 +150,8 @@ init_conf(void)
CFG_INT("text", 0x6289A1, CFGF_NONE),
CFG_INT("tag_sel_fg", 0xFFFFFF, CFGF_NONE),
CFG_INT("tag_sel_bg", 0x354B5C, CFGF_NONE),
CFG_END()
CFG_INT("layout_fg", 0xFFFFFF, CFGF_NONE),
CFG_INT("layout_bg", 0x292929, CFGF_NONE), CFG_END()
};
static cfg_opt_t layouts_opts[] =
@ -277,6 +278,8 @@ init_conf(void)
conf.colors.text = cfg_getint(cfg_colors, "text");
conf.colors.tagselfg = cfg_getint(cfg_colors, "tag_sel_fg");
conf.colors.tagselbg = cfg_getint(cfg_colors, "tag_sel_bg");
conf.colors.layout_fg = cfg_getint(cfg_colors, "layout_fg");
conf.colors.layout_bg = cfg_getint(cfg_colors, "layout_bg");
/* layout */
conf.layouts.free = strdup(cfg_getstr(cfg_layouts, "free"));
@ -310,7 +313,8 @@ init_conf(void)
printf("WMFS Configuration: Unknow Function %s",cfg_getstr(cfgtmp, "func"));
return;
}
keys[j].cmd = (!strdup(strdup(cfg_getstr(cfgtmp, "cmd")))) ? NULL : strdup(strdup(cfg_getstr(cfgtmp, "cmd")));
keys[j].cmd = (!strdup(strdup(cfg_getstr(cfgtmp, "cmd"))))
? NULL : strdup(strdup(cfg_getstr(cfgtmp, "cmd")));
}
/* button */

View File

@ -97,9 +97,9 @@ buttonpress(XEvent ev)
tag("-1");
}
/* layout switch */
if(ev.xbutton.x >= taglen[conf.ntag]
if(ev.xbutton.x >= taglen[conf.ntag] - 3
&& ev.xbutton.x < taglen[conf.ntag] +
(strlen((getlayoutsym(layout[seltag])))*fonty+3))
(strlen((getlayoutsym(layout[seltag])))*fonty+3)-3)
{
if(ev.xbutton.button == Button1
|| ev.xbutton.button == Button4)

31
wmfs.c
View File

@ -566,6 +566,8 @@ manage(Window w, XWindowAttributes *wa)
c->tag = t->tag;
if(!c->free)
c->free = (rettrans == Success) || c->hint;
if(c->free)
raiseclient(c);
attach(c);
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
@ -734,12 +736,12 @@ raiseclient(Client *c)
{
if(!c)
return;
XRaiseWindow(dpy,c->win);
XRaiseWindow(dpy, c->win);
if(conf.ttbarheight)
{
XRaiseWindow(dpy,c->tbar);
XRaiseWindow(dpy,c->button);
XRaiseWindow(dpy, c->tbar);
XRaiseWindow(dpy, c->button);
}
return;
}
@ -1033,11 +1035,11 @@ unhide(Client *c)
if(!c)
return;
XMoveWindow(dpy,c->win,c->x,c->y);
XMoveWindow(dpy, c->win, c->x, c->y);
if(conf.ttbarheight)
{
XMoveWindow(dpy,c->tbar,c->x, (c->y - conf.ttbarheight));
XMoveWindow(dpy,c->button, (c->x + c->w -10), (c->y - 9));
XMoveWindow(dpy, c->tbar, c->x, (c->y - conf.ttbarheight));
XMoveWindow(dpy, c->button, (c->x + c->w -10), (c->y - 9));
}
c->hide = False;
@ -1088,7 +1090,7 @@ updatebar(void)
XClearWindow(dpy, bar);
for(i=0; i<conf.ntag; ++i)
for(i = 0; i < conf.ntag; ++i)
{
ITOA(p, clientpertag(i+1));
sprintf(buf[i], "%s<%s> ", conf.tag[i].name, (clientpertag(i+1)) ? p : "");
@ -1103,9 +1105,12 @@ updatebar(void)
}
/* Draw layout symbol */
XSetForeground(dpy, gc, conf.colors.tagselfg);
XDrawString(dpy, bar, gc, taglen[conf.ntag] + 4,
fonth-1,
XSetForeground(dpy, gc, conf.colors.layout_bg);
XFillRectangle(dpy, bar, gc, taglen[conf.ntag] - 5, 0,
(strlen(getlayoutsym(layout[seltag]))*fonty) + 1, barheight);
XSetForeground(dpy, gc, conf.colors.layout_fg);
XDrawString(dpy, bar, gc, taglen[conf.ntag] - 4,
fonth,
getlayoutsym(layout[seltag]),
strlen(getlayoutsym(layout[seltag])));
@ -1118,8 +1123,8 @@ updatebar(void)
j = strlen(bartext);
XSetForeground(dpy, gc, conf.colors.text);
XDrawString(dpy, bar, gc, mw - j * fonty, fonth-1 , bartext ,j);
XDrawLine(dpy, bar, gc, mw- j * fonty-5 , 0 , mw - j * fonty-5, barheight);
XDrawString(dpy, bar, gc, mw - j * fonty, fonth-1, bartext ,j);
XDrawLine(dpy, bar, gc, mw- j * fonty-5, 0, mw - j * fonty-5, barheight);
/* Update Bar Buttons */
updatebutton(1);
@ -1142,7 +1147,7 @@ updatebutton(Bool c)
at.background_pixmap = ParentRelative;
at.event_mask = ButtonPressMask | ExposureMask;
j = taglen[conf.ntag] + ((strlen(getlayoutsym(layout[seltag]))*fonty) + 10);
j = taglen[conf.ntag] + ((strlen(getlayoutsym(layout[seltag]))*fonty) + 2);
XSetFont(dpy, gc, font_b->fid);

2
wmfs.h
View File

@ -137,6 +137,8 @@ typedef struct
int text;
int tagselfg;
int tagselbg;
int layout_fg;
int layout_bg;
} colors;
struct
{

36
wmfsrc
View File

@ -11,19 +11,21 @@ misc
colors
{
border_normal = 0x354B5C
border_focus = 0x6286A1
bar = 0x090909
text = 0x6289A1
tag_sel_fg = 0xFFFFFF
tag_sel_bg = 0x354B5C
border_normal = 0x3F485E
border_focus = 0x7E89A2
bar = 0x191919
text = 0xD4D4D4
tag_sel_fg = 0x000000
tag_sel_bg = 0x7E89A2
layout_fg = 0x000000
layout_bg = 0x7E89A2
}
layouts
{
free = "[Free]"
tile = "[Tile]"
max = "[Max]"
free = "FREE"
tile = "TILE"
max = "MAX"
}
tags
@ -49,7 +51,7 @@ buttons
text = "[-]"
mouse { button = "Button1" func = "set_mwfact" cmd = "-0.01"}
fg_color = 0xFFFFFF
bg_color = 0x090909
bg_color = 0x191919
}
button
{
@ -62,7 +64,7 @@ buttons
text = "[+] "
mouse { button = "Button1" func = "set_mwfact" cmd = "+0.01"}
fg_color = 0xFFFFFF
bg_color = 0x090909
bg_color = 0x191919
}
# }}}
@ -72,7 +74,7 @@ buttons
text = "[-]"
mouse { button = "Button1" func = "set_nmaster" cmd = "-1"}
fg_color = 0xFFFFFF
bg_color = 0x090909
bg_color = 0x191919
}
button { text = "Nmaster" fg_color = 0xFFFFFF bg_color = 0x3E3E3E }
button
@ -80,17 +82,9 @@ buttons
text = "[+] "
mouse { button = "Button1" func = "set_nmaster" cmd = "+1"}
fg_color = 0xFFFFFF
bg_color = 0x090909
bg_color = 0x191919
}
# }}}
button
{
text = "Terminal"
mouse { button = "Button1" func = "spawn" cmd = "urxvt" }
mouse { button = "Button3" func = "spawn" cmd = "xterm" }
fg_color = 0xFFFFFF bg_color = 0x3E3E3E
}
}
keys