diff --git a/doc/rofi.1 b/doc/rofi.1 index b95af90a..5aaa0bef 100644 --- a/doc/rofi.1 +++ b/doc/rofi.1 @@ -1151,6 +1151,22 @@ Make \fBrofi\fP create a pid file and check this on startup. The pid file preven .PP Set the name to use for mode. This is used as prompt and in combi\-browser. +.PP +It is now prefered to use the configuration file: + +.PP +.RS + +.nf +configuration { + {mode} { + display\-name: *string*; + } +} + +.fi +.RE + .PP \fB\fC\-click\-to\-exit\fR \fB\fC\-no\-click\-to\-exit\fR diff --git a/doc/rofi.1.markdown b/doc/rofi.1.markdown index 0da0a0ba..716167eb 100644 --- a/doc/rofi.1.markdown +++ b/doc/rofi.1.markdown @@ -724,6 +724,17 @@ Make **rofi** create a pid file and check this on startup. The pid file prevents Set the name to use for mode. This is used as prompt and in combi-browser. +It is now prefered to use the configuration file: + +```css +configuration { + {mode} { + display-name: *string*; + } +} +``` + + `-click-to-exit` `-no-click-to-exit` diff --git a/source/mode.c b/source/mode.c index 8c0a9fc0..ae4b23be 100644 --- a/source/mode.c +++ b/source/mode.c @@ -153,10 +153,12 @@ void mode_set_private_data ( Mode *mode, void *pd ) const char *mode_get_display_name ( const Mode *mode ) { + /** Find the widget */ ThemeWidget *wid = rofi_config_find_widget ( mode->name, NULL, TRUE ); if ( wid ) { + /** Check string property */ Property *p = rofi_theme_find_property ( wid, P_STRING, "display-name", FALSE ); - if ( p != NULL ) { + if ( p != NULL && p->type == P_STRING ) { return p->value.s; } }