commit a2abb60
wf
·
2026-06-08 13:57:04 +0000 UTC
parent 7f222b0
Set some default values for config.style/module.style
2 files changed,
+10,
-1
+1,
-1
1@@ -6,7 +6,7 @@ An attempt at a module-based panel/bar for Wayland.
2 TODO
3 ----
4
5-* Add default values for config/module
6+* Handle `font` field in module
7 * Provide sample config
8
9 Dependencies
+9,
-0
1@@ -343,7 +343,12 @@ parse_config(const char *path, struct app *app) {
2 struct module m = {0};
3 memset(&m, 0, sizeof(m));
4 m.name = strdup(d.params[0]);
5+
6+ m.style.foreground = 0xDDDDDD;
7+ m.style.background = 0x121212;
8 m.style.font = strdup(app->config.style.font);
9+ m.style.border_width = 2;
10+ m.style.border_color = 0x242424;
11
12 struct scfg_block sub = d.children;
13 for (size_t j = 0; j < sub.directives_len; j++) {
14@@ -540,6 +545,10 @@ setup(struct app *app) {
15 NULL
16 );
17
18+ app->config.style.foreground = 0xDDDDDD;
19+ app->config.style.background = 0x080808;
20+ app->config.style.font = strdup("monospace:size=12");
21+
22 if (config_path[0] == '\0') {
23 char *xdg_home = getenv("XDG_CONFIG_HOME");
24 if (xdg_home != NULL) {