diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/rofi.c | 27 | ||||
-rw-r--r-- | source/theme.c | 2 | ||||
-rw-r--r-- | source/view.c | 2 | ||||
-rw-r--r-- | source/xrmoptions.c | 4 |
4 files changed, 33 insertions, 2 deletions
diff --git a/source/rofi.c b/source/rofi.c index a94d4611..531cd44f 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -856,6 +856,33 @@ int main ( int argc, char *argv[] ) } config_parser_add_option ( xrm_String, "pid", (void * *) &pidfile, "Pidfile location" ); + + /** default configuration */ + { + GBytes *theme_data = g_resource_lookup_data ( + resources_get_resource (), + "/org/qtools/rofi/default_configuration.rasi", + G_RESOURCE_LOOKUP_FLAGS_NONE, + NULL ); + if ( theme_data ) { + const char *theme = g_bytes_get_data ( theme_data, NULL ); + if ( rofi_theme_parse_string ( (const char *) theme ) ) { + g_warning ( "Failed to parse default configuration. Giving up.." ); + if ( list_of_error_msgs ) { + for ( GList *iter = g_list_first ( list_of_error_msgs ); + iter != NULL; iter = g_list_next ( iter ) ) { + g_warning ( "Error: %s%s%s", + color_bold, ( (GString *) iter->data )->str, color_reset ); + } + } + rofi_configuration = NULL; + cleanup (); + return EXIT_FAILURE; + } + g_bytes_unref ( theme_data ); + } + } + if ( find_arg ( "-config" ) < 0 ) { const char *cpath = g_get_user_config_dir (); if ( cpath ) { diff --git a/source/theme.c b/source/theme.c index 8afccb14..a6c998b8 100644 --- a/source/theme.c +++ b/source/theme.c @@ -503,7 +503,7 @@ static void rofi_theme_print_property_index ( size_t pnl, int depth, Property *p putchar ( '\n' ); } -static void rofi_theme_print_index ( ThemeWidget *widget, int index ) +void rofi_theme_print_index ( ThemeWidget *widget, int index ) { GHashTableIter iter; gpointer key, value; diff --git a/source/view.c b/source/view.c index 3259ed56..14f7c3d2 100644 --- a/source/view.c +++ b/source/view.c @@ -511,7 +511,7 @@ static void rofi_view_set_user_timeout ( G_GNUC_UNUSED gpointer data ) if ( wid ) { /** Check string property */ Property *p = rofi_theme_find_property ( wid, P_INTEGER, "delay", TRUE); - if ( p != NULL && p->type == P_INTEGER) { + if ( p != NULL && p->type == P_INTEGER && p->value.i > 0 ) { int delay = p->value.i; CacheState.user_timeout = g_timeout_add ( delay*1000 , rofi_view_user_timeout, NULL ); } diff --git a/source/xrmoptions.c b/source/xrmoptions.c index 91a98416..6a7fdf98 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -553,6 +553,10 @@ void config_parse_dump_config_rasi_format ( FILE *out, gboolean changes ) } } + for ( unsigned int index = 0; index < rofi_configuration->num_widgets; index ++ ) { + rofi_theme_print_index ( rofi_configuration->widgets[index], 2 ); + } + fprintf ( out, "}\n" ); } |