diff --git a/config.c b/config.c index 696a2cf..7265c67 100644 --- a/config.c +++ b/config.c @@ -117,9 +117,9 @@ init_conf(void) { CFG_STR("text", "", CFGF_NONE), CFG_STR("func", "", CFGF_NONE), - CFG_STR("cmd", NULL, CFGF_NONE), + CFG_STR("cmd", "", CFGF_NONE), CFG_INT("fg_color", 0x000000, CFGF_NONE), - CFG_INT("bg_color", 0xFFFFFF, CFGF_NONE), + CFG_INT("bg_color", 0xFFFFFF, CFGF_NONE), CFG_END() }; diff --git a/local.h b/local.h index 62ea173..213b2b4 100644 --- a/local.h +++ b/local.h @@ -76,6 +76,8 @@ typedef struct { char *cmd; int fg_color; int bg_color; + unsigned int x; + unsigned int button; } BarButton; typedef struct { @@ -160,7 +162,7 @@ void togglemax(char *cmd); void unhide(Client *c); void unmanage(Client *c); void updatebar(void); -void updatebutton(void); +void updatebutton(Bool c); void updatelayout(void); void unmapclient(Client *c); void updateall(void); diff --git a/wmfs.c b/wmfs.c index 4109b30..90aeeda 100644 --- a/wmfs.c +++ b/wmfs.c @@ -112,7 +112,8 @@ buttonpress(XEvent *event) { for(i=0; iwindow == conf.barbutton[i].win && ev->button == Button1) { - conf.barbutton[i].func(conf.barbutton[i].cmd); + if(conf.barbutton[i].func) + conf.barbutton[i].func(conf.barbutton[i].cmd); } } } @@ -510,7 +511,7 @@ init(void) { XMapRaised(dpy, bar); strncpy(bartext, "WMFS-devel", strlen("WMFS-devel")); updatebar(); - updatebutton(); + updatebutton(0); /* INIT STUFF */ XSetErrorHandler(errorhandler); @@ -1069,7 +1070,7 @@ updateall(void) { void updatebar(void) { - int i ,j, x; + int i ,j; char buf[conf.ntag][100]; char p[3]; @@ -1092,15 +1093,7 @@ updatebar(void) { XDrawString(dpy, bar, gc, taglen[i], fonth, buf[i], strlen(buf[i])); } - j = taglen[conf.ntag] + ((strlen(getlayoutsym(layout[seltag]))*fonty) + 10); - for(i=0; i