diff options
| author | 2026-08-26 15:08:16 -0400 | |
|---|---|---|
| committer | 2026-08-26 15:08:16 -0400 | |
| commit | 6094c907b26e21f13373bae6bf3306dbae40af3c (patch) | |
| tree | 981864ddb1ab9749d3e10a81edc782311826e101 /src/util/color_palette.h | |
| parent | da9bddc70ff8544f3294b880d719c4605e87ad97 (diff) | |
| download | camu-6094c907b26e21f13373bae6bf3306dbae40af3c.tar.gz camu-6094c907b26e21f13373bae6bf3306dbae40af3c.tar.bz2 camu-6094c907b26e21f13373bae6bf3306dbae40af3c.zip | |
Update deps, small changes and cleanup
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/util/color_palette.h')
| -rw-r--r-- | src/util/color_palette.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util/color_palette.h b/src/util/color_palette.h index 7330135..b0cc9f4 100644 --- a/src/util/color_palette.h +++ b/src/util/color_palette.h @@ -2,6 +2,7 @@ #include <al/types.h> #include <al/str.h> +#include <nnwt/file.h> enum { CAMU_COLOR_BACKGROUND = 0, @@ -33,3 +34,16 @@ struct camu_color_palette { extern struct camu_color_palette global_color_palette; bool camu_colors_maybe_init(str *path); + +static inline void camu_colors_default_init() +{ + char *home_env = getenv("HOME"); + if (home_env) { + str color_palette; + al_str_from(&color_palette, home_env); + nn_path_append(&color_palette, &al_str_c(".config")); + nn_path_append(&color_palette, &al_str_c("colors.json")); + camu_colors_maybe_init(&color_palette); + al_str_free(&color_palette); + } +} |