diff --git a/config.def.h b/config.def.h index 9cf9278..838cd7a 100644 --- a/config.def.h +++ b/config.def.h @@ -14,10 +14,11 @@ static char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; /* layout name replacement values */ static const char *layouts[][2] = { /* layout name replace */ - { "rivertile - left", "=[]" }, - { "rivertile - right", "[]=" }, + { "rivertile - left", "[]=" }, + { "rivertile - right", "=[]" }, { "rivertile - top", "[^]" }, { "rivertile - bottom", "[_]" }, + { NULL, "><>" }, /* no layout, last layout */ }; static const char *termcmd[] = { "foot", NULL }; diff --git a/dam-demo.jpg b/dam-demo.jpg index 4c28506..2700221 100644 Binary files a/dam-demo.jpg and b/dam-demo.jpg differ diff --git a/dam.c b/dam.c index c98e7c4..03e6a57 100644 --- a/dam.c +++ b/dam.c @@ -254,11 +254,10 @@ bar_draw(Bar *bar) x = drwl_text(bar->drw, x, 0, w, bar->height, bar->lrpad / 2, mode, 0); } - if (bar->layout) { - w = TEXTW(bar, bar->layout); - drwl_setscheme(bar->drw, colors[SchemeNorm]); - x = drwl_text(bar->drw, x, 0, w, bar->height, bar->lrpad / 2, bar->layout, 0); - } + bar->layout = bar->layout ? bar->layout : strdup(layouts[LENGTH(layouts)-1][1]); + w = TEXTW(bar, bar->layout); + drwl_setscheme(bar->drw, colors[SchemeNorm]); + x = drwl_text(bar->drw, x, 0, w, bar->height, bar->lrpad / 2, bar->layout, 0); if ((w = bar->width - tw - x) > bar->height) { if (bar->title) { @@ -354,7 +353,7 @@ output_status_handle_layout_name(void *data, if (bar->layout) free(bar->layout); for (i = 0; i < LENGTH(layouts); i++) - if (!strcmp(name, layouts[i][0])) + if (layouts[i][0] && !strcmp(name, layouts[i][0])) name = layouts[i][1]; bar->layout = strdup(name); bar_frame(bar);