diff --git a/config.c b/config.c index 346a5dbc..f811955f 100644 --- a/config.c +++ b/config.c @@ -554,6 +554,7 @@ config_parse(const char *confpatharg) CFG_STR((char *) "focus_fg", (char *) NULL, CFGF_NONE), CFG_STR((char *) "focus_bg", (char *) NULL, CFGF_NONE), CFG_STR((char *) "font", (char *) NULL, CFGF_NONE), + CFG_STR((char *) "align", (char *) "left", CFGF_NONE), CFG_END() }; static cfg_opt_t widget_progressbar_bar_opts[] = diff --git a/widgets/tasklist.c b/widgets/tasklist.c index 292a1629..ed977eca 100644 --- a/widgets/tasklist.c +++ b/widgets/tasklist.c @@ -34,6 +34,7 @@ extern AwesomeConf globalconf; typedef struct { + int align; XColor fg_sel; XColor bg_sel; XColor fg; @@ -74,7 +75,7 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used) draw_text(ctx, widget->location + box_width * i, 0, box_width, vscreen.statusbar->height, - AlignLeft, + d->align, widget->font->height / 2, widget->font, c->name, d->fg_sel, d->bg_sel); } @@ -82,7 +83,7 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used) draw_text(ctx, widget->location + box_width * i, 0, box_width, vscreen.statusbar->height, - AlignLeft, + d->align, widget->font->height / 2, widget->font, c->name, d->fg, d->bg); if(sel->isfloating) @@ -178,6 +179,8 @@ tasklist_new(Statusbar *statusbar, cfg_t *config) else d->fg_sel = globalconf.screens[statusbar->screen].colors_selected[ColFG]; + d->align = draw_get_align(cfg_getstr(config, "align")); + if((buf = cfg_getstr(config, "font"))) w->font = XftFontOpenName(globalconf.display, get_phys_screen(statusbar->screen), buf);