Added --no-custom-entry
4 files changed, 26 insertions(+), 4 deletions(-)

M man/wofi.1
M man/wofi.5
M src/main.c
M src/wofi.c
M man/wofi.1 +3 -0
@@ 71,6 71,9 @@ Runs wofi in password mode with an optio
 .B \-e, \-\-exec\-search
 Activiating a search with enter will execute the search not the first result.
 .TP
+.B \-E, \-\-no\-custom\-entry
+Only entries will be submitted to modes, never the content of the search box.
+.TP
 .B \-b, \-\-hide\-scroll
 Hides the scroll bars.
 .TP

          
M man/wofi.5 +3 -0
@@ 73,6 73,9 @@ Runs wofi in password mode using the spe
 .B exec_search=\fIBOOL\fR
 If true activiating a search with enter will execute the search not the first result, default is false.
 .TP
+.B no_custom_entry=\fIBOOL\fR
+If true only entries will be submitted to modes, never the content of the search box, default is false.
+.TP
 .B hide_scroll=\fIBOOL\fR
 If true hides the scroll bars, default is false.
 .TP

          
M src/main.c +16 -2
@@ 1,5 1,5 @@ 
 /*
- *  Copyright (C) 2019-2020 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

          
@@ 82,6 82,7 @@ static void print_usage(char** argv) {
 	printf("--term\t\t\t-t\tSpecifies the terminal to use when running in a term\n");
 	printf("--password\t\t-P\tRuns in password mode\n");
 	printf("--exec-search\t\t-e\tMakes enter always use the search contents not the first result\n");
+	printf("--no-custom-entry\t-E\tOnly entries will be submitted to modes, never the content of the search box\n");
 	printf("--hide-scroll\t\t-b\tHides the scroll bars\n");
 	printf("--matching\t\t-M\tSets the matching method, default is contains\n");
 	printf("--insensitive\t\t-i\tAllows case insensitive searching\n");

          
@@ 342,6 343,12 @@ int main(int argc, char** argv) {
 			.val = 'e'
 		},
 		{
+			.name = "no-custom-entry",
+			.has_arg = no_argument,
+			.flag = NULL,
+			.val = 'E'
+		},
+		{
 			.name = "hide-scroll",
 			.has_arg = no_argument,
 			.flag = NULL,

          
@@ 455,6 462,7 @@ int main(int argc, char** argv) {
 	char* terminal = NULL;
 	char* password_char = "false";
 	char* exec_search = NULL;
+	char* no_custom_entry = NULL;
 	char* hide_scroll = NULL;
 	char* matching = NULL;
 	char* insensitive = NULL;

          
@@ 474,7 482,7 @@ int main(int argc, char** argv) {
 	struct option_node* node;
 
 	int opt;
-	while((opt = getopt_long(argc, argv, "hfc:s:C:dS:W:H:p:x:y:nImk:t:P::ebM:iqvl:aD:L:w:O:GQ:o:r:", opts, NULL)) != -1) {
+	while((opt = getopt_long(argc, argv, "hfc:s:C:dS:W:H:p:x:y:nImk:t:P::eEbM:iqvl:aD:L:w:O:GQ:o:r:", opts, NULL)) != -1) {
 		switch(opt) {
 		case 'h':
 			print_usage(argv);

          
@@ 538,6 546,9 @@ int main(int argc, char** argv) {
 		case 'e':
 			exec_search = "true";
 			break;
+		case 'E':
+			no_custom_entry = "true";
+			break;
 		case 'b':
 			hide_scroll = "true";
 			break;

          
@@ 742,6 753,9 @@ int main(int argc, char** argv) {
 	if(exec_search != NULL) {
 		map_put(config, "exec_search", exec_search);
 	}
+	if(no_custom_entry != NULL) {
+		map_put(config, "no_custom_entry", no_custom_entry);
+	}
 	if(hide_scroll != NULL) {
 		map_put(config, "hide_scroll", hide_scroll);
 	}

          
M src/wofi.c +4 -2
@@ 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

          
@@ 79,6 79,7 @@ static bool mod_ctrl;
 static char* terminal;
 static GtkOrientation outer_orientation;
 static bool exec_search;
+static bool no_custom_entry;
 static struct map* modes;
 static enum matching_mode matching;
 static bool insensitive;

          
@@ 1570,7 1571,7 @@ static void* load_mode(char* _mode, char
 		arg_count = get_arg_count();
 	}
 
-	if(mode == NULL && no_entry != NULL && no_entry()) {
+	if(mode == NULL && !no_custom_entry && no_entry != NULL && no_entry()) {
 		mode = mode_ptr->name;
 	}
 

          
@@ 1787,6 1788,7 @@ void wofi_init(struct map* _config) {
 	terminal = map_get(config, "term");
 	char* password_char = map_get(config, "password_char");
 	exec_search = strcmp(config_get(config, "exec_search", "false"), "true") == 0;
+	no_custom_entry = strcmp(config_get(config, "no_custom_entry", "false"), "true") == 0;
 	bool hide_scroll = strcmp(config_get(config, "hide_scroll", "false"), "true") == 0;
 	matching = config_get_mnemonic(config, "matching", "contains", 3, "contains", "multi-contains", "fuzzy");
 	insensitive = strcmp(config_get(config, "insensitive", "false"), "true") == 0;