summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/config.c68
-rw-r--r--doc/rofi.155
-rw-r--r--doc/rofi.1.markdown28
-rw-r--r--doc/test_xr.txt4
-rw-r--r--include/mode.h2
-rw-r--r--include/settings.h4
-rw-r--r--include/view.h2
-rw-r--r--include/widgets/box.h2
-rw-r--r--include/widgets/container.h2
-rw-r--r--include/widgets/listview.h2
-rw-r--r--include/widgets/widget.h2
-rw-r--r--include/xcb.h2
-rw-r--r--source/dialogs/drun.c97
-rw-r--r--source/dialogs/window.c82
-rw-r--r--source/xrmoptions.c118
-rwxr-xr-xtest/run_all_tests.sh1
16 files changed, 355 insertions, 116 deletions
diff --git a/config/config.c b/config/config.c
index 8e7acdbc..7c43abf9 100644
--- a/config/config.c
+++ b/config/config.c
@@ -36,39 +36,39 @@ Settings config = {
/** List of enabled modi. */
/** -modi */
#ifdef WINDOW_MODE
- .modi = "window,run,ssh",
+ .modi = "window,run,ssh",
#else
- .modi = "run,ssh",
+ .modi = "run,ssh",
#endif
/** Border width around the window. */
- .menu_bw = 1,
+ .menu_bw = 1,
/** The width of the switcher. (0100 in % > 100 in pixels) */
- .menu_width = 50,
+ .menu_width = 50,
/** Maximum number of options to show. */
- .menu_lines = 15,
+ .menu_lines = 15,
/** Number of columns */
- .menu_columns = 1,
+ .menu_columns = 1,
/** Font */
- .menu_font = "mono 12",
+ .menu_font = "mono 12",
/** Whether to load and show icons */
- .show_icons = FALSE,
+ .show_icons = FALSE,
/** Terminal to use. (for ssh and open in terminal) */
.terminal_emulator = "rofi-sensible-terminal",
.ssh_client = "ssh",
/** Command when executing ssh. */
- .ssh_command = "{terminal} -e {ssh-client} {host}",
+ .ssh_command = "{terminal} -e {ssh-client} {host}",
/** Command when running */
- .run_command = "{cmd}",
+ .run_command = "{cmd}",
/** Command used to list executable commands. empty -> internal */
- .run_list_command = "",
+ .run_list_command = "",
/** Command executed when running application in terminal */
- .run_shell_command = "{terminal} -e {cmd}",
+ .run_shell_command = "{terminal} -e {cmd}",
/** Command executed on accep-entry-custom for window modus */
- .window_command = "xkill -id {window}",
+ .window_command = "xkill -id {window}",
/** No default icon theme, we search Adwaita and gnome as fallback */
- .drun_icon_theme = NULL,
+ .drun_icon_theme = NULL,
/**
* Location of the window.
* Enumeration indicating location or gravity of window.
@@ -80,49 +80,53 @@ Settings config = {
* WL_SOUTH_WEST WL_SOUTH WL_SOUTH_EAST
*
*/
- .location = WL_CENTER,
+ .location = WL_CENTER,
/** Padding between elements */
- .padding = 5,
+ .padding = 5,
/** Y offset */
- .y_offset = 0,
+ .y_offset = 0,
/** X offset */
- .x_offset = 0,
+ .x_offset = 0,
/** Always show config.menu_lines lines, even if less lines are available */
- .fixed_num_lines = TRUE,
+ .fixed_num_lines = TRUE,
/** Do not use history */
- .disable_history = FALSE,
+ .disable_history = FALSE,
/** Sort the displayed list */
- .sort = FALSE,
+ .sort = FALSE,
/** Use levenshtein sorting when matching */
- .levenshtein_sort = FALSE,
+ .levenshtein_sort = FALSE,
/** Case sensitivity of the search */
- .case_sensitive = FALSE,
+ .case_sensitive = FALSE,
/** Cycle through in the element list */
- .cycle = TRUE,
+ .cycle = TRUE,
/** Height of an element in #chars */
- .element_height = 1,
+ .element_height = 1,
/** Sidebar mode, show the modi */
- .sidebar_mode = FALSE,
+ .sidebar_mode = FALSE,
/** auto select */
- .auto_select = FALSE,
+ .auto_select = FALSE,
/** Parse /etc/hosts file in ssh view. */
- .parse_hosts = FALSE,
+ .parse_hosts = FALSE,
/** Parse ~/.ssh/known_hosts file in ssh view. */
- .parse_known_hosts = TRUE,
+ .parse_known_hosts = TRUE,
/** Modi to combine into one view. */
.combi_modi = "window,run",
.tokenize = TRUE,
.matching = "normal",
.matching_method = MM_NORMAL,
+ /** Desktop entry fields to match*/
+ .drun_match_fields = "all",
+ /** Window fields to match in window mode*/
+ .window_match_fields = "all",
/** Monitor */
- .monitor = "-5",
+ .monitor = "-5",
/** set line margin */
.line_margin = 2,
.line_padding = 1,
/** Set filter */
- .filter = NULL,
+ .filter = NULL,
/** Separator style: dash/solid */
- .separator_style = "dash",
+ .separator_style = "dash",
/** Hide scrollbar */
.hide_scrollbar = FALSE,
.fullscreen = FALSE,
diff --git a/doc/rofi.1 b/doc/rofi.1
index e4dc59ac..45411af0 100644
--- a/doc/rofi.1
+++ b/doc/rofi.1
@@ -372,6 +372,61 @@ Note: glob matching might be slow for larger lists
.P
Tokenize the input\.
.
+.P
+\fB\-drun\-match\-fields\fR \fIfield1\fR,\fIfield2\fR,\.\.\.
+.
+.P
+When using drun, match only with the specified Desktop entry fields\. The different fields are:
+.
+.IP "\(bu" 4
+\fBname\fR: the application\'s name
+.
+.IP "\(bu" 4
+\fBgeneric\fR: the application\'s generic name
+.
+.IP "\(bu" 4
+\fBexec\fR: the application\'s executable
+.
+.IP "\(bu" 4
+\fBcategories\fR: the application\'s categories
+.
+.IP "\(bu" 4
+\fBall\fR: all of the above
+.
+.IP
+Default: \fIall\fR
+.
+.IP "" 0
+.
+.P
+\fB\-window\-match\-fields\fR \fIfield1\fR,\fIfield2\fR,\.\.\.
+.
+.P
+When using window mode, match only with the specified fields\. The different fields are:
+.
+.IP "\(bu" 4
+\fBtitle\fR: window\'s title
+.
+.IP "\(bu" 4
+\fBclass\fR: window\'s class
+.
+.IP "\(bu" 4
+\fBrole\fR: window\'s role
+.
+.IP "\(bu" 4
+\fBname\fR: window\'s name
+.
+.IP "\(bu" 4
+\fBdesktop\fR: window\'s current desktop
+.
+.IP "\(bu" 4
+\fBall\fR: all of the above
+.
+.IP
+Default: \fIall\fR
+.
+.IP "" 0
+.
.SS "Layout"
Most of the following options are \fBdeprecated\fR and should not be used\. Please use the new theme format to customize \fBrofi\fR\. More information about the new format can be found in the \fBrofi\-theme(5)\fR manpage\.
.
diff --git a/doc/rofi.1.markdown b/doc/rofi.1.markdown
index 7fafaa30..74513932 100644
--- a/doc/rofi.1.markdown
+++ b/doc/rofi.1.markdown
@@ -215,6 +215,34 @@ Note: glob matching might be slow for larger lists
Tokenize the input.
+`-drun-match-fields` *field1*,*field2*,...
+
+When using drun, match only with the specified Desktop entry fields.
+The different fields are:
+
+* **name**: the application's name
+* **generic**: the application's generic name
+* **exec**: the application's executable
+* **categories**: the application's categories
+* **all**: all of the above
+
+ Default: *all*
+
+`-window-match-fields` *field1*,*field2*,...
+
+When using window mode, match only with the specified fields.
+The different fields are:
+
+* **title**: window's title
+* **class**: window's class
+* **role**: window's role
+* **name**: window's name
+* **desktop**: window's current desktop
+* **all**: all of the above
+
+ Default: *all*
+
+
### Layout
Most of the following options are **deprecated** and should not be used. Please use the new theme format to customize
diff --git a/doc/test_xr.txt b/doc/test_xr.txt
index b5a29e39..14a3ebd5 100644
--- a/doc/test_xr.txt
+++ b/doc/test_xr.txt
@@ -36,8 +36,12 @@ rofi.run-command: bash -c "{cmd}"
rofi.run-shell-command: {terminal} -e {cmd}
! "Command executed on accep-entry-custom for window modus" Set from: File
rofi.window-command: xkill -id {window}
+! "Window fields to match in window mode" Set from: Default
+! rofi.window-match-fields: all
! "Theme to use to look for icons" Set from: Default
! rofi.drun-icon-theme:
+! "Desktop entry fields to match in drun" Set from: Default
+! rofi.drun-match-fields: all
! "Disable history in run/ssh" Set from: File
rofi.disable-history: false
! "Use sorting" Set from: Default
diff --git a/include/mode.h b/include/mode.h
index 4a345c53..02c36161 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -41,7 +41,7 @@
* Type of a mode.
* Access should be done via mode_* functions.
*/
-typedef struct rofi_mode Mode;
+typedef struct rofi_mode Mode;
/**
* Enum used to sum the possible states of ROFI.
diff --git a/include/settings.h b/include/settings.h
index 10a5fc4c..cbd0f2d4 100644
--- a/include/settings.h
+++ b/include/settings.h
@@ -85,6 +85,8 @@ typedef struct
char * run_list_command;
/** Command for window */
char * window_command;
+ /** Window fields to match in window mode */
+ char * window_match_fields;
/** Theme for icons */
char * drun_icon_theme;
@@ -102,6 +104,8 @@ typedef struct
unsigned int disable_history;
/** Toggle to enable sorting. */
unsigned int sort;
+ /** Desktop entries to match in drun */
+ char * drun_match_fields;
/** Use levenshtein sorting when matching */
unsigned int levenshtein_sort;
/** Search case sensitivity */
diff --git a/include/view.h b/include/view.h
index 94a0a0ca..5a3a0855 100644
--- a/include/view.h
+++ b/include/view.h
@@ -39,7 +39,7 @@
*
* @{
*/
-typedef struct RofiViewState RofiViewState;
+typedef struct RofiViewState RofiViewState;
typedef enum
{
/** Create a menu for entering text */
diff --git a/include/widgets/box.h b/include/widgets/box.h
index 92ea407c..9933dd57 100644
--- a/include/widgets/box.h
+++ b/include/widgets/box.h
@@ -45,7 +45,7 @@
/**
* Abstract handle to the box widget internal state.
*/
-typedef struct _box box;
+typedef struct _box box;
/**
* @param parent The widgets parent.
diff --git a/include/widgets/container.h b/include/widgets/container.h
index 8347dc31..b3ff2862 100644
--- a/include/widgets/container.h
+++ b/include/widgets/container.h
@@ -41,7 +41,7 @@
/**
* Abstract handle to the container widget internal state.
*/
-typedef struct _window container;
+typedef struct _window container;
/**
* @param parent The widget's parent
diff --git a/include/widgets/listview.h b/include/widgets/listview.h
index e21f474f..cfd7f6c8 100644
--- a/include/widgets/listview.h
+++ b/include/widgets/listview.h
@@ -39,7 +39,7 @@
* Handle to the listview.
* No internal fields should be accessed directly.
*/
-typedef struct _listview listview;
+typedef struct _listview listview;
/**
* The scrolling type used in the list view
diff --git a/include/widgets/widget.h b/include/widgets/widget.h
index 0ee2ba2c..28e3a8b1 100644
--- a/include/widgets/widget.h
+++ b/include/widgets/widget.h
@@ -48,7 +48,7 @@
* Abstract structure holding internal state of a widget.
* Structure is elaborated in widget-internal.h
*/
-typedef struct _widget widget;
+typedef struct _widget widget;
/**
* Type of the widget. It is used to bubble events to the relevant widget.
diff --git a/include/xcb.h b/include/xcb.h
index 5ddd8cca..d86f580d 100644
--- a/include/xcb.h
+++ b/include/xcb.h
@@ -34,7 +34,7 @@
/**
* xcb data structure type declaration.
*/
-typedef struct _xcb_stuff xcb_stuff;
+typedef struct _xcb_stuff xcb_stuff;
/**
* Global pointer to xcb_stuff instance.
diff --git a/source/dialogs/drun.c b/source/dialogs/drun.c
index 33ce69f8..87efdd54 100644
--- a/source/dialogs/drun.c
+++ b/source/dialogs/drun.c
@@ -92,6 +92,28 @@ typedef struct
typedef struct
{
+ const char *entry_field_name;
+ gboolean enabled;
+} DRunEntryField;
+
+typedef enum
+{
+ DRUN_MATCH_FIELD_NAME,
+ DRUN_MATCH_FIELD_GENERIC,
+ DRUN_MATCH_FIELD_EXEC,
+ DRUN_MATCH_FIELD_CATEGORIES,
+ DRUN_MATCH_NUM_FIELDS,
+} DRunMatchingFields;
+
+static DRunEntryField matching_entry_fields[DRUN_MATCH_NUM_FIELDS] = {
+ { .entry_field_name = "name", .enabled = TRUE, },
+ { .entry_field_name = "generic", .enabled = TRUE, },
+ { .entry_field_name = "exec", .enabled = TRUE, },
+ { .entry_field_name = "categories", .enabled = TRUE, }
+};
+
+typedef struct
+{
NkXdgThemeContext *xdg_context;
DRunModeEntry *entry_list;
unsigned int cmd_list_length;
@@ -100,9 +122,9 @@ typedef struct
GHashTable *disabled_entries;
unsigned int disabled_entries_length;
GThreadPool *pool;
-
unsigned int expected_line_height;
DRunModeEntry quit_entry;
+
// Theme
const gchar *icon_theme;
} DRunModePrivateData;
@@ -112,6 +134,7 @@ struct RegexEvalArg
DRunModeEntry *e;
gboolean success;
};
+
static gboolean drun_helper_eval_cb ( const GMatchInfo *info, GString *res, gpointer data )
{
// TODO quoting is not right? Find description not very clear, need to check.
@@ -554,6 +577,42 @@ static void drun_icon_fetch ( gpointer data, gpointer user_data )
rofi_view_reload ();
}
+static void drun_mode_parse_entry_fields ()
+{
+ char *savept = NULL;
+ // Make a copy, as strtok will modify it.
+ char *switcher_str = g_strdup ( config.drun_match_fields );
+ const char * const sep = ",#";
+ // Split token on ','. This modifies switcher_str.
+ for ( unsigned int i = 0; i < DRUN_MATCH_NUM_FIELDS; i++ ) {
+ matching_entry_fields[i].enabled = FALSE;
+ }
+ for ( char *token = strtok_r ( switcher_str, sep, &savept ); token != NULL;
+ token = strtok_r ( NULL, sep, &savept ) ) {
+ if ( strcmp ( token, "all" ) == 0 ) {
+ for ( unsigned int i = 0; i < DRUN_MATCH_NUM_FIELDS; i++ ) {
+ matching_entry_fields[i].enabled = TRUE;
+ }
+ break;
+ }
+ else {
+ gboolean matched = FALSE;
+ for ( unsigned int i = 0; i < DRUN_MATCH_NUM_FIELDS; i++ ) {
+ const char * entry_name = matching_entry_fields[i].entry_field_name;
+ if ( strcmp ( token, entry_name ) == 0 ) {
+ matching_entry_fields[i].enabled = TRUE;
+ matched = TRUE;
+ }
+ }
+ if ( !matched ) {
+ g_warning ( "Invalid entry name :%s", token );
+ }
+ }
+ }
+ // Free string that was modified by strtok_r
+ g_free ( switcher_str );
+}
+
static int drun_mode_init ( Mode *sw )
{
if ( mode_get_private_data ( sw ) == NULL ) {
@@ -572,6 +631,7 @@ static int drun_mode_init ( Mode *sw )
pd->xdg_context = nk_xdg_theme_context_new ( drun_icon_fallback_themes, NULL );
nk_xdg_theme_preload_themes_icon ( pd->xdg_context, themes );
get_apps ( pd );
+ drun_mode_parse_entry_fields ();
}
return TRUE;
}
@@ -713,22 +773,30 @@ static int drun_token_match ( const Mode *data, rofi_int_matcher **tokens, unsig
int test = 0;
rofi_int_matcher *ftokens[2] = { tokens[j], NULL };
// Match name
- if ( rmpd->entry_list[index].name ) {
- test = helper_token_match ( ftokens, rmpd->entry_list[index].name );
+ if ( matching_entry_fields[DRUN_MATCH_FIELD_NAME].enabled ) {
+ if ( rmpd->entry_list[index].name ) {
+ test = helper_token_match ( ftokens, rmpd->entry_list[index].name );
+ }
}
- // Match generic name
- if ( test == tokens[j]->invert && rmpd->entry_list[index].generic_name ) {
- test = helper_token_match ( ftokens, rmpd->entry_list[index].generic_name );
+ if ( matching_entry_fields[DRUN_MATCH_FIELD_GENERIC].enabled ) {
+ // Match generic name
+ if ( test == tokens[j]->invert && rmpd->entry_list[index].generic_name ) {
+ test = helper_token_match ( ftokens, rmpd->entry_list[index].generic_name );
+ }
}
- // Match executable name.
- if ( test == tokens[j]->invert ) {
- test = helper_token_match ( ftokens, rmpd->entry_list[index].exec );
+ if ( matching_entry_fields[DRUN_MATCH_FIELD_EXEC].enabled ) {
+ // Match executable name.
+ if ( test == tokens[j]->invert ) {
+ test = helper_token_match ( ftokens, rmpd->entry_list[index].exec );
+ }
}
- // Match against category.
- if ( test == tokens[j]->invert ) {
- gchar **list = rmpd->entry_list[index].categories;
- for ( int iter = 0; test == tokens[j]->invert && list && list[iter]; iter++ ) {
- test = helper_token_match ( ftokens, list[iter] );
+ if ( matching_entry_fields[DRUN_MATCH_FIELD_CATEGORIES].enabled ) {
+ // Match against category.
+ if ( test == tokens[j]->invert ) {
+ gchar **list = rmpd->entry_list[index].categories;
+ for ( int iter = 0; test == tokens[j]->invert && list && list[iter]; iter++ ) {
+ test = helper_token_match ( ftokens, list[iter] );
+ }
}
}
if ( test == 0 ) {
@@ -736,6 +804,7 @@ static int drun_token_match ( const Mode *data, rofi_int_matcher **tokens, unsig
}
}
}
+
return match;
}
diff --git a/source/dialogs/window.c b/source/dialogs/window.c
index 1dac2610..d77369c3 100644
--- a/source/dialogs/window.c
+++ b/source/dialogs/window.c
@@ -54,11 +54,40 @@
#include "widgets/textbox.h"
#include "dialogs/window.h"
+#include "timings.h"
+
#define WINLIST 32
#define CLIENTSTATE 10
#define CLIENTWINDOWTYPE 10
+// Fields to match in window mode
+typedef struct
+{
+ char *field_name;
+ gboolean enabled;
+} WinModeField;
+
+typedef enum
+{
+ WIN_MATCH_FIELD_TITLE,
+ WIN_MATCH_FIELD_CLASS,
+ WIN_MATCH_FIELD_ROLE,
+ WIN_MATCH_FIELD_NAME,
+ WIN_MATCH_FIELD_DESKTOP,
+ WIN_MATCH_NUM_FIELDS,
+} WinModeMatchingFields;
+
+static WinModeField matching_window_fields[WIN_MATCH_NUM_FIELDS] = {
+ { .field_name = "title", .enabled = TRUE, },
+ { .field_name = "class", .enabled = TRUE, },
+ { .field_name = "role", .enabled = TRUE, },
+ { .field_name = "name", .enabled = TRUE, },
+ { .field_name = "desktop", .enabled = TRUE, }
+};
+
+static gboolean window_matching_fields_parsed = FALSE;
+
// a manageable window
typedef struct
{
@@ -344,22 +373,22 @@ static int window_match ( const Mode *sw, rofi_int_matcher **tokens, unsigned in
// If hack not in place it would not match queries spanning multiple fields.
// e.g. when searching 'title element' and 'class element'
rofi_int_matcher *ftokens[2] = { tokens[j], NULL };
- if ( c->title != NULL && c->title[0] != '\0' ) {
+ if ( c->title != NULL && c->title[0] != '\0' && matching_window_fields[WIN_MATCH_FIELD_TITLE].enabled ) {
test = helper_token_match ( ftokens, c->title );
}
- if ( test == tokens[j]->invert && c->class != NULL && c->class[0] != '\0' ) {
+ if ( test == tokens[j]->invert && c->class != NULL && c->class[0] != '\0' && matching_window_fields[WIN_MATCH_FIELD_CLASS].enabled ) {
test = helper_token_match ( ftokens, c->class );
}
- if ( test == tokens[j]->invert && c->role != NULL && c->role[0] != '\0' ) {
+ if ( test == tokens[j]->invert && c->role != NULL && c->role[0] != '\0' && matching_window_fields[WIN_MATCH_FIELD_ROLE].enabled ) {
test = helper_token_match ( ftokens, c->role );
}
- if ( test == tokens[j]->invert && c->name != NULL && c->name[0] != '\0' ) {
+ if ( test == tokens[j]->invert && c->name != NULL && c->name[0] != '\0' && matching_window_fields[WIN_MATCH_FIELD_NAME].enabled ) {
test = helper_token_match ( ftokens, c->name );
}
- if ( test == tokens[j]->invert && c->wmdesktopstr != NULL && c->wmdesktopstr[0] != '\0' ) {
+ if ( test == tokens[j]->invert && c->wmdesktopstr != NULL && c->wmdesktopstr[0] != '\0' && matching_window_fields[WIN_MATCH_FIELD_DESKTOP].enabled ) {
test = helper_token_match ( ftokens, c->wmdesktopstr );
}
@@ -372,6 +401,43 @@ static int window_match ( const Mode *sw, rofi_int_matcher **tokens, unsigned in
return match;
}
+static void window_mode_parse_fields ()
+{
+ window_matching_fields_parsed = TRUE;
+ char *savept = NULL;
+ // Make a copy, as strtok will modify it.
+ char *switcher_str = g_strdup ( config.window_match_fields );
+ const char * const sep = ",#";
+ // Split token on ','. This modifies switcher_str.
+ for ( unsigned int i = 0; i < WIN_MATCH_NUM_FIELDS; i++ ) {
+ matching_window_fields[i].enabled = FALSE;
+ }
+ for ( char *token = strtok_r ( switcher_str, sep, &savept ); token != NULL;
+ token = strtok_r ( NULL, sep, &savept ) ) {
+ if ( strcmp ( token, "all" ) == 0 ) {
+ for ( unsigned int i = 0; i < WIN_MATCH_NUM_FIELDS; i++ ) {
+ matching_window_fields[i].enabled = TRUE;
+ }
+ break;
+ }
+ else {
+ gboolean matched = FALSE;
+ for ( unsigned int i = 0; i < WIN_MATCH_NUM_FIELDS; i++ ) {
+ const char * field_name = matching_window_fields[i].field_name;
+ if ( strcmp ( token, field_name ) == 0 ) {
+ matching_window_fields[i].enabled = TRUE;
+ matched = TRUE;
+ }
+ }
+ if ( !matched ) {
+ g_warning ( "Invalid window field name :%s", token );
+ }
+ }
+ }
+ // Free string that was modified by strtok_r
+ g_free ( switcher_str );
+}
+
static unsigned int window_mode_get_num_entries ( const Mode *sw )
{
const ModeModePrivateData *pd = (const ModeModePrivateData *) mode_get_private_data ( sw );
@@ -523,6 +589,9 @@ static int window_mode_init ( Mode *sw )
pd->window_regex = g_regex_new ( "{[-\\w]+(:-?[0-9]+)?}", 0, 0, NULL );
mode_set_private_data ( sw, (void *) pd );
_window_mode_load_data ( sw, FALSE );
+ if ( !window_matching_fields_parsed ) {
+ window_mode_parse_fields ();
+ }
}
return TRUE;
}
@@ -533,6 +602,9 @@ static int window_mode_init_cd ( Mode *sw )
pd->window_regex = g_regex_new ( "{[-\\w]+(:-?[0-9]+)?}", 0, 0, NULL );
mode_set_private_data ( sw, (void *) pd );
_window_mode_load_data ( sw, TRUE );
+ if ( !window_matching_fields_parsed ) {
+ window_mode_parse_fields ();
+ }
}
return TRUE;
}
diff --git a/source/xrmoptions.c b/source/xrmoptions.c
index 9a0f155e..9491db9e 100644
--- a/source/xrmoptions.c
+++ b/source/xrmoptions.c
@@ -81,126 +81,130 @@ typedef struct
* Currently supports string, boolean and number (signed and unsigned).
*/
static XrmOption xrmOptions[] = {
- { xrm_String, "switchers", { .str = &config.modi }, NULL,
+ { xrm_String, "switchers", { .str = &config.modi }, NULL,
"", CONFIG_DEFAULT },
- { xrm_String, "modi", { .str = &config.modi }, NULL,
+ { xrm_String, "modi", { .str = &config.modi }, NULL,
"Enabled modi", CONFIG_DEFAULT },
- { xrm_SNumber, "width", { .snum = &config.menu_width }, NULL,
+ { xrm_SNumber, "width", { .snum = &config.menu_width }, NULL,
"Window width", CONFIG_DEFAULT },
- { xrm_Number, "lines", { .num = &config.menu_lines }, NULL,
+ { xrm_Number, "lines", { .num = &config.menu_lines }, NULL,
"Number of lines", CONFIG_DEFAULT },
- { xrm_Number, "columns", { .num = &config.menu_columns }, NULL,
+ { xrm_Number, "columns", { .num = &config.menu_columns }, NULL,
"Number of columns", CONFIG_DEFAULT },
- { xrm_String, "font", { .str = &config.menu_font }, NULL,
+ { xrm_String, "font", { .str = &config.menu_font }, NULL,
"Font to use", CONFIG_DEFAULT },
- { xrm_Number, "borderwidth", { .num = &config.menu_bw }, NULL,
+ { xrm_Number, "borderwidth", { .num = &config.menu_bw }, NULL,
"", CONFIG_DEFAULT },
- { xrm_Number, "bw", { .num = &config.menu_bw }, NULL,
+ { xrm_Number, "bw", { .num = &config.menu_bw }, NULL,
"Border width", CONFIG_DEFAULT },
- { xrm_Number, "location", { .num = &config.location }, NULL,
+ { xrm_Number, "location", { .num = &config.location }, NULL,
"Location on screen", CONFIG_DEFAULT },
- { xrm_Number, "padding", { .num = &config.padding }, NULL,
+ { xrm_Number, "padding", { .num = &config.padding }, NULL,
"Padding", CONFIG_DEFAULT },
- { xrm_SNumber, "yoffset", { .snum = &config.y_offset }, NULL,
+ { xrm_SNumber, "yoffset", { .snum = &config.y_offset }, NULL,
"Y-offset relative to location", CONFIG_DEFAULT },
- { xrm_SNumber, "xoffset", { .snum = &config.x_offset }, NULL,
+ { xrm_SNumber, "xoffset", { .snum = &config.x_offset }, NULL,
"X-offset relative to location", CONFIG_DEFAULT },
- { xrm_Boolean, "fixed-num-lines", { .num = &config.fixed_num_lines }, NULL,
+ { xrm_Boolean, "fixed-num-lines", { .num = &config.fixed_num_lines }, NULL,
"Always show number of lines", CONFIG_DEFAULT },
- { xrm_Boolean, "show-icons", { .snum = &config.show_icons }, NULL,
+ { xrm_Boolean, "show-icons", { .snum = &config.show_icons }, NULL,
"Whether to load and show icons", CONFIG_DEFAULT },
- { xrm_String, "terminal", { .str = &config.terminal_emulator }, NULL,
+ { xrm_String, "terminal", { .str = &config.terminal_emulator }, NULL,
"Terminal to use", CONFIG_DEFAULT },
- { xrm_String, "ssh-client", { .str = &config.ssh_client }, NULL,
+ { xrm_String, "ssh-client", { .str = &config.ssh_client }, NULL,
"Ssh client to use", CONFIG_DEFAULT },
- { xrm_String, "ssh-command", { .str = &config.ssh_command }, NULL,
+ { xrm_String, "ssh-command", { .str = &config.ssh_command }, NULL,
"Ssh command to execute", CONFIG_DEFAULT },
- { xrm_String, "run-command", { .str = &config.run_command }, NULL,
+ { xrm_String, "run-command", { .str = &config.run_command }, NULL,
"Run command to execute", CONFIG_DEFAULT },
- { xrm_String, "run-list-command", { .str = &config.run_list_command }, NULL,
+ { xrm_String, "run-list-command", { .str = &config.run_list_command }, NULL,
"Command to get extra run targets", CONFIG_DEFAULT },
- { xrm_String, "run-shell-command", { .str = &config.run_shell_command }, NULL,
+ { xrm_String, "run-shell-command", { .str = &config.run_shell_command }, NULL,
"Run command to execute that runs in shell", CONFIG_DEFAULT },
- { xrm_String, "window-command", { .str = &config.window_command }, NULL,
+ { xrm_String, "window-command", { .str = &config.window_command }, NULL,
"Command executed on accep-entry-custom for window modus", CONFIG_DEFAULT },
- { xrm_String, "drun-icon-theme", { .str = &config.drun_icon_theme }, NULL,
+ { xrm_String, "window-match-fields", { .str = &config.window_match_fields }, NULL,
+ "Window fields to match in window mode", CONFIG_DEFAULT },
+ { xrm_String, "drun-icon-theme", { .str = &config.drun_icon_theme }, NULL,
"Theme to use to look for icons", CONFIG_DEFAULT },
- { xrm_Boolean, "disable-history", { .num = &config.disable_history }, NULL,
+ { xrm_String, "drun-match-fields", { .str = &config.drun_match_fields }, NULL,
+ "Desktop entry fields to match in drun", CONFIG_DEFAULT },
+ { xrm_Boolean, "disable-history", { .num = &config.disable_history