summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@blame.services>2021-06-15 14:04:34 +0200
committerDave Davenport <qball@blame.services>2021-06-15 14:04:34 +0200
commit3307d62c55b2f359c52bc9884b0472f9eae9aa47 (patch)
tree78438d8658667ff163159f539e620d3b9987a217
parentb541bf55bc50786d12a3f7fefa0f8b92e5673a5e (diff)
[Doc] Add new -display-{mode} method to manpage.
-rw-r--r--doc/rofi.116
-rw-r--r--doc/rofi.1.markdown11
-rw-r--r--source/mode.c4
3 files changed, 30 insertions, 1 deletions
diff --git a/doc/rofi.1 b/doc/rofi.1
index b95af90a..5aaa0bef 100644
--- a/doc/rofi.1
+++ b/doc/rofi.1
@@ -1152,6 +1152,22 @@ Make \fBrofi\fP create a pid file and check this on startup. The pid file preven
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;
}
}