diff --git a/src/theme/theme.c b/src/theme/theme.c index 99770de5..e972a107 100644 --- a/src/theme/theme.c +++ b/src/theme/theme.c @@ -3,6 +3,8 @@ #include #include #include +#include +#include #include "theme.h" #include "theme/theme-dir.h" @@ -31,15 +33,20 @@ static void parse_hexstr(const char *hex, float *rgba) rgba[3] = 1.0; } +static bool match(const gchar *pattern, const gchar *string) +{ + return (bool)g_pattern_match_simple(pattern, string); +} + static void entry(const char *key, const char *value) { if (!key || !value) return; - if (!strcmp(key, "window.active.title.bg.color")) + if (match(key, "window.active.title.bg.color")) parse_hexstr(value, theme.window_active_title_bg_color); - if (!strcmp(key, "window.active.handle.bg.color")) + if (match(key, "window.active.handle.bg.color")) parse_hexstr(value, theme.window_active_handle_bg_color); - if (!strcmp(key, "window.inactive.title.bg.color")) + if (match(key, "window.inactive.title.bg.color")) parse_hexstr(value, theme.window_inactive_title_bg_color); }