diff --git a/doc/rofi.1 b/doc/rofi.1 index d2fe6652..444c644a 100644 --- a/doc/rofi.1 +++ b/doc/rofi.1 @@ -75,10 +75,6 @@ System configuration file (for example \fB\fC/etc/rofi.rasi\fR or old format \f It first checks XDG\_CONFIG\_DIRS and then SYSCONFDIR (that is passed at compile time). It loads the first config file it finds, it does not merge multiple system configuration files. .IP \(bu 2 -Xresources: A method of storing key values in the Xserver. See -here -\[la]https://en.wikipedia.org/wiki/X_resources\[ra] for more information. -.IP \(bu 2 Rasi theme file: The new \fItheme\fP format can be used to set configuration values. .IP \(bu 2 Configuration File: This uses the same format as the Xresources file. @@ -91,41 +87,7 @@ Command\-line options: Arguments passed to \fBrofi\fP\&. .RE .PP -\fBTIP\fP: To get a template config file run: \fB\fCrofi \-dump\-xresources > rofi\-example.config\fR\&. - -.PP -\fBNOTE\fP: In version 1.4.0 we support configuration in a new format, a config for this can be generated by: -\fB\fCrofi \-dump\-config > config.rasi\fR - -.PP -\fBNOTE\fP: If you want to use the new configuration format, the config file should be named \fB\fCconfig.rasi\fR\&. - -.PP -\fBNOTE\fP: You can upgrade to the new configuration file format using \fB\fCrofi \-upgrade\-config\fR - -.PP -The Xresources file expects options starting with \fB\fCrofi.\fR followed by its name. An example to set the number of lines: - -.PP -.RS - -.nf -rofi.lines: 10 - -.fi -.RE - -.PP -Command\-line options override settings from the Xresources file. The same option set as argument — prefixed with a '\-': - -.PP -.RS - -.nf -rofi \-lines 10 - -.fi -.RE +\fBTIP\fP: To get a template config file run: \fB\fCrofi \-dump\-config > config.rasi\fR .PP To get a list of available options formatted as Xresources entries, run: @@ -134,11 +96,14 @@ To get a list of available options formatted as Xresources entries, run: .RS .nf -rofi \-dump\-xresources +rofi \-dump\-config .fi .RE +.PP +This will contain (commented) all current configuration options. + .PP The configuration system supports the following types: @@ -151,6 +116,8 @@ integer (signed and unsigned) char .IP \(bu 2 Boolean +.IP \(bu 2 +lists .RE @@ -208,13 +175,6 @@ Information about the rasi format can be found in the \fBrofi\-theme(5)\fP manpa .PP Dump the current active theme, in rasi format, to stdout and exit. -.PP -\fB\fC\-dump\-xresources\fR - -.PP -Dump the current active configuration, in Xresources format, to stdout. -This does not validate all passed values (for example, colors). - .PP \fB\fC\-rasi\-validate\fR \fIfilename\fP @@ -1395,121 +1355,7 @@ ln \-s /usr/bin/rofi /usr/bin/dmenu .SH THEMING .PP -The theme format below describes the old (pre version 1.4) theme format. Please see rofi\-theme(5) manpage for an updated -manual. - -.PP -The theme setup allows you to specify colors per state, similar to \fBi3\fP -Currently 3 states exist: - -.RS -.IP \(bu 2 -\fBnormal\fP: normal row -.IP \(bu 2 -\fBurgent\fP: highlighted row (urgent) -.IP \(bu 2 -\fBactive\fP: highlighted row (active) - -.RE - -.PP -For each state, the following 5 colors must be set: - -.RS -.IP \(bu 2 -\fBbg\fP: background color row -.IP \(bu 2 -\fBfg\fP: text color -.IP \(bu 2 -\fBbgalt\fP: background color alternating row -.IP \(bu 2 -\fBhlfg\fP: foreground color selected row -.IP \(bu 2 -\fBhlbg\fP: background color selected row - -.RE - -.PP -The window background and border color should be specified separately. The key \fB\fCcolor\-window\fR contains -a tuple \fB\fCbackground,border,separator\fR\&. -An example \fB\fCXresources\fR file: - -.PP -.RS - -.nf -! State: 'bg', 'fg', 'bgalt', 'hlbg', 'hlfg' -rofi.color\-normal: #fdf6e3, #002b36, #eee8d5, #586e75, #eee8d5 -rofi.color\-urgent: #fdf6e3, #dc322f, #eee8d5, #dc322f, #fdf6e3 -rofi.color\-active: #fdf6e3, #268bd2, #eee8d5, #268bd2, #fdf6e3 - -! 'background', 'border', 'separator' -rofi.color\-window: #fdf6e3, #002b36, #002b36 - -.fi -.RE - -.PP -Same settings can also be specified on the command\-line: - -.PP -.RS - -.nf -rofi \-color\-normal "#fdf6e3,#002b36,#eee8d5,#586e75,#eee8d5" - -.fi -.RE - -.SH COLORS -.PP -RGB colors can be specified by either their X11 name or hexadecimal notation. -For example: - -.PP -.RS - -.nf -white - -.fi -.RE - -.PP -Or: - -.PP -.RS - -.nf -#FFFFFF - -.fi -.RE - -.PP -ARGB colors are also supported. These can be used to create a transparent window if (1) your Xserver supports TrueColor, and (2) you are running a composite manager. -For example: - argb:FF444444 - -.PP -Or: - -.PP -.RS - -.nf -#FF444444 - -.fi -.RE - -.PP -The first two fields specify the alpha level. This determines the amount of transparency (00 everything, FF nothing). The other fields represent the actual color, in hex. - -.PP -Transparency can be used within \fBrofi\fP, for example if the selected background color is 50% transparent, the background color -of the window will be visible through it. +Please see rofi\-theme(5) manpage for more information on themeing. .SH KEY BINDINGS .PP diff --git a/doc/rofi.1.markdown b/doc/rofi.1.markdown index 7c4c2f78..7feec701 100644 --- a/doc/rofi.1.markdown +++ b/doc/rofi.1.markdown @@ -56,8 +56,6 @@ There are currently three methods of setting configuration options (evaluated in * System configuration file (for example `/etc/rofi.rasi` or old format `/etc/rofi.conf`). It first checks XDG_CONFIG_DIRS and then SYSCONFDIR (that is passed at compile time). It loads the first config file it finds, it does not merge multiple system configuration files. - * Xresources: A method of storing key values in the Xserver. See - [here](https://en.wikipedia.org/wiki/X_resources) for more information. * Rasi theme file: The new *theme* format can be used to set configuration values. * Configuration File: This uses the same format as the Xresources file. By default it looks in `XDG_CONFIG_HOME`/rofi/config, but can be overridden on commandline. @@ -65,26 +63,13 @@ There are currently three methods of setting configuration options (evaluated in This is the recommended way of configuring **rofi**. * Command-line options: Arguments passed to **rofi**. -**TIP**: To get a template config file run: `rofi -dump-xresources > rofi-example.config`. - -**NOTE**: In version 1.4.0 we support configuration in a new format, a config for this can be generated by: -`rofi -dump-config > config.rasi` - -**NOTE**: If you want to use the new configuration format, the config file should be named `config.rasi`. - -**NOTE**: You can upgrade to the new configuration file format using `rofi -upgrade-config` - -The Xresources file expects options starting with `rofi.` followed by its name. An example to set the number of lines: - - rofi.lines: 10 - -Command-line options override settings from the Xresources file. The same option set as argument — prefixed with a '-': - - rofi -lines 10 +**TIP**: To get a template config file run: `rofi -dump-config > config.rasi` To get a list of available options formatted as Xresources entries, run: - rofi -dump-xresources + rofi -dump-config + +This will contain (commented) all current configuration options. The configuration system supports the following types: @@ -92,6 +77,7 @@ The configuration system supports the following types: * integer (signed and unsigned) * char * Boolean + * lists Boolean options have a non-default command-line syntax. Example to enable option X: @@ -123,11 +109,6 @@ Information about the rasi format can be found in the **rofi-theme(5)** manpage. Dump the current active theme, in rasi format, to stdout and exit. -`-dump-xresources` - -Dump the current active configuration, in Xresources format, to stdout. -This does not validate all passed values (for example, colors). - `-rasi-validate` *filename* Try to parse the file and 0 when succesful. @@ -817,63 +798,7 @@ This way it can be used as a drop-in replacement for dmenu. Just copy or symlink ## THEMING -The theme format below describes the old (pre version 1.4) theme format. Please see rofi-theme(5) manpage for an updated -manual. - -The theme setup allows you to specify colors per state, similar to **i3** -Currently 3 states exist: - - * **normal**: normal row - * **urgent**: highlighted row (urgent) - * **active**: highlighted row (active) - -For each state, the following 5 colors must be set: - - * **bg**: background color row - * **fg**: text color - * **bgalt**: background color alternating row - * **hlfg**: foreground color selected row - * **hlbg**: background color selected row - -The window background and border color should be specified separately. The key `color-window` contains -a tuple `background,border,separator`. -An example `Xresources` file: - - ! State: 'bg', 'fg', 'bgalt', 'hlbg', 'hlfg' - rofi.color-normal: #fdf6e3, #002b36, #eee8d5, #586e75, #eee8d5 - rofi.color-urgent: #fdf6e3, #dc322f, #eee8d5, #dc322f, #fdf6e3 - rofi.color-active: #fdf6e3, #268bd2, #eee8d5, #268bd2, #fdf6e3 - - ! 'background', 'border', 'separator' - rofi.color-window: #fdf6e3, #002b36, #002b36 - -Same settings can also be specified on the command-line: - - rofi -color-normal "#fdf6e3,#002b36,#eee8d5,#586e75,#eee8d5" - -## COLORS - -RGB colors can be specified by either their X11 name or hexadecimal notation. -For example: - - white - -Or: - - #FFFFFF - -ARGB colors are also supported. These can be used to create a transparent window if (1) your Xserver supports TrueColor, and (2) you are running a composite manager. -For example: - argb:FF444444 - -Or: - - #FF444444 - -The first two fields specify the alpha level. This determines the amount of transparency (00 everything, FF nothing). The other fields represent the actual color, in hex. - -Transparency can be used within **rofi**, for example if the selected background color is 50% transparent, the background color -of the window will be visible through it. +Please see rofi-theme(5) manpage for more information on themeing. ## KEY BINDINGS diff --git a/include/xrmoptions.h b/include/xrmoptions.h index 7e7735f8..2d9ab399 100644 --- a/include/xrmoptions.h +++ b/include/xrmoptions.h @@ -101,14 +101,6 @@ void config_parse_cmd_options ( void ); */ void config_xresource_free ( void ); -/** - * Dump the settings in a Xresources compatible way to - * stdout. - * - * @ingroup CONFXResources - */ -void config_parse_xresource_dump ( void ); - /** * @param type The type of the value * @param key The key referring to this configuration option diff --git a/source/rofi.c b/source/rofi.c index 06ac90ec..8c5cca77 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -289,7 +289,6 @@ static void print_main_application_options ( int is_term ) print_help_msg ( "-dmenu", "", "Start in dmenu mode.", NULL, is_term ); 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 ( "-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", "", "Behave as a normal window. (experimental)", NULL, is_term ); @@ -1115,11 +1114,6 @@ int main ( int argc, char *argv[] ) cleanup (); return EXIT_SUCCESS; } - if ( find_arg ( "-dump-xresources" ) >= 0 ) { - config_parse_xresource_dump (); - cleanup (); - return EXIT_SUCCESS; - } unsigned int interval = 1; if ( find_arg_uint ( "-record-screenshots", &interval ) ) { diff --git a/source/xrmoptions.c b/source/xrmoptions.c index 549ec240..344f3b89 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -524,63 +524,6 @@ void config_xresource_free ( void ) } } -static void xresource_dump_entry ( const char *namePrefix, XrmOption *option ) -{ - printf ( "! \"%s\" ", option->comment ); - printf ( "Set from: %s\n", ConfigSourceStr[option->source] ); - if ( option->source == CONFIG_DEFAULT ) { - printf ( "! " ); - } - printf ( "%s.%s: %*s", namePrefix, option->name, - (int) ( 30 - strlen ( option->name ) ), "" ); - switch ( option->type ) - { - case xrm_Number: - printf ( "%u", *( option->value.num ) ); - break; - case xrm_SNumber: - printf ( "%i", *( option->value.snum ) ); - break; - case xrm_String: - if ( ( *( option->value.str ) ) != NULL ) { - printf ( "%s", *( option->value.str ) ); - } - break; - case xrm_Boolean: - printf ( "%s", ( *( option->value.num ) == TRUE ) ? "true" : "false" ); - break; - case xrm_Char: - if ( *( option->value.charc ) > 32 && *( option->value.charc ) < 127 ) { - printf ( "%c", *( option->value.charc ) ); - } - else { - printf ( "\\x%02X", *( option->value.charc ) ); - } - break; - default: - break; - } - printf ( "\n" ); -} - -void config_parse_xresource_dump ( void ) -{ - const char * namePrefix = "rofi"; - unsigned int entries = sizeof ( xrmOptions ) / sizeof ( *xrmOptions ); - for ( unsigned int i = 0; i < entries; ++i ) { - // Skip duplicates. - if ( ( i + 1 ) < entries ) { - if ( xrmOptions[i].value.str == xrmOptions[i + 1].value.str ) { - continue; - } - } - xresource_dump_entry ( namePrefix, &( xrmOptions[i] ) ); - } - for ( unsigned int i = 0; i < num_extra_options; i++ ) { - xresource_dump_entry ( namePrefix, &( extra_options[i] ) ); - } -} - static void config_parse_dump_config_option ( FILE *out, XrmOption *option ) { if ( option->type == xrm_Char || option->source == CONFIG_DEFAULT ) { diff --git a/test/run_all_tests.sh b/test/run_all_tests.sh index 8d619ab0..f5376f22 100755 --- a/test/run_all_tests.sh +++ b/test/run_all_tests.sh @@ -4,7 +4,6 @@ tests=( run_errormsg_test run_switchdialog_test run_dmenu_test - run_dmenu_custom_test run_run_test run_script_test run_script_meta_test @@ -13,7 +12,6 @@ tests=( run_dmenu_empty run_dmenu_issue_292 run_screenshot_test - xr_dump_test run_combi_test run_regex_test run_glob_test diff --git a/test/run_dmenu_custom_test.sh b/test/run_dmenu_custom_test.sh deleted file mode 100755 index fd36de3a..00000000 --- a/test/run_dmenu_custom_test.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -echo -e -n "aap\nnoot\nmies" | rofi -width -30 -dmenu -multi-select > output.txt & -RPID=$! - -# send enter. -sleep 5; -xdotool key 'c' -sleep 0.2 -xdotool key 'o' -sleep 0.2 -xdotool key 'f' -sleep 0.2 -xdotool key 'f' -sleep 0.2 -xdotool key 'e' -sleep 0.2 -xdotool key 'e' -sleep 0.2 -xdotool key Return - - -# Get result, kill xvfb -wait ${RPID} -RETV=$? -OUTPUT=$( tr '\n' ' ' < output.txt ) -if [ "${OUTPUT}" != 'coffee ' ] -then - exit 1 -fi - -OUTPUT=$(rofi -dump-xresources) -if [ -z "${OUTPUT}" ] -then - exit 1 -fi - -exit ${RETV} diff --git a/test/xr_dump_test.sh b/test/xr_dump_test.sh deleted file mode 100755 index 1c4f6caa..00000000 --- a/test/xr_dump_test.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -TOP_DIR=$1 - -xrdb -retain -load ${TOP_DIR}/doc/test_xr.txt -rofi -config ${TOP_DIR}/doc/test_xr.txt -dump-xresources | grep -v "rofi.display-" | grep -v "The display name of this browser" > temp.txt - -if ! diff temp.txt ${TOP_DIR}/doc/test_xr.txt > /dev/null -then - echo "Dump xresources does not match." - diff temp.txt ${TOP_DIR}/doc/test_xr.txt - exit 1; -fi - -exit ${RETV}