Skip to content

Instantly share code, notes, and snippets.

@boogie666
Created January 10, 2020 13:30
Show Gist options
  • Save boogie666/0d56f23642343f4223a3c884ef590447 to your computer and use it in GitHub Desktop.
Save boogie666/0d56f23642343f4223a3c884ef590447 to your computer and use it in GitHub Desktop.
A Simple Patch for the lightdm-tiny-greeter that adds a default user config
diff --git a/config.h b/config.h
index 00458f2..1585fa1 100644
--- a/config.h
+++ b/config.h
@@ -4,6 +4,8 @@
static const char *user_text = "Username";
/* Password prompt text */
static const char *pass_text = "Password";
+/* Default User */
+static const char *default_user = "";
/* Session name */
static const char *session = "default";
/* GTK UI CSS */
diff --git a/lightdm-tiny-greeter.c b/lightdm-tiny-greeter.c
index 6dc0046..de5dc1c 100644
--- a/lightdm-tiny-greeter.c
+++ b/lightdm-tiny-greeter.c
@@ -84,7 +84,8 @@ show_prompt_cb (LightDMGreeter *ldm, const gchar *text, LightDMPromptType type)
{
gtk_label_set_text (prompt_label, type == LIGHTDM_PROMPT_TYPE_SECRET ? pass_text : user_text);
- gtk_entry_set_text (prompt_entry, "");
+ gtk_entry_set_text (prompt_entry, type != LIGHTDM_PROMPT_TYPE_SECRET ? default_user : "");
+ gtk_editable_set_position (prompt_entry, -1);
gtk_entry_set_visibility (prompt_entry, type == LIGHTDM_PROMPT_TYPE_SECRET ? 0 : 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment