Difference between revisions of "LightDM"

From ArchWiki
Jump to: navigation, search
(GTK+ greeter: Emphasize that a variable must be placed under appropriate section)
(GTK+ greeter: Use the "hc" template. Fiddle with prose.)
Line 85: Line 85:
==== GTK+ greeter ====
==== GTK+ greeter ====
Users wishing to customize the wallpaper on the greeter screen need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} defining the {{ic|background}} variable under the {{ic|[greeter]}} section.
Users wishing to customize the wallpaper on the greeter screen need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} and define the {{ic|background}} variable under the {{ic|[greeter]}} section. For example:
{{Note|It is recommended to place the PNG or JPG file in {{ic|/usr/share/pixmaps}} since the LightDM user needs read access to the wallpaper file.}}
{{Note|It is recommended to place the PNG or JPG file in {{ic|/usr/share/pixmaps}} since the LightDM user needs read access to the wallpaper file.}}

Revision as of 14:46, 25 August 2015


LightDM is a cross-desktop display manager that aims to be the standard display manager for the X server. Its key features are:

  • A lightweight codebase
  • Standards compliant (PAM, logind, etc)
  • A well defined interface between the server and the user interface.
  • Cross-desktop (user interfaces can be written in any toolkit).

More details about LightDM's design can be found here.


Install lightdm. Note that stable releases are even-numbered (1.8, 1.10) while development releases are odd-numbered (1.9, 1.11). These development releases are available with lightdm-develAUR. Also available is lightdm-bzrAUR.


You will probably want to install a greeter. A greeter is a GUI that prompts the user for credentials, lets the user select a session and so on. It's also possible to use LightDM without a greeter, but only if an automatic login is configured. The reference greeter is lightdm-gtk-greeter. LightDM attempts to use this greeter when started unless configured to do otherwise.

The official repositories contain an alternative greeter, lightdm-kde-greeter. It is Qt-based and integrates well with KDE. Other greeters can be installed from the AUR:

You can set the default greeter by changing the [SeatDefaults] section of the LightDM configuration file, like so:


Which greeters are available? What values may be assigned to the greeter-session option? Each .desktop file in the /usr/share/xgreeters directory denotes an available greeter. In this example, the lightdm-gtk-greeter and lightdm-kde-greeter greeters are available:

$ ls -1 /usr/share/xgreeters/

Enabling LightDM

Make sure to enable lightdm.service so LightDM will be started at boot.

Command line tool

LightDM offers a command line tool, dm-tool, which can be used to lock the current seat, switch sessions, etc, which is useful with 'minimalist' window managers and for testing. To see a list of available commands, execute:

$ dm-tool --help


First, install xorg-server-xephyr from the official repositories.

Then, run LightDM as an X application:

$ lightdm --test-mode --debug

Optional configuration and tweaks

Some greeters have their own configuration files. For example, lightdm-gtk-greeter has:


and lightdm-kde-greeter has:


as well as a section in KDE's System Settings (recommended).

LightDM can be configured by modifying its configuration script, /etc/lightdm/lightdm.conf.

Changing background images/colors

Users wishing to have a flat color (no image) may simply set the background variable to a hex color.



If you want to use an image instead, see below.

GTK+ greeter

Users wishing to customize the wallpaper on the greeter screen need to edit /etc/lightdm/lightdm-gtk-greeter.conf and define the background variable under the [greeter] section. For example:

Note: It is recommended to place the PNG or JPG file in /usr/share/pixmaps since the LightDM user needs read access to the wallpaper file.

Unity greeter

Users using the lightdm-unity-greeterAUR must edit the /usr/share/glib-2.0/schemas/com.canonical.unity-greeter.gschema.xml file and then execute:

# glib-compile-schemas /usr/share/glib-2.0/schemas/

According to this page.

KDE greeter

Go to System Settings > Login Screen (LightDM) and change the background image for your theme.

Changing your avatar

The .face way

Users wishing to customize their image on the greeter screen need to place an PNG image called .face or .face.icon in their home directory. Make sure it can be read by LightDM.

Note: As of December 2013, some people have issues where the icon file does not get picked up. The preferred way is to install accountsservice and use the following AccountsService way.

The AccountsService way

The .face way is known to cause issues, fortunately LightDM is able to use AccountsService automatically. First make sure the accountsservice package from the official repositories is installed, then set it up as follows, replacing username with the desired user's login name. The use of the .png file extension is presumably optional. If you are using KDE, you can also change your picture via the KDE System Settings.

  • Edit or create the file /var/lib/AccountsService/users/username, and add the lines
  • Create the file /var/lib/AccountsService/icons/username.png using a 96x96 PNG icon file.
Note: Make sure that both created files have 644 permissions, use chmod to correct them.

Sources of Arch-centric 64x64 icons

The archlinux-artworkAUR package from the AUR contains some nice examples that install to /usr/share/archlinux/icons and that can be copied to /usr/share/icons/hicolor/64x64/devices as follows:

