Skip to content

Commit

Permalink
Be more diligent trying to resolve -config
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveDavenport committed Dec 31, 2024
1 parent f949169 commit d8e9a19
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions source/rofi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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 ");
Expand Down

0 comments on commit d8e9a19

Please sign in to comment.