chore: update c, h, o files
This commit is contained in:
parent
52444dd9ef
commit
a30de28020
BIN
build/config.o
BIN
build/config.o
Binary file not shown.
@ -67,6 +67,20 @@ struct Config {
|
||||
int demo_step_delay_ms;
|
||||
int demo_ai_timeout_ms;
|
||||
int demo_window_timeout_ms;
|
||||
|
||||
char color_panel_bg[16];
|
||||
char color_panel_fg[16];
|
||||
char color_workspace_active[16];
|
||||
char color_workspace_inactive[16];
|
||||
char color_workspace_urgent[16];
|
||||
char color_title_focused_bg[16];
|
||||
char color_title_focused_fg[16];
|
||||
char color_title_unfocused_bg[16];
|
||||
char color_title_unfocused_fg[16];
|
||||
char color_border_focused[16];
|
||||
char color_border_unfocused[16];
|
||||
char color_notification_bg[16];
|
||||
char color_notification_fg[16];
|
||||
};
|
||||
|
||||
Config *config_create(void);
|
||||
|
||||
68
src/config.c
68
src/config.c
@ -96,6 +96,20 @@ void config_set_defaults(Config *cfg)
|
||||
cfg->demo_step_delay_ms = 4000;
|
||||
cfg->demo_ai_timeout_ms = 15000;
|
||||
cfg->demo_window_timeout_ms = 5000;
|
||||
|
||||
strncpy(cfg->color_panel_bg, DEFAULT_PANEL_BG, sizeof(cfg->color_panel_bg) - 1);
|
||||
strncpy(cfg->color_panel_fg, DEFAULT_PANEL_FG, sizeof(cfg->color_panel_fg) - 1);
|
||||
strncpy(cfg->color_workspace_active, DEFAULT_WS_ACTIVE, sizeof(cfg->color_workspace_active) - 1);
|
||||
strncpy(cfg->color_workspace_inactive, DEFAULT_WS_INACTIVE, sizeof(cfg->color_workspace_inactive) - 1);
|
||||
strncpy(cfg->color_workspace_urgent, DEFAULT_WS_URGENT, sizeof(cfg->color_workspace_urgent) - 1);
|
||||
strncpy(cfg->color_title_focused_bg, DEFAULT_TITLE_FOCUSED_BG, sizeof(cfg->color_title_focused_bg) - 1);
|
||||
strncpy(cfg->color_title_focused_fg, DEFAULT_TITLE_FOCUSED_FG, sizeof(cfg->color_title_focused_fg) - 1);
|
||||
strncpy(cfg->color_title_unfocused_bg, DEFAULT_TITLE_UNFOCUSED_BG, sizeof(cfg->color_title_unfocused_bg) - 1);
|
||||
strncpy(cfg->color_title_unfocused_fg, DEFAULT_TITLE_UNFOCUSED_FG, sizeof(cfg->color_title_unfocused_fg) - 1);
|
||||
strncpy(cfg->color_border_focused, DEFAULT_BORDER_FOCUSED, sizeof(cfg->color_border_focused) - 1);
|
||||
strncpy(cfg->color_border_unfocused, DEFAULT_BORDER_UNFOCUSED, sizeof(cfg->color_border_unfocused) - 1);
|
||||
strncpy(cfg->color_notification_bg, DEFAULT_NOTIFICATION_BG, sizeof(cfg->color_notification_bg) - 1);
|
||||
strncpy(cfg->color_notification_fg, DEFAULT_NOTIFICATION_FG, sizeof(cfg->color_notification_fg) - 1);
|
||||
}
|
||||
|
||||
|
||||
@ -213,6 +227,34 @@ static void handle_config_entry(const char *section, const char *key,
|
||||
int val = atoi(value);
|
||||
cfg->demo_window_timeout_ms = (val >= 1000 && val <= 30000) ? val : 5000;
|
||||
}
|
||||
} else if (strcmp(section, "colors") == 0) {
|
||||
if (strcmp(key, "panel_bg") == 0) {
|
||||
strncpy(cfg->color_panel_bg, value, sizeof(cfg->color_panel_bg) - 1);
|
||||
} else if (strcmp(key, "panel_fg") == 0) {
|
||||
strncpy(cfg->color_panel_fg, value, sizeof(cfg->color_panel_fg) - 1);
|
||||
} else if (strcmp(key, "workspace_active") == 0) {
|
||||
strncpy(cfg->color_workspace_active, value, sizeof(cfg->color_workspace_active) - 1);
|
||||
} else if (strcmp(key, "workspace_inactive") == 0) {
|
||||
strncpy(cfg->color_workspace_inactive, value, sizeof(cfg->color_workspace_inactive) - 1);
|
||||
} else if (strcmp(key, "workspace_urgent") == 0) {
|
||||
strncpy(cfg->color_workspace_urgent, value, sizeof(cfg->color_workspace_urgent) - 1);
|
||||
} else if (strcmp(key, "title_focused_bg") == 0) {
|
||||
strncpy(cfg->color_title_focused_bg, value, sizeof(cfg->color_title_focused_bg) - 1);
|
||||
} else if (strcmp(key, "title_focused_fg") == 0) {
|
||||
strncpy(cfg->color_title_focused_fg, value, sizeof(cfg->color_title_focused_fg) - 1);
|
||||
} else if (strcmp(key, "title_unfocused_bg") == 0) {
|
||||
strncpy(cfg->color_title_unfocused_bg, value, sizeof(cfg->color_title_unfocused_bg) - 1);
|
||||
} else if (strcmp(key, "title_unfocused_fg") == 0) {
|
||||
strncpy(cfg->color_title_unfocused_fg, value, sizeof(cfg->color_title_unfocused_fg) - 1);
|
||||
} else if (strcmp(key, "border_focused") == 0) {
|
||||
strncpy(cfg->color_border_focused, value, sizeof(cfg->color_border_focused) - 1);
|
||||
} else if (strcmp(key, "border_unfocused") == 0) {
|
||||
strncpy(cfg->color_border_unfocused, value, sizeof(cfg->color_border_unfocused) - 1);
|
||||
} else if (strcmp(key, "notification_bg") == 0) {
|
||||
strncpy(cfg->color_notification_bg, value, sizeof(cfg->color_notification_bg) - 1);
|
||||
} else if (strcmp(key, "notification_fg") == 0) {
|
||||
strncpy(cfg->color_notification_fg, value, sizeof(cfg->color_notification_fg) - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -384,17 +426,17 @@ void config_init_colors(Config *cfg)
|
||||
return;
|
||||
}
|
||||
|
||||
cfg->colors.panel_bg = parse_color(DEFAULT_PANEL_BG);
|
||||
cfg->colors.panel_fg = parse_color(DEFAULT_PANEL_FG);
|
||||
cfg->colors.workspace_active = parse_color(DEFAULT_WS_ACTIVE);
|
||||
cfg->colors.workspace_inactive = parse_color(DEFAULT_WS_INACTIVE);
|
||||
cfg->colors.workspace_urgent = parse_color(DEFAULT_WS_URGENT);
|
||||
cfg->colors.title_focused_bg = parse_color(DEFAULT_TITLE_FOCUSED_BG);
|
||||
cfg->colors.title_focused_fg = parse_color(DEFAULT_TITLE_FOCUSED_FG);
|
||||
cfg->colors.title_unfocused_bg = parse_color(DEFAULT_TITLE_UNFOCUSED_BG);
|
||||
cfg->colors.title_unfocused_fg = parse_color(DEFAULT_TITLE_UNFOCUSED_FG);
|
||||
cfg->colors.border_focused = parse_color(DEFAULT_BORDER_FOCUSED);
|
||||
cfg->colors.border_unfocused = parse_color(DEFAULT_BORDER_UNFOCUSED);
|
||||
cfg->colors.notification_bg = parse_color(DEFAULT_NOTIFICATION_BG);
|
||||
cfg->colors.notification_fg = parse_color(DEFAULT_NOTIFICATION_FG);
|
||||
cfg->colors.panel_bg = parse_color(cfg->color_panel_bg);
|
||||
cfg->colors.panel_fg = parse_color(cfg->color_panel_fg);
|
||||
cfg->colors.workspace_active = parse_color(cfg->color_workspace_active);
|
||||
cfg->colors.workspace_inactive = parse_color(cfg->color_workspace_inactive);
|
||||
cfg->colors.workspace_urgent = parse_color(cfg->color_workspace_urgent);
|
||||
cfg->colors.title_focused_bg = parse_color(cfg->color_title_focused_bg);
|
||||
cfg->colors.title_focused_fg = parse_color(cfg->color_title_focused_fg);
|
||||
cfg->colors.title_unfocused_bg = parse_color(cfg->color_title_unfocused_bg);
|
||||
cfg->colors.title_unfocused_fg = parse_color(cfg->color_title_unfocused_fg);
|
||||
cfg->colors.border_focused = parse_color(cfg->color_border_focused);
|
||||
cfg->colors.border_unfocused = parse_color(cfg->color_border_unfocused);
|
||||
cfg->colors.notification_bg = parse_color(cfg->color_notification_bg);
|
||||
cfg->colors.notification_fg = parse_color(cfg->color_notification_fg);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user