# find /usr/share/archlinux/icons -name "*64*" -exec cp {} /usr/share/icons/hicolor/64x64/devices \;

After copying, the archlinux-artworkAUR package can be removed.

Enabling autologin

Edit the LightDM configuration file and ensure these lines are uncommented and correctly configured:


LightDM goes through PAM even when autologin is enabled. You must be part of the autologin group to be able to login automatically without entering your password:

# groupadd -r autologin
# gpasswd -a username autologin
Note: GNOME users, and by extension any gnome-keyring user will have to set up a blank password to their keyring for it to be unlocked automatically.

Enabling interactive passwordless login

LightDM goes through PAM so you must configure the lightdm configuration of PAM:

auth        sufficient  pam_succeed_if.so user ingroup nopasswdlogin
auth        include     system-login

You must then also be part of the nopasswdlogin group to be able to login interactively without entering your password:

# groupadd -r nopasswdlogin
# gpasswd -a username nopasswdlogin
Note: GNOME users, and by extension any gnome-keyring user may have to follow the instructions at the end of the previous section on enabling autologin.

To create a new user account that logs in automatically and additionally able to login again without a password the user can be created with supplementary membership of both groups, e.g.:

# useradd -mG autologin,nopasswdlogin -s /bin/bash username

Hiding system and services users

To prevent system users from showing-up in the login, install the optional dependency accountsservice, or add the user names to /etc/lightdm/users.conf under hidden-users. The first option has the advantage of not needing to update the list when more users are added or removed.

Migrating from SLiM

Move the contents of xinitrc to xprofile, removing the call to start the window manager or desktop environment.

NumLock on by default

Install the numlockx package and the edit /etc/lightdm/lightdm.conf adding the following line:

greeter-setup-script=/usr/bin/numlockx on

User switching under Xfce4

If you use the Xfce desktop, the Switch User functionality of the Action Button found in your Application Launcher specifically looks for the gdmflexiserver executable in order to enable itself. If you provide it with an executable shell script /usr/bin/gdmflexiserver consisting of

/usr/bin/dm-tool switch-to-greeter

then user switching in Xfce should work with Lightdm.

Alternatively, if you use the Whisker Menu, you can go to Properties -> Commands and change the "Switch Users" command directly to:

 dm-tool switch-to-greeter

You can also switch users from the XScreenSaver lock screen - see XScreenSaver#Lightdm.

Default session

Lightdm, like other DMs, stores the last-selected xsession in ~/.dmrc. See Display manager#Session list for more info.

Adjusting the login window's position

GTK+ greeter

Users need to edit /etc/lightdm/lightdm-gtk-greeter.conf and enter a value for the position variable. It accepts x and y values, either absolute (in pixels) or relative (in percent). Each value can also have an additional anchor location for the window, start, center and end separated from the value by a comma.


position=200,start 50%,center


If you encounter consistent screen flashing and ultimately no LightDM on boot, ensure that you have defined the greeter correctly in LightDM's config file. And if you have correctly defined the GTK greeter, make sure the xsessions-directory (default: /usr/share/xsessions) exists and contains at least one .desktop file.

The same error can happen on lightdm startup if the last used session is not available anymore (eg. you last used gnome and then removed the gnome-session package): the easiest workaround is to temporarily restore the removed package. Another solution might be:

# dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts/User1000 org.freedesktop.Accounts.User.SetXSession string:xfce

This example sets the session "xfce" as default for the user 1000.

Wrong locale displayed

In case of your locale not being displayed correctly in Lightdm add your locale to /etc/environment


Xresources not being parsed correctly

LightDM has an upstream bug where your Xresources file will not be loaded with a pre-processor. In practical terms, this means that variables set with #define are not expanded when called later. You may see this reflected as an all-pink screen if using a custom color set with urxvt. To fix it, edit /etc/lightdm/Xsession and search for the line:

xrdb -nocpp -merge "$file"

Change it to read:

xrdb -merge "$file"

Your Xresources will now be pre-processed so that variables are correctly expanded.

Missing icons with GTK greeter

If you're using lightdm-gtk-greeter as a greeter and it shows placeholder images as icons, make sure valid icon themes and themes are installed and configured. Check the following file:

theme-name=mate      # this should be the name of a directory under /usr/share/themes/
icon-theme-name=mate # this should be the name of a fully featured icons set directory under /usr/share/icons/

LightDM freezes on login attempt

You may find that after entering the correct username and password and attempting to log in, LightDM freezes and you are unable to continue to the desktop. To fix the issue, reinstall the gdk-pixbuf2 package. See this forum thread.

LightDM displaying in wrong monitor

If you are using multiple monitors, LightDM may display in the wrong one (e.g. if your primary monitor is on the right). To force the LightDM login screen to display on a specific monitor, edit /etc/lightdm/lightdm.conf and change the display-setup-script parameter like this:

display-setup-script=xrandr --output HDMI1 --primary

Replace HDMI1 with your real monitor ID, which you can find from xrandr command output.

Pulseaudio not starting automatically

See PulseAudio#Running.

See also