rofi  1.6.0
xrmoptions.c
Go to the documentation of this file.
1 /*
2  * rofi
3  *
4  * MIT/X11 License
5  * Copyright © 2013-2020 Qball Cow <qball@gmpclient.org>
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining
8  * a copy of this software and associated documentation files (the
9  * "Software"), to deal in the Software without restriction, including
10  * without limitation the rights to use, copy, modify, merge, publish,
11  * distribute, sublicense, and/or sell copies of the Software, and to
12  * permit persons to whom the Software is furnished to do so, subject to
13  * the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be
16  * included in all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25  *
26  */
27 
28 #include <config.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <string.h>
32 #include <unistd.h>
33 #include <xcb/xcb.h>
34 #include <xcb/xkb.h>
35 #include <xcb/xcb_xrm.h>
36 #include <glib.h>
37 #include "xcb.h"
38 #include "xcb-internal.h"
39 #include "rofi.h"
40 #include "xrmoptions.h"
41 #include "settings.h"
42 #include "helper.h"
43 #include "rofi-types.h"
44 
46 const char * const ConfigSourceStr[] = {
47  "Default",
48  "XResources",
49  "File",
50  "Rasi File",
51  "Commandline",
52 };
55 {
60  CONFIG_CMDLINE = 4
61 };
62 
63 typedef struct
64 {
65  int type;
66  const char * name;
67  union
68  {
69  unsigned int * num;
70  int * snum;
71  char ** str;
72  void *pointer;
73  char * charc;
74  } value;
75  char *mem;
76  const char *comment;
77  enum ConfigSource source;
78 } XrmOption;
83 static XrmOption xrmOptions[] = {
84  { xrm_String, "switchers", { .str = &config.modi }, NULL,
85  "", CONFIG_DEFAULT },
86  { xrm_String, "modi", { .str = &config.modi }, NULL,
87  "Enabled modi", CONFIG_DEFAULT },
88  { xrm_SNumber, "width", { .snum = &config.menu_width }, NULL,
89  "Window width", CONFIG_DEFAULT },
90  { xrm_Number, "lines", { .num = &config.menu_lines }, NULL,
91  "Number of lines", CONFIG_DEFAULT },
92  { xrm_Number, "columns", { .num = &config.menu_columns }, NULL,
93  "Number of columns", CONFIG_DEFAULT },
94 
95  { xrm_String, "font", { .str = &config.menu_font }, NULL,
96  "Font to use", CONFIG_DEFAULT },
97  { xrm_Number, "borderwidth", { .num = &config.menu_bw }, NULL,
98  "", CONFIG_DEFAULT },
99  { xrm_Number, "bw", { .num = &config.menu_bw }, NULL,
100  "Border width", CONFIG_DEFAULT },
101 
102  { xrm_Number, "location", { .num = &config.location }, NULL,
103  "Location on screen", CONFIG_DEFAULT },
104 
105  { xrm_Number, "padding", { .num = &config.padding }, NULL,
106  "Padding", CONFIG_DEFAULT },
107  { xrm_SNumber, "yoffset", { .snum = &config.y_offset }, NULL,
108  "Y-offset relative to location", CONFIG_DEFAULT },
109  { xrm_SNumber, "xoffset", { .snum = &config.x_offset }, NULL,
110  "X-offset relative to location", CONFIG_DEFAULT },
111  { xrm_Boolean, "fixed-num-lines", { .num = &config.fixed_num_lines }, NULL,
112  "Always show number of lines", CONFIG_DEFAULT },
113 
114  { xrm_Boolean, "show-icons", { .snum = &config.show_icons }, NULL,
115  "Whether to load and show icons", CONFIG_DEFAULT },
116 
117  { xrm_String, "terminal", { .str = &config.terminal_emulator }, NULL,
118  "Terminal to use", CONFIG_DEFAULT },
119  { xrm_String, "ssh-client", { .str = &config.ssh_client }, NULL,
120  "Ssh client to use", CONFIG_DEFAULT },
121  { xrm_String, "ssh-command", { .str = &config.ssh_command }, NULL,
122  "Ssh command to execute", CONFIG_DEFAULT },
123  { xrm_String, "run-command", { .str = &config.run_command }, NULL,
124  "Run command to execute", CONFIG_DEFAULT },
125  { xrm_String, "run-list-command", { .str = &config.run_list_command }, NULL,
126  "Command to get extra run targets", CONFIG_DEFAULT },
127  { xrm_String, "run-shell-command", { .str = &config.run_shell_command }, NULL,
128  "Run command to execute that runs in shell", CONFIG_DEFAULT },
129  { xrm_String, "window-command", { .str = &config.window_command }, NULL,
130  "Command executed on accep-entry-custom for window modus", CONFIG_DEFAULT },
131  { xrm_String, "window-match-fields", { .str = &config.window_match_fields }, NULL,
132  "Window fields to match in window mode", CONFIG_DEFAULT },
133  { xrm_String, "icon-theme", { .str = &config.icon_theme }, NULL,
134  "Theme to use to look for icons", CONFIG_DEFAULT },
135 
136  { xrm_String, "drun-match-fields", { .str = &config.drun_match_fields }, NULL,
137  "Desktop entry fields to match in drun", CONFIG_DEFAULT },
138  { xrm_String, "drun-categories", { .str = &config.drun_categories }, NULL,
139  "Only show Desktop entry from these categories", CONFIG_DEFAULT },
140  { xrm_Boolean, "drun-show-actions", { .num = &config.drun_show_actions }, NULL,
141  "Desktop entry show actions.", CONFIG_DEFAULT },
142  { xrm_String, "drun-display-format", { .str = &config.drun_display_format }, NULL,
143  "DRUN format string. (Supports: generic,name,comment,exec,categories)", CONFIG_DEFAULT },
144  { xrm_String, "drun-url-launcher", { .str = &config.drun_url_launcher }, NULL,
145  "Command to open an Desktop Entry that is a Link.", CONFIG_DEFAULT },
146 
147  { xrm_Boolean, "disable-history", { .num = &config.disable_history }, NULL,
148  "Disable history in run/ssh", CONFIG_DEFAULT },
149  { xrm_String, "ignored-prefixes", { .str = &config.ignored_prefixes }, NULL,
150  "Programs ignored for history", CONFIG_DEFAULT },
151  { xrm_Boolean, "sort", { .num = &config.sort }, NULL,
152  "Use sorting", CONFIG_DEFAULT },
153  { xrm_String, "sorting-method", { .str = &config.sorting_method }, NULL,
154  "Choose the strategy used for sorting: normal (levenshtein) or fzf.", CONFIG_DEFAULT },
155  { xrm_Boolean, "case-sensitive", { .num = &config.case_sensitive }, NULL,
156  "Set case-sensitivity", CONFIG_DEFAULT },
157  { xrm_Boolean, "cycle", { .num = &config.cycle }, NULL,
158  "Cycle through the results list", CONFIG_DEFAULT },
159  { xrm_Boolean, "sidebar-mode", { .num = &config.sidebar_mode }, NULL,
160  "Enable sidebar-mode", CONFIG_DEFAULT },
161  { xrm_SNumber, "eh", { .snum = &config.element_height }, NULL,
162  "Row height (in chars)", CONFIG_DEFAULT },
163  { xrm_Boolean, "auto-select", { .num = &config.auto_select }, NULL,
164  "Enable auto select mode", CONFIG_DEFAULT },
165  { xrm_Boolean, "parse-hosts", { .num = &config.parse_hosts }, NULL,
166  "Parse hosts file for ssh mode", CONFIG_DEFAULT },
167  { xrm_Boolean, "parse-known-hosts", { .num = &config.parse_known_hosts }, NULL,
168  "Parse known_hosts file for ssh mode", CONFIG_DEFAULT },
169  { xrm_String, "combi-modi", { .str = &config.combi_modi }, NULL,
170  "Set the modi to combine in combi mode", CONFIG_DEFAULT },
171  { xrm_String, "matching", { .str = &config.matching }, NULL,
172  "Set the matching algorithm. (normal, regex, glob, fuzzy)", CONFIG_DEFAULT },
173  { xrm_Boolean, "tokenize", { .num = &config.tokenize }, NULL,
174  "Tokenize input string", CONFIG_DEFAULT },
175  { xrm_String, "monitor", { .str = &config.monitor }, NULL,
176  "", CONFIG_DEFAULT },
177  /* Alias for dmenu compatibility. */
178  { xrm_String, "m", { .str = &config.monitor }, NULL,
179  "Monitor id to show on", CONFIG_DEFAULT },
180  { xrm_Number, "line-margin", { .num = &config.line_margin }, NULL,
181  "Margin between rows *DEPRECATED*", CONFIG_DEFAULT },
182  { xrm_Number, "line-padding", { .num = &config.line_padding }, NULL,
183  "Padding within rows *DEPRECATED*", CONFIG_DEFAULT },
184  { xrm_String, "filter", { .str = &config.filter }, NULL,
185  "Pre-set filter", CONFIG_DEFAULT },
186  { xrm_String, "separator-style", { .str = &config.separator_style }, NULL,
187  "Separator style (none, dash, solid) *DEPRECATED*", CONFIG_DEFAULT },
188  { xrm_Boolean, "hide-scrollbar", { .num = &config.hide_scrollbar }, NULL,
189  "Hide scroll-bar *DEPRECATED*", CONFIG_DEFAULT },
190  { xrm_Boolean, "fullscreen", { .num = &config.fullscreen }, NULL,
191  "Fullscreen", CONFIG_DEFAULT },
192  { xrm_Boolean, "fake-transparency", { .num = &config.fake_transparency }, NULL,
193  "Fake transparency *DEPRECATED*", CONFIG_DEFAULT },
194  { xrm_SNumber, "dpi", { .snum = &config.dpi }, NULL,
195  "DPI", CONFIG_DEFAULT },
196  { xrm_Number, "threads", { .num = &config.threads }, NULL,
197  "Threads to use for string matching", CONFIG_DEFAULT },
198  { xrm_Number, "scrollbar-width", { .num = &config.scrollbar_width }, NULL,
199  "Scrollbar width *DEPRECATED*", CONFIG_DEFAULT },
200  { xrm_Number, "scroll-method", { .num = &config.scroll_method }, NULL,
201  "Scrolling method. (0: Page, 1: Centered)", CONFIG_DEFAULT },
202  { xrm_String, "fake-background", { .str = &config.fake_background }, NULL,
203  "Background to use for fake transparency. (background or screenshot) *DEPRECATED*", CONFIG_DEFAULT },
204  { xrm_String, "window-format", { .str = &config.window_format }, NULL,
205  "Window Format. w (desktop name), t (title), n (name), r (role), c (class)", CONFIG_DEFAULT },
206  { xrm_Boolean, "click-to-exit", { .snum = &config.click_to_exit }, NULL,
207  "Click outside the window to exit", CONFIG_DEFAULT },
208  { xrm_Boolean, "show-match", { .snum = &config.show_match }, NULL,
209  "Indicate how it match by underlining it.", CONFIG_DEFAULT },
210  { xrm_String, "theme", { .str = &config.theme }, NULL,
211  "New style theme file", CONFIG_DEFAULT },
212  { xrm_String, "color-normal", { .str = &config.color_normal }, NULL,
213  "Color scheme for normal row", CONFIG_DEFAULT },
214  { xrm_String, "color-urgent", { .str = &config.color_urgent }, NULL,
215  "Color scheme for urgent row", CONFIG_DEFAULT },
216  { xrm_String, "color-active", { .str = &config.color_active }, NULL,
217  "Color scheme for active row", CONFIG_DEFAULT },
218  { xrm_String, "color-window", { .str = &config.color_window }, NULL,
219  "Color scheme window", CONFIG_DEFAULT },
220  { xrm_Number, "max-history-size", { .num = &config.max_history_size }, NULL,
221  "Max history size (WARNING: can cause slowdowns when set to high).", CONFIG_DEFAULT },
222  { xrm_Boolean, "combi-hide-mode-prefix", { .snum = &config.combi_hide_mode_prefix }, NULL,
223  "Hide the prefix mode prefix on the combi view.", CONFIG_DEFAULT },
224  { xrm_Char, "matching-negate-char", { .charc = &config.matching_negate_char }, NULL,
225  "Set the character used to negate the matching. ('\\0' to disable)", CONFIG_DEFAULT },
226  { xrm_String, "cache-dir", { .str = &config.cache_dir }, NULL,
227  "Directory where history and temporary files are stored.", CONFIG_DEFAULT },
228  { xrm_Boolean, "window-thumbnail", { .snum = &config.window_thumbnail }, NULL,
229  "Show window thumbnail (if available) as icon in window switcher.", CONFIG_DEFAULT },
230  { xrm_Boolean, "drun-use-desktop-cache", { .snum = &config.drun_use_desktop_cache }, NULL,
231  "DRUN: build and use a cache with desktop file content.", CONFIG_DEFAULT },
232  { xrm_Boolean, "drun-reload-desktop-cache", { .snum = &config.drun_reload_desktop_cache }, NULL,
233  "DRUN: If enabled, reload the cache with desktop file content.", CONFIG_DEFAULT },
234 };
235 
239 unsigned int num_extra_options = 0;
240 
241 void config_parser_add_option ( XrmOptionType type, const char *key, void **value, const char *comment )
242 {
243  extra_options = g_realloc ( extra_options, ( num_extra_options + 1 ) * sizeof ( XrmOption ) );
244 
250  switch ( type )
251  {
252  case xrm_String:
253  extra_options[num_extra_options].mem = ( (char *) ( *value ) );
254  break;
255  default:
257  break;
258  }
259 
261 }
262 
263 static void config_parser_set ( XrmOption *option, char *xrmValue, enum ConfigSource source )
264 {
265  switch ( option->type )
266  {
267  case xrm_String:
268  if ( ( option )->mem != NULL ) {
269  g_free ( option->mem );
270  option->mem = NULL;
271  }
272  *( option->value.str ) = g_strchomp ( g_strdup ( xrmValue ) );
273 
274  // Memory
275  ( option )->mem = *( option->value.str );
276  break;
277  case xrm_Number:
278  *( option->value.num ) = (unsigned int) g_ascii_strtoull ( xrmValue, NULL, 10 );
279  break;
280  case xrm_SNumber:
281  *( option->value.snum ) = (int) g_ascii_strtoll ( xrmValue, NULL, 10 );
282  break;
283  case xrm_Boolean:
284  if ( strlen ( xrmValue ) > 0 &&
285  g_ascii_strcasecmp ( xrmValue, "true" ) == 0 ) {
286  *( option->value.num ) = TRUE;
287  }
288  else{
289  *( option->value.num ) = FALSE;
290  }
291  break;
292  case xrm_Char:
293  *( option->value.charc ) = helper_parse_char ( xrmValue );
294  break;
295  }
296  option->source = source;
297 }
298 
299 static void __config_parse_xresource_options ( xcb_xrm_database_t *xDB, enum ConfigSource source )
300 {
301  const char * namePrefix = "rofi";
302 
303  for ( unsigned int i = 0; i < sizeof ( xrmOptions ) / sizeof ( XrmOption ); ++i ) {
304  char *name = g_strdup_printf ( "%s.%s", namePrefix, xrmOptions[i].name );
305 
306  char *xrmValue = NULL;
307  if ( xcb_xrm_resource_get_string ( xDB, name, NULL, &xrmValue ) == 0 ) {
308  config_parser_set ( &( xrmOptions[i] ), xrmValue, source );
309  }
310  if ( xrmValue ) {
311  free ( xrmValue );
312  }
313 
314  g_free ( name );
315  }
316 }
317 static void __config_parse_xresource_options_dynamic ( xcb_xrm_database_t *xDB, enum ConfigSource source )
318 {
319  const char * namePrefix = "rofi";
320 
321  for ( unsigned int i = 0; i < num_extra_options; ++i ) {
322  char *name;
323 
324  name = g_strdup_printf ( "%s.%s", namePrefix, extra_options[i].name );
325  char *xrmValue = NULL;
326  if ( xcb_xrm_resource_get_string ( xDB, name, NULL, &xrmValue ) == 0 ) {
327  config_parser_set ( &( extra_options[i] ), xrmValue, source );
328  }
329  if ( xrmValue ) {
330  free ( xrmValue );
331  }
332 
333  g_free ( name );
334  }
335 }
337 {
338  xcb_xrm_database_t *xDB = xcb_xrm_database_from_default ( xcb->connection );
339  if ( xDB ) {
342  xcb_xrm_database_free ( xDB );
343  }
344 }
345 void config_parse_xresource_options_file ( const char *filename )
346 {
347  if ( !filename ) {
348  return;
349  }
350  // Map Xresource entries to rofi config options.
351  xcb_xrm_database_t *xDB = xcb_xrm_database_from_file ( filename );
352  if ( xDB == NULL ) {
353  return;
354  }
357  xcb_xrm_database_free ( xDB );
358 }
359 
363 static void config_parse_cmd_option ( XrmOption *option )
364 {
365  // Prepend a - to the option name.
366  char *key = g_strdup_printf ( "-%s", option->name );
367  switch ( option->type )
368  {
369  case xrm_Number:
370  if ( find_arg_uint ( key, option->value.num ) == TRUE ) {
371  option->source = CONFIG_CMDLINE;
372  }
373  break;
374  case xrm_SNumber:
375  if ( find_arg_int ( key, option->value.snum ) == TRUE ) {
376  option->source = CONFIG_CMDLINE;
377  }
378  break;
379  case xrm_String:
380  if ( find_arg_str ( key, option->value.str ) == TRUE ) {
381  if ( option->mem != NULL ) {
382  g_free ( option->mem );
383  option->mem = NULL;
384  }
385  option->source = CONFIG_CMDLINE;
386  }
387  break;
388  case xrm_Boolean:
389  if ( find_arg ( key ) >= 0 ) {
390  *( option->value.num ) = TRUE;
391  option->source = CONFIG_CMDLINE;
392  }
393  else {
394  g_free ( key );
395  key = g_strdup_printf ( "-no-%s", option->name );
396  if ( find_arg ( key ) >= 0 ) {
397  *( option->value.num ) = FALSE;
398  option->source = CONFIG_CMDLINE;
399  }
400  }
401  break;
402  case xrm_Char:
403  if ( find_arg_char ( key, option->value.charc ) == TRUE ) {
404  option->source = CONFIG_CMDLINE;
405  }
406  break;
407  default:
408  break;
409  }
410  g_free ( key );
411 }
412 
414 {
415  for ( unsigned int i = 0; i < sizeof ( xrmOptions ) / sizeof ( XrmOption ); ++i ) {
416  XrmOption *op = &( xrmOptions[i] );
418  }
419  for ( unsigned int i = 0; i < num_extra_options; ++i ) {
420  XrmOption *op = &( extra_options[i] );
422  }
423 }
424 
425 static gboolean __config_parser_set_property ( XrmOption *option, const Property *p, char **error )
426 {
427  if ( option->type == xrm_String ) {
428  if ( p->type != P_STRING && p->type != P_LIST ) {
429  *error = g_strdup_printf ( "Option: %s needs to be set with a string not a %s.", option->name, PropertyTypeName[p->type] );
430  return TRUE;
431  }
432  gchar *value = NULL;
433  if ( p->type == P_LIST ) {
434  for ( GList *iter = p->value.list; iter != NULL; iter = g_list_next ( iter ) ) {
435  if ( value == NULL ) {
436  value = g_strdup ( (char *) ( iter->data ) );
437  }
438  else {
439  char *nv = g_strjoin ( ",", value, (char *) ( iter->data ), NULL );
440  g_free ( value );
441  value = nv;
442  }
443  }
444  }
445  else {
446  value = g_strdup ( p->value.s );
447  }
448  if ( ( option )->mem != NULL ) {
449  g_free ( option->mem );
450  option->mem = NULL;
451  }
452  *( option->value.str ) = value;
453 
454  // Memory
455  ( option )->mem = *( option->value.str );
456  option->source = CONFIG_FILE_THEME;
457  }
458  else if ( option->type == xrm_Number ) {
459  if ( p->type != P_INTEGER ) {
460  *error = g_strdup_printf ( "Option: %s needs to be set with a number not a %s.", option->name, PropertyTypeName[p->type] );
461  return TRUE;
462  }
463  *( option->value.snum ) = p->value.i;
464  option->source = CONFIG_FILE_THEME;
465  }
466  else if ( option->type == xrm_SNumber ) {
467  if ( p->type != P_INTEGER ) {
468  *error = g_strdup_printf ( "Option: %s needs to be set with a number not a %s.", option->name, PropertyTypeName[p->type] );
469  return TRUE;
470  }
471  *( option->value.num ) = (unsigned int ) ( p->value.i );
472  option->source = CONFIG_FILE_THEME;
473  }
474  else if ( option->type == xrm_Boolean ) {
475  if ( p->type != P_BOOLEAN ) {
476  *error = g_strdup_printf ( "Option: %s needs to be set with a boolean not a %s.", option->name, PropertyTypeName[p->type] );
477  return TRUE;
478  }
479  *( option->value.num ) = ( p->value.b );
480  option->source = CONFIG_FILE_THEME;
481  }
482  else if ( option->type == xrm_Char ) {
483  if ( p->type != P_CHAR ) {
484  *error = g_strdup_printf ( "Option: %s needs to be set with a character not a %s.", option->name, PropertyTypeName[p->type] );
485  return TRUE;
486  }
487  *( option->value.charc ) = ( p->value.c );
488  option->source = CONFIG_FILE_THEME;
489  }
490  else {
491  // TODO add type
492  *error = g_strdup_printf ( "Option: %s is not of a supported type: %s.", option->name, PropertyTypeName[p->type] );
493  return TRUE;
494  }
495  return FALSE;
496 }
497 
498 gboolean config_parse_set_property ( const Property *p, char **error )
499 {
500  for ( unsigned int i = 0; i < sizeof ( xrmOptions ) / sizeof ( XrmOption ); ++i ) {
501  XrmOption *op = &( xrmOptions[i] );
502  if ( g_strcmp0 ( op->name, p->name ) == 0 ) {
503  return __config_parser_set_property ( op, p, error );
504  }
505  }
506  for ( unsigned int i = 0; i < num_extra_options; ++i ) {
507  XrmOption *op = &( extra_options[i] );
508  if ( g_strcmp0 ( op->name, p->name ) == 0 ) {
509  return __config_parser_set_property ( op, p, error );
510  }
511  }
512  *error = g_strdup_printf ( "Option: %s is not found.", p->name );
513  return TRUE;
514 }
515 
517 {
518  for ( unsigned int i = 0; i < ( sizeof ( xrmOptions ) / sizeof ( *xrmOptions ) ); ++i ) {
519  if ( xrmOptions[i].mem != NULL ) {
520  g_free ( xrmOptions[i].mem );
521  xrmOptions[i].mem = NULL;
522  }
523  }
524  for ( unsigned int i = 0; i < num_extra_options; ++i ) {
525  if ( extra_options[i].mem != NULL ) {
526  g_free ( extra_options[i].mem );
527  extra_options[i].mem = NULL;
528  }
529  }
530  if ( extra_options != NULL ) {
531  g_free ( extra_options );
532  }
533 }
534 
535 static void xresource_dump_entry ( const char *namePrefix, XrmOption *option )
536 {
537  printf ( "! \"%s\" ", option->comment );
538  printf ( "Set from: %s\n", ConfigSourceStr[option->source] );
539  if ( option->source == CONFIG_DEFAULT ) {
540  printf ( "! " );
541  }
542  printf ( "%s.%s: %*s", namePrefix, option->name,
543  (int) ( 30 - strlen ( option->name ) ), "" );
544  switch ( option->type )
545  {
546  case xrm_Number:
547  printf ( "%u", *( option->value.num ) );
548  break;
549  case xrm_SNumber:
550  printf ( "%i", *( option->value.snum ) );
551  break;
552  case xrm_String:
553  if ( ( *( option->value.str ) ) != NULL ) {
554  printf ( "%s", *( option->value.str ) );
555  }
556  break;
557  case xrm_Boolean:
558  printf ( "%s", ( *( option->value.num ) == TRUE ) ? "true" : "false" );
559  break;
560  case xrm_Char:
561  if ( *( option->value.charc ) > 32 && *( option->value.charc ) < 127 ) {
562  printf ( "%c", *( option->value.charc ) );
563  }
564  else {
565  printf ( "\\x%02X", *( option->value.charc ) );
566  }
567  break;
568  default:
569  break;
570  }
571  printf ( "\n" );
572 }
573 
575 {
576  const char * namePrefix = "rofi";
577  unsigned int entries = sizeof ( xrmOptions ) / sizeof ( *xrmOptions );
578  for ( unsigned int i = 0; i < entries; ++i ) {
579  // Skip duplicates.
580  if ( ( i + 1 ) < entries ) {
581  if ( xrmOptions[i].value.str == xrmOptions[i + 1].value.str ) {
582  continue;
583  }
584  }
585  xresource_dump_entry ( namePrefix, &( xrmOptions[i] ) );
586  }
587  for ( unsigned int i = 0; i < num_extra_options; i++ ) {
588  xresource_dump_entry ( namePrefix, &( extra_options[i] ) );
589  }
590 }
591 
592 static void config_parse_dump_config_option ( FILE *out, XrmOption *option )
593 {
594  if ( option->type == xrm_Char || option->source == CONFIG_DEFAULT ) {
595  fprintf ( out, "/*" );
596  }
597  fprintf ( out, "\t%s: ", option->name );
598  switch ( option->type )
599  {
600  case xrm_Number:
601  fprintf ( out, "%u", *( option->value.num ) );
602  break;
603  case xrm_SNumber:
604  fprintf ( out, "%i", *( option->value.snum ) );
605  break;
606  case xrm_String:
607  if ( ( *( option->value.str ) ) != NULL ) {
608  // TODO should this be escaped?
609  fprintf ( out, "\"%s\"", *( option->value.str ) );
610  }
611  break;
612  case xrm_Boolean:
613  fprintf ( out, "%s", ( *( option->value.num ) == TRUE ) ? "true" : "false" );
614  break;
615  case xrm_Char:
616  // TODO
617  if ( *( option->value.charc ) > 32 && *( option->value.charc ) < 127 ) {
618  fprintf ( out, "'%c'", *( option->value.charc ) );
619  }
620  else {
621  fprintf ( out, "'\\x%02X'", *( option->value.charc ) );
622  }
623  fprintf ( out, " /* unsupported */" );
624  break;
625  default:
626  break;
627  }
628 
629  fprintf ( out, ";" );
630  if ( option->type == xrm_Char || option->source == CONFIG_DEFAULT ) {
631  fprintf ( out, "*/" );
632  }
633  fprintf ( out, "\n" );
634 }
635 
636 void config_parse_dump_config_rasi_format ( FILE *out, gboolean changes )
637 {
638  fprintf ( out, "configuration {\n" );
639 
640  unsigned int entries = sizeof ( xrmOptions ) / sizeof ( *xrmOptions );
641  for ( unsigned int i = 0; i < entries; ++i ) {
642  // Skip duplicates.
643  if ( ( i + 1 ) < entries ) {
644  if ( xrmOptions[i].value.str == xrmOptions[i + 1].value.str ) {
645  continue;
646  }
647  }
648  if ( !changes || xrmOptions[i].source != CONFIG_DEFAULT ) {
650  }
651  }
652  for ( unsigned int i = 0; i < num_extra_options; i++ ) {
653  if ( !changes || extra_options[i].source != CONFIG_DEFAULT ) {
655  }
656  }
657 
658  fprintf ( out, "}\n" );
659 }
660 
661 static void print_option_string ( XrmOption *xo, int is_term )
662 {
663  int l = strlen ( xo->name );
664  if ( is_term ) {
665  printf ( "\t"color_bold "-%s"color_reset " [string]%-*c%s\n", xo->name, 30 - l, ' ', xo->comment );
666  printf ( "\t"color_italic "%s"color_reset, ( *( xo->value.str ) == NULL ) ? "(unset)" : ( *( xo->value.str ) ) );
667  printf ( " "color_green "(%s)"color_reset "\n", ConfigSourceStr[xo->source] );
668  }
669  else {
670  printf ( "\t-%s [string]%-*c%s\n", xo->name, 30 - l, ' ', xo->comment );
671  printf ( "\t\t%s", ( *( xo->value.str ) == NULL ) ? "(unset)" : ( *( xo->value.str ) ) );
672  printf ( " (%s)\n", ConfigSourceStr[xo->source] );
673  }
674 }
675 static void print_option_number ( XrmOption *xo, int is_term )
676 {
677  int l = strlen ( xo->name );
678  if ( is_term ) {
679  printf ( "\t"color_bold "-%s"color_reset " [number]%-*c%s\n", xo->name, 30 - l, ' ', xo->comment );
680  printf ( "\t"color_italic "%u"color_reset, *( xo->value.num ) );
681  printf ( " "color_green "(%s)"color_reset "\n", ConfigSourceStr[xo->source] );
682  }
683  else {
684  printf ( "\t-%s [number]%-*c%s\n", xo->name, 30 - l, ' ', xo->comment );
685  printf ( "\t\t%u", *( xo->value.num ) );
686  printf ( " (%s)\n", ConfigSourceStr[xo->source] );
687  }
688 }
689 static void print_option_snumber ( XrmOption *xo, int is_term )
690 {
691  int l = strlen ( xo->name );
692  if ( is_term ) {
693  printf ( "\t"color_bold "-%s"color_reset " [number]%-*c%s\n", xo->name, 30 - l, ' ', xo->comment );
694  printf ( "\t"color_italic "%d"color_reset, *( xo->value.snum ) );
695  printf ( " "color_green "(%s)"color_reset "\n", ConfigSourceStr[xo->source] );
696  }
697  else {
698  printf ( "\t-%s [number]%-*c%s\n", xo->name, 30 - l, ' ', xo->comment );
699  printf ( "\t\t%d", *( xo->value.snum ) );
700  printf ( " (%s)\n", ConfigSourceStr[xo->source] );
701  }
702 }
703 static void print_option_char ( XrmOption *xo, int is_term )
704 {
705  int l = strlen ( xo->name );
706  if ( is_term ) {
707  printf ( "\t"color_bold "-%s"color_reset " [character]%-*c%s\n", xo->name, 30 - l, ' ', xo->comment );
708  printf ( "\t"color_italic "%c"color_reset, *( xo->value.charc ) );
709  printf ( " "color_green "(%s)"color_reset "\n", ConfigSourceStr[xo->source] );
710  }
711  else {
712  printf ( "\t-%s [character]%-*c%s\n", xo->name, 30 - l, ' ', xo->comment );
713  printf ( "\t\t%c", *( xo->value.charc ) );
714  printf ( " (%s)\n", ConfigSourceStr[xo->source] );
715  }
716 }
717 static void print_option_boolean ( XrmOption *xo, int is_term )
718 {
719  int l = strlen ( xo->name );
720  if ( is_term ) {
721  printf ( "\t"color_bold "-[no-]%s"color_reset " %-*c%s\n", xo->name, 33 - l, ' ', xo->comment );
722  printf ( "\t"color_italic "%s"color_reset, ( *( xo->value.snum ) ) ? "True" : "False" );
723  printf ( " "color_green "(%s)"color_reset "\n", ConfigSourceStr[xo->source] );
724  }
725  else {
726  printf ( "\t-[no-]%s %-*c%s\n", xo->name, 33 - l, ' ', xo->comment );
727  printf ( "\t\t%s", ( *( xo->value.snum ) ) ? "True" : "False" );
728  printf ( " (%s)\n", ConfigSourceStr[xo->source] );
729  }
730 }
731 
732 static void print_option ( XrmOption *xo, int is_term )
733 {
734  switch ( xo->type )
735  {
736  case xrm_String:
737  print_option_string ( xo, is_term );
738  break;
739  case xrm_Number:
740  print_option_number ( xo, is_term );
741  break;
742  case xrm_SNumber:
743  print_option_snumber ( xo, is_term );
744  break;
745  case xrm_Boolean:
746  print_option_boolean ( xo, is_term );
747  break;
748  case xrm_Char:
749  print_option_char ( xo, is_term );
750  break;
751  default:
752  break;
753  }
754 }
755 void print_options ( void )
756 {
757  // Check output filedescriptor
758  int is_term = isatty ( fileno ( stdout ) );
759  unsigned int entries = sizeof ( xrmOptions ) / sizeof ( *xrmOptions );
760  for ( unsigned int i = 0; i < entries; ++i ) {
761  if ( ( i + 1 ) < entries ) {
762  if ( xrmOptions[i].value.str == xrmOptions[i + 1].value.str ) {
763  continue;
764  }
765  }
766  print_option ( &xrmOptions[i], is_term );
767  }
768  for ( unsigned int i = 0; i < num_extra_options; i++ ) {
769  print_option ( &extra_options[i], is_term );
770  }
771 }
772 
773 void print_help_msg ( const char *option, const char *type, const char*text, const char *def, int isatty )
774 {
775  int l = 37 - strlen ( option ) - strlen ( type );
776  if ( isatty ) {
777  printf ( "\t%s%s%s %s %-*c%s\n", color_bold, option, color_reset, type, l, ' ', text );
778  if ( def != NULL ) {
779  printf ( "\t\t%s%s%s\n", color_italic, def, color_reset );
780  }
781  }
782  else{
783  printf ( "\t%s %s %-*c%s\n", option, type, l, ' ', text );
784  if ( def != NULL ) {
785  printf ( "\t\t%s\n", def );
786  }
787  }
788 }
789 
790 static char * config_parser_return_display_help_entry ( XrmOption *option, size_t l )
791 {
792  int ll = (int) l;
793  switch ( option->type )
794  {
795  case xrm_Number:
796  return g_markup_printf_escaped ( "<b%-*s</b> (%u) <span style='italic' size='small'>%s</span>",
797  ll, option->name, *( option->value.num ), option->comment );
798  case xrm_SNumber:
799  return g_markup_printf_escaped ( "<b%-*s</b> (%d) <span style='italic' size='small'>%s</span>",
800  ll, option->name, *( option->value.snum ), option->comment );
801  case xrm_String:
802  return g_markup_printf_escaped ( "<b>%-*s</b> (%s) <span style='italic' size='small'>%s</span>",
803  ll, option->name,
804  ( *( option->value.str ) != NULL ) ? *( option->value.str ) : "null",
805  option->comment
806  );
807  case xrm_Boolean:
808  return g_markup_printf_escaped ( "<b>%-*s</b> (%s) <span style='italic' size='small'>%s</span>",
809  ll, option->name, ( *( option->value.num ) == TRUE ) ? "true" : "false", option->comment );
810  case xrm_Char:
811  if ( *( option->value.charc ) > 32 && *( option->value.charc ) < 127 ) {
812  return g_markup_printf_escaped ( "<b>%-*s</b> (%c) <span style='italic' size='small'>%s</span>",
813  ll, option->name, *( option->value.charc ), option->comment );
814  }
815  else {
816  return g_markup_printf_escaped ( "<b%-*s</b> (\\x%02X) <span style='italic' size='small'>%s</span>",
817  ll, option->name, *( option->value.charc ), option->comment );
818  }
819  default:
820  break;
821  }
822 
823  return g_strdup ( "failed" );
824 }
825 
826 char ** config_parser_return_display_help ( unsigned int *length )
827 {
828  unsigned int entries = sizeof ( xrmOptions ) / sizeof ( *xrmOptions );
829  char **retv = NULL;
833  size_t max_length = 0;
834  for ( unsigned int i = 0; i < entries; ++i ) {
835  size_t l = strlen ( xrmOptions[i].name );
836  max_length = MAX ( max_length, l );
837  }
838  for ( unsigned int i = 0; i < num_extra_options; i++ ) {
839  size_t l = strlen ( extra_options[i].name );
840  max_length = MAX ( max_length, l );
841  }
845  for ( unsigned int i = 0; i < entries; ++i ) {
846  if ( ( i + 1 ) < entries ) {
847  if ( xrmOptions[i].value.str == xrmOptions[i + 1].value.str ) {
848  continue;
849  }
850  }
851  if ( strncmp ( xrmOptions[i].name, "kb", 2 ) != 0 && strncmp ( xrmOptions[i].name, "ml", 2 ) != 0 && strncmp ( xrmOptions[i].name, "me", 2 ) != 0 ) {
852  continue;
853  }
854 
855  retv = g_realloc ( retv, ( ( *length ) + 2 ) * sizeof ( char* ) );
856 
857  retv[( *length )] = config_parser_return_display_help_entry ( &xrmOptions[i], max_length );
858  ( *length )++;
859  }
860  for ( unsigned int i = 0; i < num_extra_options; i++ ) {
861  if ( strncmp ( extra_options[i].name, "kb", 2 ) != 0 && strncmp ( extra_options[i].name, "ml", 2 ) != 0 && strncmp ( extra_options[i].name, "me", 2 ) != 0 ) {
862  continue;
863  }
864  retv = g_realloc ( retv, ( ( *length ) + 2 ) * sizeof ( char* ) );
865  retv[( *length )] = config_parser_return_display_help_entry ( &extra_options[i], max_length );
866  ( *length )++;
867  }
868  if ( ( *length ) > 0 ) {
869  retv[( *length )] = NULL;
870  }
871  return retv;
872 }
Settings::cache_dir
char * cache_dir
Definition: settings.h:195
ConfigSourceStr
const char *const ConfigSourceStr[]
Definition: xrmoptions.c:46
xcb
xcb_stuff * xcb
Definition: xcb.c:87
xrmoptions.h
color_italic
#define color_italic
Definition: rofi.h:94
config_parse_dump_config_rasi_format
void config_parse_dump_config_rasi_format(FILE *out, gboolean changes)
Dump configuration in rasi format.
Definition: xrmoptions.c:636
Settings::menu_bw
unsigned int menu_bw
Definition: settings.h:64
Settings::line_margin
unsigned int line_margin
Definition: settings.h:158
_PropertyValue::list
GList * list
Definition: rofi-types.h:238
settings.h
Settings::drun_reload_desktop_cache
gboolean drun_reload_desktop_cache
Definition: settings.h:202
config_parse_cmd_option
static void config_parse_cmd_option(XrmOption *option)
Definition: xrmoptions.c:363
Settings::sorting_method
char * sorting_method
Definition: settings.h:121
Settings::color_window
char * color_window
Definition: settings.h:78
__config_parser_set_property
static gboolean __config_parser_set_property(XrmOption *option, const Property *p, char **error)
Definition: xrmoptions.c:425
XrmOption::type
int type
Definition: xrmoptions.c:65
helper_parse_char
char helper_parse_char(const char *arg)
Definition: helper.c:329
Settings::element_height
int element_height
Definition: settings.h:139
Settings::menu_width
int menu_width
Definition: settings.h:66
P_INTEGER
@ P_INTEGER
Definition: rofi-types.h:13
Settings::disable_history
unsigned int disable_history
Definition: settings.h:113
Settings::monitor
char * monitor
Definition: settings.h:156
Settings::color_normal
char * color_normal
Definition: settings.h:75
Settings::drun_match_fields
char * drun_match_fields
Definition: settings.h:124
__config_parse_xresource_options_dynamic
static void __config_parse_xresource_options_dynamic(xcb_xrm_database_t *xDB, enum ConfigSource source)
Definition: xrmoptions.c:317
Settings::run_shell_command
char * run_shell_command
Definition: settings.h:92
rofi-types.h
_xcb_stuff
Definition: xcb-internal.h:44
Settings::window_format
char * window_format
Definition: settings.h:179
print_option_boolean
static void print_option_boolean(XrmOption *xo, int is_term)
Definition: xrmoptions.c:717
Settings::separator_style
char * separator_style
Definition: settings.h:163
config_parse_xresource_dump
void config_parse_xresource_dump(void)
Definition: xrmoptions.c:574
print_help_msg
void print_help_msg(const char *option, const char *type, const char *text, const char *def, int isatty)
Definition: xrmoptions.c:773
find_arg_int
int find_arg_int(const char *const key, int *val)
Definition: helper.c:308
Settings::window_command
char * window_command
Definition: settings.h:96
print_option_snumber
static void print_option_snumber(XrmOption *xo, int is_term)
Definition: xrmoptions.c:689
XrmOption::str
char ** str
Definition: xrmoptions.c:71
XrmOption::name
const char * name
Definition: xrmoptions.c:66
config_parse_xresource_options_file
void config_parse_xresource_options_file(const char *filename)
Definition: xrmoptions.c:345
Settings::click_to_exit
int click_to_exit
Definition: settings.h:181
XrmOptionType
XrmOptionType
Definition: xrmoptions.h:70
Settings::max_history_size
unsigned int max_history_size
Definition: settings.h:189
find_arg
int find_arg(const char *const key)
Definition: helper.c:266
Settings::ssh_client
char * ssh_client
Definition: settings.h:86
Settings::location
WindowLocation location
Definition: settings.h:103
PropertyTypeName
const char *const PropertyTypeName[P_NUM_TYPES]
Definition: rofi-types.c:6
print_option
static void print_option(XrmOption *xo, int is_term)
Definition: xrmoptions.c:732
Settings::theme
char * theme
Definition: settings.h:184
xrm_Char
@ xrm_Char
Definition: xrmoptions.h:80
Settings::fake_transparency
unsigned int fake_transparency
Definition: settings.h:169
Settings::show_match
gboolean show_match
Definition: settings.h:182
Settings::terminal_emulator
char * terminal_emulator
Definition: settings.h:84
config_parse_set_property
gboolean config_parse_set_property(const Property *p, char **error)
Set config option.
Definition: xrmoptions.c:498
P_LIST
@ P_LIST
Definition: rofi-types.h:33
P_BOOLEAN
@ P_BOOLEAN
Definition: rofi-types.h:21
Settings::sidebar_mode
unsigned int sidebar_mode
Definition: settings.h:141
CONFIG_CMDLINE
@ CONFIG_CMDLINE
Definition: xrmoptions.c:60
CONFIG_FILE_THEME
@ CONFIG_FILE_THEME
Definition: xrmoptions.c:59
Settings::run_list_command
char * run_list_command
Definition: settings.h:94
Settings::padding
unsigned int padding
Definition: settings.h:105
Settings::parse_hosts
unsigned int parse_hosts
Definition: settings.h:147
Settings::drun_display_format
char * drun_display_format
Definition: settings.h:130
config_parser_return_display_help_entry
static char * config_parser_return_display_help_entry(XrmOption *option, size_t l)
Definition: xrmoptions.c:790
XrmOption::source
enum ConfigSource source
Definition: xrmoptions.c:77
Settings::color_active
char * color_active
Definition: settings.h:76
find_arg_uint
int find_arg_uint(const char *const key, unsigned int *val)
Definition: helper.c:318
XrmOption::charc
char * charc
Definition: xrmoptions.c:73
Settings::color_urgent
char * color_urgent
Definition: settings.h:77
Settings::icon_theme
char * icon_theme
Definition: settings.h:100
Settings::menu_font
char * menu_font
Definition: settings.h:72
Settings::matching_negate_char
char matching_negate_char
Definition: settings.h:192
P_CHAR
@ P_CHAR
Definition: rofi-types.h:19
Settings::drun_url_launcher
char * drun_url_launcher
Definition: settings.h:132
color_bold
#define color_bold
Definition: rofi.h:92
config_parser_return_display_help
char ** config_parser_return_display_help(unsigned int *length)
Definition: xrmoptions.c:826
config_parse_dump_config_option
static void config_parse_dump_config_option(FILE *out, XrmOption *option)
Definition: xrmoptions.c:592
Property
Definition: rofi-types.h:245
XrmOption::mem
char * mem
Definition: xrmoptions.c:75
XrmOption::value
union XrmOption::@3 value
_PropertyValue::s
char * s
Definition: rofi-types.h:216
print_option_char
static void print_option_char(XrmOption *xo, int is_term)
Definition: xrmoptions.c:703
Settings::fixed_num_lines
unsigned int fixed_num_lines
Definition: settings.h:111
Settings::ssh_command
char * ssh_command
Definition: settings.h:88
Settings::cycle
unsigned int cycle
Definition: settings.h:137
config_xresource_free
void config_xresource_free(void)
Definition: xrmoptions.c:516
rofi.h
Property::type
PropertyType type
Definition: rofi-types.h:249
Settings::matching
char * matching
Definition: settings.h:152
XrmOption::num
unsigned int * num
Definition: xrmoptions.c:69
Settings::window_match_fields
char * window_match_fields
Definition: settings.h:98
config_parse_cmd_options
void config_parse_cmd_options(void)
Definition: xrmoptions.c:413
P_STRING
@ P_STRING
Definition: rofi-types.h:17
config_parser_add_option
void config_parser_add_option(XrmOptionType type, const char *key, void **value, const char *comment)
Definition: xrmoptions.c:241
XrmOption::snum
int * snum
Definition: xrmoptions.c:70
Settings::window_thumbnail
gboolean window_thumbnail
Definition: settings.h:198
CONFIG_XRESOURCES
@ CONFIG_XRESOURCES
Definition: xrmoptions.c:57
Settings::hide_scrollbar
unsigned int hide_scrollbar
Definition: settings.h:165
Settings::modi
char * modi
Definition: settings.h:62
_PropertyValue::i
int i
Definition: rofi-types.h:212
Settings::tokenize
unsigned int tokenize
Definition: settings.h:154
xcb.h
find_arg_str
int find_arg_str(const char *const key, char **val)
Definition: helper.c:276
xrm_String
@ xrm_String
Definition: xrmoptions.h:72
_PropertyValue::b
gboolean b
Definition: rofi-types.h:220
_xcb_stuff::connection
xcb_connection_t * connection
Definition: xcb-internal.h:47
Settings::dpi
int dpi
Definition: settings.h:171
xresource_dump_entry
static void xresource_dump_entry(const char *namePrefix, XrmOption *option)
Definition: xrmoptions.c:535
find_arg_char
int find_arg_char(const char *const key, char *val)
Definition: helper.c:370
Settings::scrollbar_width
unsigned int scrollbar_width
Definition: settings.h:175
Settings::parse_known_hosts
unsigned int parse_known_hosts
Definition: settings.h:149
Settings::menu_columns
unsigned int menu_columns
Definition: settings.h:70
Property::value
PropertyValue value
Definition: rofi-types.h:251
ConfigSource
ConfigSource
Definition: xrmoptions.c:55
CONFIG_FILE
@ CONFIG_FILE
Definition: xrmoptions.c:58
Settings::auto_select
unsigned int auto_select
Definition: settings.h:145
Property::name
char * name
Definition: rofi-types.h:247
Settings::x_offset
int x_offset
Definition: settings.h:109
Settings::combi_hide_mode_prefix
gboolean combi_hide_mode_prefix
Definition: settings.h:190
config_parse_xresource_options
void config_parse_xresource_options(xcb_stuff *xcb)
Definition: xrmoptions.c:336
Settings::drun_categories
char * drun_categories
Definition: settings.h:126
Settings::drun_use_desktop_cache
gboolean drun_use_desktop_cache
Definition: settings.h:201
Settings::fullscreen
unsigned int fullscreen
Definition: settings.h:167
Settings::line_padding
unsigned int line_padding
Definition: settings.h:159
XrmOption
Definition: xrmoptions.c:64
Settings::filter
char * filter
Definition: settings.h:161
__config_parse_xresource_options
static void __config_parse_xresource_options(xcb_xrm_database_t *xDB, enum ConfigSource source)
Definition: xrmoptions.c:299
Settings::fake_background
char * fake_background
Definition: settings.h:177
extra_options
XrmOption * extra_options
Definition: xrmoptions.c:237
Settings::menu_lines
unsigned int menu_lines
Definition: settings.h:68
Settings::case_sensitive
unsigned int case_sensitive
Definition: settings.h:135
CONFIG_DEFAULT
@ CONFIG_DEFAULT
Definition: xrmoptions.c:56
Settings::y_offset
int y_offset
Definition: settings.h:107
XrmOption::pointer
void * pointer
Definition: xrmoptions.c:72
color_reset
#define color_reset
Definition: rofi.h:90
Settings::ignored_prefixes
char * ignored_prefixes
Definition: settings.h:115
Settings::show_icons
gboolean show_icons
Definition: settings.h:81
helper.h
xcb-internal.h
Settings::run_command
char * run_command
Definition: settings.h:90
xrm_SNumber
@ xrm_SNumber
Definition: xrmoptions.h:76
config_parser_set
static void config_parser_set(XrmOption *option, char *xrmValue, enum ConfigSource source)
Definition: xrmoptions.c:263
config
Settings config
Settings::scroll_method
unsigned int scroll_method
Definition: settings.h:174
print_options
void print_options(void)
Definition: xrmoptions.c:755
num_extra_options
unsigned int num_extra_options
Definition: xrmoptions.c:239
xrm_Number
@ xrm_Number
Definition: xrmoptions.h:74
xrm_Boolean
@ xrm_Boolean
Definition: xrmoptions.h:78
_PropertyValue::c
char c
Definition: rofi-types.h:218
print_option_number
static void print_option_number(XrmOption *xo, int is_term)
Definition: xrmoptions.c:675
Settings::combi_modi
char * combi_modi
Definition: settings.h:151
color_green
#define color_green
Definition: rofi.h:96
Settings::sort
unsigned int sort
Definition: settings.h:117
Settings::drun_show_actions
unsigned int drun_show_actions
Definition: settings.h:128
print_option_string
static void print_option_string(XrmOption *xo, int is_term)
Definition: xrmoptions.c:661
Settings::threads
unsigned int threads
Definition: settings.h:173
xrmOptions
static XrmOption xrmOptions[]
Definition: xrmoptions.c:83
XrmOption::comment
const char * comment
Definition: xrmoptions.c:76