summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2015-12-10 18:20:04 +0100
committerDave Davenport <qball@gmpclient.org>2015-12-10 18:20:04 +0100
commit8ed31cab7e0bd4e68b504d202e0bed951ee5c182 (patch)
tree626f30b98bb0dbedeb9f4913398e7d1bbfd22afc /source
parent691b06f76778f1f69fd2d8af41737ab88a0bdc55 (diff)
Add option to dump color scheme.
Diffstat (limited to 'source')
-rw-r--r--source/rofi.c5
-rw-r--r--source/xrmoptions.c18
2 files changed, 23 insertions, 0 deletions
diff --git a/source/rofi.c b/source/rofi.c
index 5296437e..50becc8b 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -1940,6 +1940,7 @@ static void print_main_application_options ( void )
print_help_msg ( "-display", "[string]", "X server to contact.", "${DISPLAY}", is_term );
print_help_msg ( "-h,-help", "", "This help message.", NULL, is_term );
print_help_msg ( "-dump-xresources", "", "Dump the current configuration in Xresources format and exit.", NULL, is_term );
+ print_help_msg ( "-dump-xresources-theme", "", "Dump the current color scheme in Xresources format and exit.", NULL, is_term );
print_help_msg ( "-e", "[string]", "Show a dialog displaying the passed message and exit.", NULL, is_term );
print_help_msg ( "-markup", "", "Enable pango markup where possible.", NULL, is_term );
print_help_msg ( "-normal-window", "", "In dmenu mode, behave as a normal window. (experimental)", NULL, is_term );
@@ -2442,6 +2443,10 @@ int main ( int argc, char *argv[] )
xresource_dump ();
exit ( EXIT_SUCCESS );
}
+ if ( find_arg ( "-dump-xresources-theme" ) >= 0 ) {
+ print_xresources_theme();
+ exit ( EXIT_SUCCESS );
+ }
// Parse the keybindings.
parse_keys_abe ();
TICK_N ( "Parse ABE" );
diff --git a/source/xrmoptions.c b/source/xrmoptions.c
index 03cfd301..2d3b5dd2 100644
--- a/source/xrmoptions.c
+++ b/source/xrmoptions.c
@@ -510,3 +510,21 @@ void print_help_msg ( const char *option, const char *type, const char*text, con
}
}
}
+
+void print_xresources_theme ( void )
+{
+ if( config.color_enabled != TRUE ) {
+ printf("! Dumping theme only works for the extended color scheme.\n");
+ return;
+ }
+ printf("! ------------------------------------------------------------------------------\n");
+ printf("! ROFI Color theme\n");
+ printf("! ------------------------------------------------------------------------------\n");
+ const char * namePrefix = "rofi";
+ unsigned int entries = sizeof ( xrmOptions ) / sizeof ( *xrmOptions );
+ for ( unsigned int i = 0; i < entries; ++i ) {
+ if ( strncmp(xrmOptions[i].name, "color-",6) == 0){
+ xresource_dump_entry(namePrefix, &xrmOptions[i]);
+ }
+ }
+}