From 13a83e3495edca1e654d6a24c53c59f00fe17761 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Thu, 19 Jan 2017 18:49:55 +0100 Subject: [PATCH] Give a visible (popup) error message when failed to open theme --- source/theme.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/theme.c b/source/theme.c index 01196ca2..27c9f508 100644 --- a/source/theme.c +++ b/source/theme.c @@ -860,7 +860,10 @@ gboolean rofi_theme_parse_file ( const char *file ) char *filename = rofi_expand_path ( file ); yyin = fopen ( filename, "rb" ); if ( yyin == NULL ) { - fprintf ( stderr, "Failed to open file: %s: '%s'\n", filename, strerror ( errno ) ); + char *str = g_markup_printf_escaped ( "Failed to open theme: %s\nError: %s", + filename, strerror ( errno ) ); + rofi_add_error_message ( g_string_new ( str ) ); + g_free(str); g_free ( filename ); return TRUE; }