1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
Description: allow-disabling-custom-commands
Allows disabling the text entry for the command box. Limiting the commands that
can be run to the values in the environments file.
Author: Patrick Hibbs <30446633+phibbs7@users.noreply.github.com>
Acked-by: Maytham Alsudany <maytham@debian.org>
Bug-Debian: https://bugs.debian.org/1120433
Forwarded: https://lists.sr.ht/~kennylevinsen/greetd-devel/patches/63444
---
--- gtkgreet-0.8/gtkgreet/gtkgreet.h 2025-11-08 14:51:05.056868116 -0500
+++ gtkgreet-0.8/gtkgreet/gtkgreet.h 2025-11-08 14:51:33.693375535 -0500
@@ -27,6 +27,7 @@
gboolean use_layer_shell;
#endif
char* command;
+ gboolean disable_custom_commands;
char* selected_command;
enum QuestionType question_type;
--- gtkgreet-0.8/gtkgreet/main.c 2025-11-08 14:47:28.017040230 -0500
+++ gtkgreet-0.8/gtkgreet/main.c 2025-11-08 14:50:36.988371232 -0500
@@ -19,6 +19,8 @@
static gboolean use_layer_shell = FALSE;
#endif
+static gboolean disable_custom_commands = FALSE;
+
static GOptionEntry entries[] =
{
@@ -28,6 +30,7 @@
{ "command", 'c', 0, G_OPTION_ARG_STRING, &command, "Command to run", "sway"},
{ "background", 'b', 0, G_OPTION_ARG_STRING, &background, "Background image to use", NULL},
{ "style", 's', 0, G_OPTION_ARG_FILENAME, &style, "CSS style to use", NULL },
+ { "disable-custom-commands", 'x', 0, G_OPTION_ARG_NONE, &disable_custom_commands, "Disable custom command entry", NULL},
{ NULL }
};
@@ -142,6 +145,7 @@
gtkgreet->use_layer_shell = use_layer_shell;
#endif
gtkgreet->command = command;
+ gtkgreet->disable_custom_commands = disable_custom_commands;
if (background != NULL) {
gtkgreet->background = gdk_pixbuf_new_from_file(background, &error);
--- gtkgreet-0.8/gtkgreet/window.c 2025-11-08 14:54:53.492927324 -0500
+++ gtkgreet-0.8/gtkgreet/window.c 2025-11-08 15:10:46.630013038 -0500
@@ -113,7 +113,7 @@
gtk_container_add(GTK_CONTAINER(ctx->input_box), question_box);
if (type == QuestionTypeInitial) {
- ctx->command_selector = gtk_combo_box_text_new_with_entry();
+ ctx->command_selector = (gtkgreet->disable_custom_commands == FALSE) ? gtk_combo_box_text_new_with_entry() : gtk_combo_box_text_new();
gtk_widget_set_name(ctx->command_selector, "command-selector");
gtk_widget_set_size_request(ctx->command_selector, 384, -1);
config_update_command_selector(ctx->command_selector);
|