From 3c87321258955737a5549b47a13181f747f2cf3a Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Tue, 31 Oct 2023 13:24:37 +0100 Subject: [PATCH] [DRun] Allow url field to be searched and fix c/p error Issue: #1914 --- source/modes/drun.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/modes/drun.c b/source/modes/drun.c index 0bbb8333..b05ce48e 100644 --- a/source/modes/drun.c +++ b/source/modes/drun.c @@ -697,7 +697,7 @@ static void read_desktop_file(DRunModePrivateData *pd, const char *root, pd->entry_list[pd->cmd_list_length].url = g_key_file_get_locale_string(kf, DRUN_GROUP_NAME, "URL", NULL, NULL); } else { - pd->entry_list[pd->cmd_list_length].comment = NULL; + pd->entry_list[pd->cmd_list_length].url = NULL; } pd->entry_list[pd->cmd_list_length].icon_name = g_key_file_get_locale_string(kf, DRUN_GROUP_NAME, "Icon", NULL, NULL); @@ -1456,6 +1456,13 @@ static int drun_token_match(const Mode *data, rofi_int_matcher **tokens, } } } + if (matching_entry_fields[DRUN_MATCH_FIELD_URL].enabled_match) { + + // Match executable name. + if (test == tokens[j]->invert && rmpd->entry_list[index].url) { + test = helper_token_match(ftokens, rmpd->entry_list[index].url); + } + } if (matching_entry_fields[DRUN_MATCH_FIELD_COMMENT].enabled_match) { // Match executable name.