diff --git a/config.c b/config.c index 2ccd6ce..4a92ac4 100644 --- a/config.c +++ b/config.c @@ -180,6 +180,7 @@ init_conf(void) CFG_STR("bar_fg", "#6289A1", CFGF_NONE), CFG_STR("tag_sel_fg", "#FFFFFF", CFGF_NONE), CFG_STR("tag_sel_bg", "#354B5C", CFGF_NONE), + CFG_STR("tag_separation", "#090909", CFGF_NONE), CFG_STR("layout_fg", "#FFFFFF", CFGF_NONE), CFG_STR("layout_bg", "#292929", CFGF_NONE), CFG_STR("titlebar_text_focus", "#FFFFFF", CFGF_NONE), @@ -355,6 +356,7 @@ init_conf(void) conf.colors.text = getcolor(var_to_str(cfg_getstr(cfg_colors, "bar_fg"))); conf.colors.tagselfg = getcolor(var_to_str(cfg_getstr(cfg_colors, "tag_sel_fg"))); conf.colors.tagselbg = getcolor(var_to_str(cfg_getstr(cfg_colors, "tag_sel_bg"))); + conf.colors.tagsep = getcolor(var_to_str(cfg_getstr(cfg_colors, "tag_separation"))); conf.colors.layout_fg = getcolor(var_to_str(cfg_getstr(cfg_colors, "layout_fg"))); conf.colors.layout_bg = getcolor(var_to_str(cfg_getstr(cfg_colors, "layout_bg"))); conf.colors.ttbar_text_focus = getcolor(var_to_str(cfg_getstr(cfg_colors, "titlebar_text_focus"))); @@ -404,16 +406,17 @@ init_conf(void) fprintf(stderr, "WMFS Configuration: Too much or no tag" " (%d) in the configration file\n", conf.ntag); conf.ntag = 1; - conf.tag[0].name = strdup("WMFS"); - conf.tag[0].mwfact = 0.65; - conf.tag[0].nmaster = 1; - conf.tag[0].layout = layout_name_to_struct(conf.layout, "tile"); + conf.tag[0].name = strdup("WMFS"); + conf.tag[0].mwfact = 0.65; + conf.tag[0].nmaster = 1; + conf.tag[0].resizehint = False; + conf.tag[0].layout = layout_name_to_struct(conf.layout, "tile"); } else { for(i = 0; i < conf.ntag; ++i) { - cfgtmp = cfg_getnsec(cfg_tags, "tag", i); + cfgtmp = cfg_getnsec(cfg_tags, "tag", i); conf.tag[i].name = strdup(cfg_getstr(cfgtmp, "name")); conf.tag[i].mwfact = cfg_getfloat(cfgtmp, "mwfact"); conf.tag[i].nmaster = cfg_getint(cfgtmp, "nmaster"); diff --git a/wmfs.c b/wmfs.c index de5051b..d0b721f 100644 --- a/wmfs.c +++ b/wmfs.c @@ -939,12 +939,13 @@ updateall(void) void updatebar(void) { - int i , k, sp = 3; + int i , k, sp = 6; char buf[conf.ntag][256]; char p[4]; XSetForeground(dpy, gc, conf.colors.bar); XFillRectangle(dpy, dr, gc, 0, 0, mw, barheight); + for(i = 0; i < conf.ntag; ++i) { /* Make the tags string */ @@ -955,17 +956,22 @@ updatebar(void) /* Draw tags */ xprint(dr, taglen[i], fonth, ((i+1 == seltag) ? conf.colors.tagselfg : conf.colors.text), - ((i+1 == seltag) ? conf.colors.tagselbg : conf.colors.bar), 3, -3, buf[i]); + ((i+1 == seltag) ? conf.colors.tagselbg : conf.colors.bar), sp, -sp, buf[i]); + + /* Tags line separation */ + XSetForeground(dpy, gc, conf.colors.tagsep); + if(i > 0) + XFillRectangle(dpy, dr, gc, taglen[i]-sp, 0, 2, barheight); } /* Layout symbol */ - xprint(dr, taglen[conf.ntag] - sp/2, fonth, + xprint(dr, taglen[conf.ntag] - sp/2 - 1, fonth, conf.colors.layout_fg, conf.colors.layout_bg, 1, 0, tags[seltag].layout.symbol); /* Draw status text */ k = TEXTW(bartext); - xprint(dr, mw-k, fonth - 1, conf.colors.text, conf.colors.bar, 0, 0, bartext); + xprint(dr, mw-k, fonth, conf.colors.text, conf.colors.bar, 0, 0, bartext); XDrawLine(dpy, dr, gc, mw-k-5, 0, mw-k-5, barheight); XCopyArea(dpy, dr, bar, gc, 0, 0, mw, barheight, 0, 0); @@ -974,7 +980,6 @@ updatebar(void) /* Update Bar Buttons */ updatebutton(True); - return; } @@ -983,11 +988,10 @@ updatebar(void) void updatebutton(Bool c) { - int i, j, p, x, pm = 0; - XSetWindowAttributes at; - int y = 3; - int h = barheight - 5; + int i, j, x, pm = 0; + int y = 3, h = barheight - 5; int fonth_l = fonth - 3; + XSetWindowAttributes at; at.override_redirect = 1; at.background_pixmap = ParentRelative; @@ -1000,19 +1004,16 @@ updatebutton(Bool c) for(i = 0; i < conf.nbutton; ++i) { - p = TEXTW(conf.barbutton[i].text); - if(!conf.barbutton[i].x) + if(!(x = conf.barbutton[i].x)) { if(i) pm += TEXTW(conf.barbutton[i-1].text); x = (!i) ? j : j + pm; } - else - x = conf.barbutton[i].x; if(!c) { - conf.barbutton[i].win = XCreateWindow(dpy, root, x, y, p, h, + conf.barbutton[i].win = XCreateWindow(dpy, root, x, y, TEXTW(conf.barbutton[i].text), h, 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &at); diff --git a/wmfs.h b/wmfs.h index 559d3f1..c7bc4b9 100644 --- a/wmfs.h +++ b/wmfs.h @@ -154,6 +154,7 @@ typedef struct uint text; uint tagselfg; uint tagselbg; + uint tagsep; uint layout_fg; uint layout_bg; uint ttbar_text_focus; diff --git a/wmfsrc b/wmfsrc index e421928..1b5fa1d 100644 --- a/wmfsrc +++ b/wmfsrc @@ -37,6 +37,7 @@ colors #Tag tag_sel_fg = "#191919" tag_sel_bg = "#7E89A2" + tag_separation = "#191919" #Layout layout_fg = "#191919"