change default layout names, add ><>

This commit is contained in:
sewn 2024-11-10 19:10:34 +03:00
parent 4074f10be6
commit cf5306d92c
No known key found for this signature in database
3 changed files with 8 additions and 8 deletions

View file

@ -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 };

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

11
dam.c
View file

@ -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);