From 7c716e0ec0f1e6048640bfba863274e0c0fcc21d Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 3 Jan 2008 16:04:16 +0100 Subject: [PATCH] add align option to focustitle --- config.c | 1 + widgets/focustitle.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index ae9413de..346a5dbc 100644 --- a/config.c +++ b/config.c @@ -543,6 +543,7 @@ config_parse(const char *confpatharg) CFG_STR((char *) "fg", (char *) NULL, CFGF_NONE), CFG_STR((char *) "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_tasklist_opts[] = diff --git a/widgets/focustitle.c b/widgets/focustitle.c index aad4aad3..9bd28eb0 100644 --- a/widgets/focustitle.c +++ b/widgets/focustitle.c @@ -33,6 +33,7 @@ extern AwesomeConf globalconf; typedef struct { + int align; XColor fg; XColor bg; } Data; @@ -54,7 +55,7 @@ focustitle_draw(Widget *widget, DrawCtx *ctx, int offset, int used) draw_text(ctx, widget->location, 0, vscreen.statusbar->width - used, vscreen.statusbar->height, - AlignLeft, + d->align, widget->font->height / 2, widget->font, sel->name, d->fg, d->bg); if(sel->isfloating) @@ -95,6 +96,8 @@ focustitle_new(Statusbar *statusbar, cfg_t *config) else d->bg = globalconf.screens[statusbar->screen].colors_selected[ColBG]; + 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);