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.
`-no-config`
Disable parsing of configuration. This runs rofi in *stock* mode.
## PATTERN
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
.IP
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
.PP
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.
config_parse_xresource_options_dynamic ( display );
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
* connection.
*/
Display *display = XOpenDisplay ( display_str );
if ( display ) {
load_configuration ( display );
load_configuration_dynamic ( display );
parse_keys_abe ();
XCloseDisplay ( display );
if ( find_arg ( "-no-config" ) < 0 ) {
Display *display = XOpenDisplay ( display_str );
if ( display ) {
load_configuration ( display );
load_configuration_dynamic ( display );
// Sanity check
config_sanity_check ( );
parse_keys_abe ();
XCloseDisplay ( display );
}
}
}
}
@ -1823,7 +1825,9 @@ int main ( int argc, char *argv[] )
// Setup keybinding
setup_abe ();
load_configuration ( display );
if ( find_arg ( "-no-config" ) < 0 ) {
load_configuration ( display );
}
if ( !dmenu_mode ) {
// setup_switchers
setup_switchers ();
@ -1832,8 +1836,12 @@ int main ( int argc, char *argv[] )
// Add dmenu options.
config_parser_add_option ( xrm_Char, "sep", (void * *) &( config.separator ) );
}
// Reload for dynamic part.
load_configuration_dynamic ( display );
if ( find_arg ( "-no-config" ) < 0 ) {
// Reload for dynamic part.
load_configuration_dynamic ( display );
}
// Sanity check
config_sanity_check ( );
// Dump.
if ( find_arg ( "-dump-xresources" ) >= 0 ) {
xresource_dump ();