prikhi / lightdm-mini-greeter

A Minimal, Configurable, Single-User GTK3 LightDM Greeter
GNU General Public License v3.0
541 stars 48 forks source link

Ability to set password mask character #68

Closed reeseovine closed 3 years ago

reeseovine commented 3 years ago

Instead of the default large dots it would be nice to be able to set it to an asterisk or some other character using the same font settings for the labels.

b- commented 3 years ago

Leaving this here mostly for my own notes, as I’ll see what I can do here. (Can you tag yourself? @b- )

The method in question: https://developer.gnome.org/gtk3/stable/GtkEntry.html#gtk-entry-set-invisible-char

Likely place to put it: https://github.com/prikhi/lightdm-mini-greeter/blob/a9e56a580dcd6110a08d734546cb428eed0913fd/src/ui.c#L224

gonna go to sleep and see if I can hack it in the morning.

prikhi commented 3 years ago

The font for the "bullets" should be inherited by the greeter-theme.font setting.

I'll look into adding a config for the invisible char, but it seems like we'll need to be able to specify a character, no characters, or the default character.

prikhi commented 3 years ago

Mkay, I got it working but the code is kinda dirty at the moment. I attempt parsing twice, first as an int(where -1 means default, 0 means no characters) & then fall back to a string if int parsing fails(taking only the first character of the string). You can even change them to emojis if that's your style:

2021-02-11-011539_819x576_scrot

If string/unicode parsing fails it falls back to the default.

I'll clean it up & push it tomorrow.

prikhi commented 3 years ago

Fixed by 1c23df18aed135ed0bb2703a61e3b20960bb2f79.

Gonna try & at least get the corner border radius in before cutting a new release.

reeseovine commented 3 years ago

I just tested it and it works great! Thanks so much for being so quick to add this!!