From d8e9a1981f5b061576f64fe374703b5f6f3feb6d Mon Sep 17 00:00:00 2001 From: Qball Date: Tue, 31 Dec 2024 12:00:03 +0100 Subject: [PATCH] Be more diligent trying to resolve -config --- source/rofi.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/source/rofi.c b/source/rofi.c index 63cbe7684..a88cb9739 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -1067,10 +1067,19 @@ int main(int argc, char *argv[]) { } if (config_path) { - if (rofi_theme_parse_file(config_path)) { - rofi_theme_free(rofi_theme); - rofi_theme = NULL; + // Try to resolve the path. + extern const char *rasi_theme_file_extensions[]; + char *file2 = + helper_get_theme_path(config_path, rasi_theme_file_extensions, NULL); + char *filename = rofi_theme_parse_prepare_file(file2); + g_free(file2); + if (filename && g_file_test(filename, G_FILE_TEST_EXISTS)) { + if (rofi_theme_parse_file(filename)) { + rofi_theme_free(rofi_theme); + rofi_theme = NULL; + } } + g_free(filename); } } find_arg_str("-theme", &(config.theme)); @@ -1093,7 +1102,7 @@ int main(int argc, char *argv[]) { } if (rofi_theme == NULL || rofi_theme->num_widgets == 0) { - g_warning("Failed to load theme. Try to load default: "); + g_debug("Failed to load theme. Try to load default: "); rofi_theme_parse_string("@theme \"default\""); } TICK_N("Load cmd config ");