diff options
| author | frosty <gabriel@bwaaa.monster> | 2026-03-30 10:37:46 +0300 |
|---|---|---|
| committer | frosty <gabriel@bwaaa.monster> | 2026-03-30 10:37:46 +0300 |
| commit | c3ed9017385342944badec46de263560c6ab07c8 (patch) | |
| tree | d7f7e86e26ebffd9f277fc340b74a1681eb707d7 /src/Utility/Utility.c | |
| parent | 9e6e76306471b3cc139ae68c0363ec95616d1b23 (diff) | |
| download | omnisearch-c3ed9017385342944badec46de263560c6ab07c8.tar.gz | |
feat: begin adding settings menu, move theme to settings
Diffstat (limited to 'src/Utility/Utility.c')
| -rw-r--r-- | src/Utility/Utility.c | 14 |
1 files changed, 14 insertions, 0 deletions
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 <beaker.h> +#include <stdlib.h> +#include <string.h> 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); +} |
