implement layout replacement values

This commit is contained in:
sewn 2024-09-22 18:11:42 +03:00
parent a243616990
commit a052b3cdc9
No known key found for this signature in database
2 changed files with 14 additions and 0 deletions

View file

@ -11,6 +11,15 @@ static uint32_t colors[][3] = {
/* tagging */
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 - top", "[^]" },
{ "rivertile - bottom", "[_]" },
};
static const char *termcmd[] = { "foot", NULL };
/* button definitions */

5
dam.c
View file

@ -401,10 +401,15 @@ static void
output_status_handle_layout_name(void *data,
struct zriver_output_status_v1 *output_status, const char *name)
{
int i;
Bar *bar = data;
if (bar->layout)
free(bar->layout);
for (i = 0; i < LENGTH(layouts); i++)
if (!strcmp(name, layouts[i][0]))
name = layouts[i][1];
bar->layout = strdup(name);
bar_draw(bar);