[Theme] If no theme loaded, load default. Downgrade missing theme file to warning.

Issue: #1689
This commit is contained in:
Dave Davenport 2022-08-26 14:05:16 +02:00
parent 0f097f2998
commit 594c7f2b31
2 changed files with 7 additions and 2 deletions

View File

@ -433,7 +433,7 @@ if ( queue == NULL ) {
} else {
char *str = g_markup_printf_escaped ( "Failed to open theme: <i>%s</i>\nError: <b>%s</b>",
filename, strerror ( errno ) );
rofi_add_error_message ( g_string_new ( str ) );
rofi_add_warning_message ( g_string_new ( str ) );
g_free ( str );
g_free(filename);
}

View File

@ -36,12 +36,12 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sysexits.h>
#include <time.h>
#include <unistd.h>
#include <xcb/xcb.h>
#include <sys/stat.h>
#include <glib-unix.h>
@ -1017,6 +1017,11 @@ int main(int argc, char *argv[]) {
// This might clear existing errors.
config_parse_cmd_options();
}
if (rofi_theme == NULL || rofi_theme->num_widgets == 0) {
g_warning("Failed to load theme. Try to load default: ");
rofi_theme_parse_string("@theme \"default\"");
}
TICK_N("Load cmd config ");
// Get the path to the cache dir.