A minimalist LightDM greeter written in Go, powered by gotk3 and inspired by lightdm-mini-greeter.
Many thanks to Matt Fischer for his great blog post.
Example screenshot, unknown artist: please open an issue to credit him/her !
- log in
 - single-user or multi-user mode
 - suited for HiDPI monitor
 - triggers
- poweroff (Ctrl+Shift+P)
 - reboot (Ctrl+Shift+R)
 - suspend (Ctrl+Shift+S)
 - hibernate (Ctrl+Shift+H)
 
 - customization
- wallpaper
- autoscaling on your primary monitor
 - random selection from a directory
 
 - entry
- width
 - colors (font, background and carret)
 
 - label
- choose text for username and password mode
 
 
 - wallpaper
 
🚨 Any help to package µGreeter for your favorite distribution is greatly appreciated 🚨
It's not in the AUR yet, but there is a PKGBUILD available in pkg/AUR.
git clone https://github.com/nizil/lightdm-micro-greeter
cd lightdm-micro-greeter/pkg/AUR
makepkg --installYou need to install lightdm and gtk3. Depending on your distro, you might have to install some -dev or -devel packages.
Obviously, you also need Go.
go install github.com/nizil/lightdm-micro-greeter@latestor
git clone https://github.com/nizil/lightdm-micro-greeter
cd lightdm-micro-greeter
go buildNow, you have to tell LightDM to use this greeter, and this is done in two simples steps:
- Create a XDG desktop entry at 
/usr/share/xgreeterswhich executelightdm-micro-greeter. - Change the LightDM config to use the newly created 
.desktop, it could be done through thegreeter-sessionparameter of/etc/lightdm/lightdm.conf. 
If you have used go install and GOBIN is in your PATH, you could use the desktop and config files provided.
If you have used go build, you could just run the install.sh script as root, which put the built binary inside /usr/bin/, setup the desktop file and a default configuration, and even modify your LightDM configuration file (while doing a backup).
All the configuration is handled within the /etc/lightdm/lightdm-micro-greeter/config.json file.
If the file does not exist, this configuration will be used.
| Parameters | Effect | 
|---|---|
Username | 
keep empty for multi-user mode, providing an username will switch to single-user. | 
Wallpaper | 
path to an image or a directory, /etc/lightdm/lightdm-micro-greeter/ will be prepended. | 
DPI | 
dpi used. | 
Entry.WidthChars | 
entry width in chars. | 
Entry.TextColor | 
entry text color (hexcode or rgba). | 
Entry.BackgroundColor | 
entry background color (hexcode or rgba). | 
Entry.CaretColor | 
entry caret color (hexcode or rgba). | 
Entry.TextAlignment | 
entry text alignement, float between 0 (left) and 1 (right). | 
Label.Margin | 
label margin in pixel. | 
Label.Color | 
label text color (hexcode or rgba). | 
Label.UsernameText | 
label text when waiting for username. | 
Label.PasswordText | 
label text when waiting for password. | 
Label.Color | 
label text color (hexcode or rgba). | 
Box.MarginTop | 
box margin top, in pixel. | 
Box.MarginBottom | 
box margin bottom, in pixel. | 
Box.MarginLeft | 
box margin left, in pixel. | 
Box.MarginRight | 
box margin right, in pixel. | 
If Wallpaper is a directory, it must only contain images, as the greeter will randomly chose a file from this directory.
I had to rely on C macro G_CALLBACK to bind the LightDM server callbacks, which is unfortunately not accessible through the import "C" statement.
To bind a go function to glib events, I've exported few go functions using //export statement and binded them with G_CALLBACK from C code greeter_signal_connect.c.
With this architecture, it has been pretty difficult to avoid the use of global vars to carry information from the UI to these callbacks. If you have any idea how to make a cleaner code here, open a ticket, I'll be more than happy to discuss about it :)