summaryrefslogtreecommitdiff
path: root/src/util/color_palette.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/color_palette.h')
-rw-r--r--src/util/color_palette.h14
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);
+ }
+}