From c3ed9017385342944badec46de263560c6ab07c8 Mon Sep 17 00:00:00 2001 From: frosty Date: Mon, 30 Mar 2026 10:37:46 +0300 Subject: feat: begin adding settings menu, move theme to settings --- src/Utility/Utility.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Utility/Utility.c') diff --git a/src/Utility/Utility.c b/src/Utility/Utility.c index 3be4ef4..b4ad91d 100644 --- a/src/Utility/Utility.c +++ b/src/Utility/Utility.c @@ -1,4 +1,7 @@ #include "Utility.h" +#include +#include +#include int hex_to_int(char c) { if (c >= '0' && c <= '9') @@ -9,3 +12,14 @@ int hex_to_int(char c) { return c - 'A' + 10; return -1; } + +char *get_theme(const char *default_theme) { + char *cookie = get_cookie("theme"); + if (cookie && + (strcmp(cookie, "light") == 0 || + strcmp(cookie, "dark") == 0)) { + return cookie; + } + free(cookie); + return strdup(default_theme); +} -- cgit v1.2.3