Add a `-no-config` option to run rofi stock.

This commit is contained in:
Dave Davenport 2015-05-31 09:46:39 +02:00
parent fa7fa50664
commit e8adc8042d
3 changed files with 28 additions and 12 deletions

View File

@ -558,6 +558,10 @@ For more information on supported markup see [here](https://developer.gnome.org/
Dump the current active configuration in Xresources format to the command-line. Dump the current active configuration in Xresources format to the command-line.
`-no-config`
Disable parsing of configuration. This runs rofi in *stock* mode.
## PATTERN ## PATTERN
To launch commands (e.g. when using the ssh launcher) the user can enter the used command-line, To launch commands (e.g. when using the ssh launcher) the user can enter the used command-line,

View File

@ -731,6 +731,10 @@ simultaneous. This is useful when running **rofi** from a keybinding daemon.
\fB\fC\-dump\-Xresources\fR \fB\fC\-dump\-Xresources\fR
.IP .IP
Dump the current active configuration in Xresources format to the command\-line. Dump the current active configuration in Xresources format to the command\-line.
.PP
\fB\fC\-no\-config\fR
.IP
Disable parsing of configuration. This runs rofi in \fIstock\fP mode.
.SH PATTERN .SH PATTERN
.PP .PP
To launch commands (e.g. when using the ssh launcher) the user can enter the used command\-line, To launch commands (e.g. when using the ssh launcher) the user can enter the used command\-line,

View File

@ -1711,9 +1711,6 @@ static inline void load_configuration_dynamic ( Display *display )
// Load in config from X resources. // Load in config from X resources.
config_parse_xresource_options_dynamic ( display ); config_parse_xresource_options_dynamic ( display );
config_parse_cmd_options_dynamic ( ); config_parse_cmd_options_dynamic ( );
// Sanity check
config_sanity_check ( );
} }
@ -1728,12 +1725,17 @@ static void hup_action_handler ( int num )
* Open new connection to X. It seems the XResources do not get updated on the old * Open new connection to X. It seems the XResources do not get updated on the old
* connection. * connection.
*/ */
Display *display = XOpenDisplay ( display_str ); if ( find_arg ( "-no-config" ) < 0 ) {
if ( display ) { Display *display = XOpenDisplay ( display_str );
load_configuration ( display ); if ( display ) {
load_configuration_dynamic ( display ); load_configuration ( display );
parse_keys_abe (); load_configuration_dynamic ( display );
XCloseDisplay ( display );
// Sanity check
config_sanity_check ( );
parse_keys_abe ();
XCloseDisplay ( display );
}
} }
} }
} }
@ -1823,7 +1825,9 @@ int main ( int argc, char *argv[] )
// Setup keybinding // Setup keybinding
setup_abe (); setup_abe ();
load_configuration ( display ); if ( find_arg ( "-no-config" ) < 0 ) {
load_configuration ( display );
}
if ( !dmenu_mode ) { if ( !dmenu_mode ) {
// setup_switchers // setup_switchers
setup_switchers (); setup_switchers ();
@ -1832,8 +1836,12 @@ int main ( int argc, char *argv[] )
// Add dmenu options. // Add dmenu options.
config_parser_add_option ( xrm_Char, "sep", (void * *) &( config.separator ) ); config_parser_add_option ( xrm_Char, "sep", (void * *) &( config.separator ) );
} }
// Reload for dynamic part. if ( find_arg ( "-no-config" ) < 0 ) {
load_configuration_dynamic ( display ); // Reload for dynamic part.
load_configuration_dynamic ( display );
}
// Sanity check
config_sanity_check ( );
// Dump. // Dump.
if ( find_arg ( "-dump-xresources" ) >= 0 ) { if ( find_arg ( "-dump-xresources" ) >= 0 ) {
xresource_dump (); xresource_dump ();