# HG changeset patch # User Scoopta # Date 1740096881 28800 # Thu Feb 20 16:14:41 2025 -0800 # Node ID 37a790d878b60c21bbb7f76cf2bfc68ab3e1a647 # Parent 572fa76abb6fdf20af677e03a8ffb88ce0ecfd2d Added drun-ignore_metadata diff --git a/man/wofi.7 b/man/wofi.7 --- a/man/wofi.7 +++ b/man/wofi.7 @@ -59,6 +59,9 @@ .TP .B print_desktop_file=\fIBOOL\fR If true the path to the desktop file and the name of the corresponding action(if present) will be printed to stdout instead of invoking it, default is false. +.TP +.B ignore_metadata=\fIBOOL\fR +If true only the application's name will be searched rather than the normal behavior of searching a large amount of metadata, including category and description, default is false. .SH DRUN When images are enabled drun mode will pull icon themes however being a GTK app it's possible you'll need to run gtk\-update\-icon\-cache to get them to apply. diff --git a/modes/drun.c b/modes/drun.c --- a/modes/drun.c +++ b/modes/drun.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 Scoopta + * Copyright (C) 2019-2025 Scoopta * This file is part of Wofi * Wofi is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ #include #include -static const char* arg_names[] = {"print_command", "display_generic", "disable_prime", "print_desktop_file"}; +static const char* arg_names[] = {"print_command", "display_generic", "disable_prime", "print_desktop_file", "ignore_metadata"}; static struct mode* mode; @@ -45,6 +45,7 @@ static bool display_generic; static bool disable_prime; static bool print_desktop_file; +static bool ignore_metadata; static char* get_search_text(char* file) { GDesktopAppInfo* info = g_desktop_app_info_new_from_filename(file); @@ -65,12 +66,19 @@ } } - char* ret = utils_concat(7, name, file, - exec == NULL ? "" : exec, - description == NULL ? "" : description, - categories == NULL ? "" : categories, - keywords_str, - generic_name == NULL ? "" : generic_name); + char* ret; + + if(ignore_metadata) { + ret = strdup(name); + } else { + ret = utils_concat(7, name, file, + exec == NULL ? "" : exec, + description == NULL ? "" : description, + categories == NULL ? "" : categories, + keywords_str, + generic_name == NULL ? "" : generic_name); + } + free(keywords_str); return ret; } @@ -340,6 +348,7 @@ display_generic = strcmp(config_get(config, "display_generic", "false"), "true") == 0; disable_prime = strcmp(config_get(config, "disable_prime", "false"), "true") == 0; print_desktop_file = strcmp(config_get(config, "print_desktop_file", "false"), "true") == 0; + ignore_metadata = strcmp(config_get(config, "ignore_metadata", "false"), "true") == 0; entries = map_init(); struct wl_list* cache = wofi_read_cache(mode);