Last updated: 2026-10-19 (0.26)
Why build our own
| LightDM + slick-greeter | GDM | Pomelo | |
|---|---|---|---|
| Resident program | lightdm (GLib, D-Bus, AccountsService) | gdm + gnome-shell (full GNOME) | pomelo-dm (only libc + libpam) |
| Still running after login | lightdm + one lightdm child process per session | gdm + one gdm-session-worker per session | pomelo-dm (about 2 MB) + one child process per session |
| Login screen | GTK | gnome-shell | pomelo-greeter (Xlib + cairo, about 22 MB, exits after login) |
Measured in the test environment (1440×900): pomelo-dm uses 2.3 MB resident; the login screen 22 MB, with 0% CPU when idle.
Architecture
systemd ─ pomelo-dm (root)
├─ Xorg :0 vt7 -auth /run/pomelo-dm/:0.auth -nolisten tcp
├─ pomelo-greeter (system account pomelo-greeter, fd 3 = socket to pomelo-dm)
└─ session child process (root): PAM auth → setcred → open_session (pam_systemd registers with logind)
└─ the user's session (identity switched): sh reads /etc/profile and ~/.profile, then exec pomelo-session
One round of the flow:
- Generate a new MIT-MAGIC-COOKIE (16 random bytes), write it to X's authority file, start X, and wait for X to send SIGUSR1 to say it's ready (only the signal from this X is accepted; any left over from the previous round is cleared first).
- Start the login screen as the pomelo-greeter account; it only gets the X cookie and can't touch the password files.
- The login screen sends
LOGIN user password session. pomelo-dm first checks that the account may log in (not root, shell not nologin), then forks a child process for PAM authentication (failures wait at least 1.5 seconds). On success it repliesOK, and the login screen fades out and exits; pomelo-dm ends the login screen's process group and every process of the pomelo-greeter account, then shuts down this X and starts a brand-new X with a new cookie for the user (connections the login screen used, windows it left behind and the cookie it knew are all invalidated). - Once the child process gets the new cookie, it calls setcred and open_session (pam_systemd in common-session registers with logind: XDG_SESSION_TYPE=x11,
XDG_SEAT=seat0, XDG_VTNR=7), writes the user's cookie to
$XDG_RUNTIME_DIR/pomelo-xauth, switches to the user, and runs the session chosen from /usr/share/xsessions (pomelo by default). - When the session ends (logout) → close_session → pomelo-dm shuts down X and goes back to step 1. Every user gets a brand-new X and cookie after the previous one logs out, so nothing from the previous user can linger on the next login screen.
How fast is login (0.19)
Up to 0.18, after a successful login X was shut down entirely and restarted (so everything the login screen left behind was invalidated); on real hardware stopping and starting Xorg takes several seconds,
and the screen goes black for a moment. 0.19 instead writes the new cookie into X's authority file and ends all of the login screen's processes; with no connections left, X "resets" by itself
(clearing all windows and resources and rereading the authority file, so the old cookie stops working immediately) — just as clean, but only a few hundred milliseconds; if no reset happens within 2 seconds, it falls back to restarting X.
Also fixed: the login screen waited an extra second after fading out, and copying the wallpaper now happens after the session starts. In the test environment, the time from pressing Enter to the session starting
went from about 1.5 seconds (not counting the Xorg restart) to about 0.87 seconds, 0.35 of which is the fade-out animation. With POMELO_DM_DEBUG=1 the log prints each stage in milliseconds.
0.20: X no longer resets when the session starts
On real hardware (Intel RKL, modesetting), 0.19 still took about 9 seconds after login for the desktop to appear. /var/log/Xorg.0.log showed X initializing 8 more times after login
(about 0.5 seconds each, blanking the screen): by default X "resets when the last connection closes", and before the window manager connects, pomelo-session runs
short-lived programs like xrdb, xinput, setxkbmap and xrandr, each of which triggered a reset when it exited. GDM starts X with -noreset, so it doesn't have this problem.
0.20 has pomelo-dm keep an idle connection to X from the end of the login screen (after X's reset) until logout, so X no longer resets
(not during the login screen, because that reset is what clears the login screen away). In the test environment, the time from pressing Enter to the menu bar appearing went from 3.2 seconds to 1.0 second.
With POMELO_DM_DEBUG=1, if X resets during a session the log records "X reset during the session".
The remaining time: on the first login after boot, the user's systemd (user@.service) has to finish starting, and pam_systemd waits for it (about 3 seconds on this machine, mostly because the system is still busy right after boot); this is the same whichever login manager is used, and later logins don't wait.
The login screen
- Top: the date (e.g. Mon, Oct 19) and a big clock; battery at the top right.
- Bottom: the selected user in the center (large avatar, name, rounded password box), other users as small avatars to the left and right; click an avatar or use ← → to switch.
- Password box: typing shows dots and a → button appears; a spinner while verifying; on error it shakes, turns red and shows the reason; a ⇪ Caps Lock hint.
- Very bottom: Sleep, Restart, Shut Down. Bottom left: session (only shown when two or more are installed).
- Background: the wallpaper that user last used (read by pomelo-dm "as that user" at login, PNG/JPEG only, saved to /var/lib/pomelo-dm/users/<name>.wallpaper); without a wallpaper it's the same built-in gradient as the desktop. The avatar comes from ~/.face or the AccountsService icon; with neither, a gray silhouette is drawn.
- The language follows the system (/etc/default/locale); all 13 translations are included.
Settings: /etc/pomelo/dm.conf
| Key | Description |
|---|---|
| autologin-user | Account logged in automatically at boot (uses /etc/pam.d/pomelo-dm-autologin, no password asked; only the first time after boot) |
| autologin-session | Session for automatic login |
| default-session | Default session (pomelo) |
| hide-users | Accounts not shown on the login screen (comma-separated) |
| show-other-user | Show "Other user" (type the account name manually) |
| background | Background: user (the user's own wallpaper, default), image (/var/lib/pomelo-dm/background), gradient (built-in gradient) |
| clock | Clock: 24h, 12h, off |
| text-size | Text size: normal, large (18% bigger) |
| user-list | true shows the user list; false shows only the two fields "name and password" |
| power-buttons | Show the Sleep, Restart and Shut Down buttons |
| message | A short message shown at the bottom of the login screen (up to 300 bytes), such as a lost-and-found phone number |
| vt | Which VT the display runs on (7) |
| xserver | Custom X command |
Adjusting it in "Settings → Login Screen" (0.21)
No need to edit dm.conf yourself: the "Login Screen" page in Settings lets you choose the background (the user's own wallpaper / a chosen image / gradient; for a chosen image it lists thumbnails of the current wallpaper, /usr/share/backgrounds and the Pictures folder, or you can type a path), clock, text size, login method (user list, or name and password), "Other user", hidden accounts, automatic login, the login screen message and the power buttons.
- Preview: opens
pomelo-greeter --previewwith the current (not yet applied) settings; press Esc to leave. You can see the result without logging out. - Apply: runs
pomelo-dm --set key=value … [--set-background IMAGE]through pkexec, which asks for the administrator password. pomelo-dm checks every key and value (the account must exist, the session must be installed, no control characters…), keeps the comments and other lines in dm.conf, and writes to a temporary file before renaming it (never half-written). The background image is likewise read in a child process "running as the caller" (so it can't be used to read other people's files), PNG/JPEG only, up to 16384 pixels and 25 MB, saved as /var/lib/pomelo-dm/background. - It takes effect the next time the login screen appears (after logging out or rebooting); pomelo-dm doesn't need restarting.
Security design
An independent security review was done before 0.17 was released, and every problem it found has been fixed (each item below is one of them).
- The login screen runs as an unprivileged system account and only continues after confirming that
setuid(0)fails. - root cannot log in from the login screen (PAM's
pam_succeed_if user != root, and the program blocks it too). - The PAM conversation only answers the first password prompt; if there are other prompts (such as a one-time password), it refuses rather than answering them with the password.
- Nonexistent accounts also wait 2 seconds before the reply, so response times can't be used to guess account names.
- The user's wallpaper and avatar are always read in a child process "switched to that user" (users can set their wallpaper path to /etc/shadow), regular files only (no FIFOs or device files), killed if not read within 5 seconds; on the root side it checks PNG/JPEG, image width and height (avatar up to 4096, wallpaper up to 16384) and file size (2 MB/25 MB), writes with O_EXCL|O_NOFOLLOW, and saves as root:pomelo-greeter 0640 (only the login screen can read it; the home folder may not be readable by others).
- libpomelo's image decoding also has size limits and checks memory allocation, so images with abnormal sizes don't crash the program; if the login screen still crashes repeatedly, pomelo-dm switches to a mode that loads no user images, so nobody gets locked out.
- pomelo-dm checks by itself whether an account may log in (the login screen is unprivileged and can't be trusted); nonexistent and disallowed accounts take the same time to answer.
- Sleep, restart, shut down: refused while someone else is logged in (e.g. via ssh); using
systemctl --check-inhibitors=yes, they're also refused when programs such as system updates ask not to shut down for now. - Session output goes to ~/.xsession-errors; if that can't be opened (e.g. it was replaced with a symlink) the output is discarded, never written to the system log.
- When pomelo-dm exits (e.g. at shutdown), the session gets SIGTERM and is killed if it doesn't exit within 6 seconds; the PAM session is always closed.
- X only listens on a UNIX socket (-nolisten tcp), so programs without the cookie can't connect.
- X is shut down and the cookie replaced before every login and after every logout.
- The systemd unit uses ExecCondition to check whether it's the current login manager; it doesn't block the boot splash (plymouth) from ending, and the fallback of a text login (Ctrl+Alt+F3) is always available.
Installing and switching (important: try it first)
sudo apt install ./pomelo-greeter_*.deb ./pomelo-dm_*.deb
sudo pomelo-dm-switch try # try a Pomelo login screen on Ctrl+Alt+F7 without changing any settings
sudo pomelo-dm-switch on # once you're sure it works, use it at every boot
sudo pomelo-dm-switch off # switch back to the original (GDM/LightDM); remember which one it was
If you can't log in: press Ctrl+Alt+F3 to log in on the text console, run sudo pomelo-dm-switch off, then sudo reboot.
If pomelo-dm is the current login manager when it's removed, it switches back to the original one automatically first.
Fedora, Rocky (0.26)
- PAM uses the Red Hat style (
pomelo-dm.pam.redhat:password-auth,postlogin,pam_selinux close/open,pam_namespace, modeled on the LightDM and GDM settings on Fedora). These systems have no pam-auth-update, so keyring auto-unlock is written directly into pomelo-dm's PAM settings (-auth/-session optional pam_pomelo_keyring.so, skipped if the keyring isn't installed). - SELinux: at install time
semanage fcontextlabels/usr/sbin/pomelo-dmasxdm_exec_t,/var/lib/pomelo-dmasxdm_var_lib_tand/run/pomelo-dmasxdm_var_run_t, so pomelo-dm runs inxdm_tlike GDM and LightDM, and after loginpam_selinuxcan switch the session to the user's security context. Without semanage, a reminder suggests installing policycoreutils-python-utils. These rules are deleted on removal. - The system account is created with
useradd -r; the system language is read from/etc/locale.conf. pomelo-dm-switch: these systems have no/etc/X11/default-display-manager, so the current login manager is determined from ExecStart in the service file thatdisplay-manager.servicelinks to; switching back recognizes/usr/sbin/gdm. status/on/off were tested with a simulated directory tree (POMELO_DM_SWITCH_ROOT).- Not yet tested on physical Fedora or Rocky machines (especially the login flow with SELinux enforcing), so the user manual asks users to start with
try.
Testing (no root needed)
pomelo-dm --test --display :9 --xserver "Xvfb -screen 0 1440x900x24" \
--pam-dir TEST_PAM_DIR --state DIR --sessions SESSIONS_DIR
pomelo-greeter --preview # just shows the login screen; the password demo "succeeds"
Test mode runs as the current user (no identity switch, no logind registration, power buttons only print a message). Verified in this mode: wrong password (the box turns red with the reason after about 1.5 seconds), logging in with the right password, the session still connecting after the new X and cookie replace the old ones before login, the environment variables the session gets, returning to the login screen after logout, automatic login, automatic restart after the login screen crashes and the safe mode after repeated crashes, ending pomelo-dm during a session tearing down the session, X and the login screen, JPEG/PNG files with abnormal sizes (65000×65000) not crashing the login screen, power button hints, "Other user", the session menu, multiple languages, and layouts from 1280×720 to 1920×1080. The "someone else is logged in" check was tested with this host's real loginctl (refused while ssh is active; sessions in the closing state don't count).
Not yet verified; can only be tested on physical machines: identity switching when running as root, pam_systemd/logind registration (permissions for volume, external drives, etc.), a real Xorg on VT 7, pomelo-keyring auto-unlocking with the login password, shutdown/restart.
Not done yet
- "Switch user" while logged in (two people logged in at once).
- Switching to another user from the login screen while the screen is locked (pomelo-lock).
- Remote desktop (xrdp has its own login flow and isn't affected).
- Wayland.