Difference between revisions of "LightDM"

From ArchWiki
Jump to: navigation, search
m (Enabling Lightdm)
(NumLock on by default)
 
(181 intermediate revisions by 73 users not shown)
Line 1: Line 1:
 
[[Category:Display managers]]
 
[[Category:Display managers]]
 
[[es:LightDM]]
 
[[es:LightDM]]
{{Article summary start}}
+
[[fr:LightDM]]
{{Article summary text|Provides an overview and setup of the Light Display Manager.}}
+
[[ja:LightDM]]
{{Article summary heading|Related}}
+
[[ru:LightDM]]
{{Article summary wiki|Display Manager}}
+
[[zh-CN:LightDM]]
{{Article summary end}}
+
{{Related articles start}}
 +
{{Related|Display manager}}
 +
{{Related|GDM}}
 +
{{Related|KDM}}
 +
{{Related|LXDM}}
 +
{{Related articles end}}
  
[http://www.freedesktop.org/wiki/Software/LightDM Lightdm] LightDM is a cross-desktop display manager that aims to be the standard display manager for the X.org X server.
+
[http://www.freedesktop.org/wiki/Software/LightDM LightDM] is a cross-desktop [[display manager]]. Its key features are:
 +
* Cross-desktop - supports different desktop technologies.
 +
* Supports different display technologies (X, Wayland, Mir, ...).
 +
* Lightweight - low memory usage and high performance.
 +
* Supports guest sessions.
 +
* Supports remote login (incoming - XDMCP, VNC, outgoing - XDMCP, pluggable).
 +
* Comprehensive test suite.
 +
* Low code complexity.
 +
 
 +
More details about LightDM's design can be found [http://www.freedesktop.org/wiki/Software/LightDM/Design here].
  
 
== Installation ==
 
== Installation ==
  
Currently, {{AUR|lightdm}} resides in the [[AUR]]. Install it like any other AUR package.
+
[[Install]] {{Pkg|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 {{AUR|lightdm-devel}}. Also available is {{AUR|lightdm-bzr}}.
  
 
=== Greeter===
 
=== Greeter===
You will also need {{AUR|lightdm-gtk-greeter}} from the [[AUR]].
 
  
Other greeters can be installed:
+
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 possible to use LightDM without a greeter, but only if an automatic login is configured. The reference greeter is {{Pkg|lightdm-gtk-greeter}}. LightDM attempts to use this greeter when started unless configured to do otherwise.
* {{AUR|lightdm-webkit-greeter}}
+
* {{AUR|lightdm-crowd-greeter}}
+
* {{AUR|lightdm-kde}}
+
* {{AUR|lightdm-unity-greeter}}
+
  
To change the default greeter ({{AUR|lightdm-gtk-greeter}}) edit the lightdm PKGBUILD and change the line
+
The official repositories contain the following alternative greeters.
--with-greeter-session=lightdm-gtk-greeter
+
* {{Pkg|lightdm-kde-greeter}}: A greeter used with KDE4.
to
+
* lightdm-deepin-greeter ({{Pkg|deepin-session-ui}}): A greeter from the [[Deepin Desktop Environment|Deepin]] project.
--with-greeter-session=lightdm-yourgreeter-greeter
+
  
== Enabling Lightdm ==
+
Other alternative greeters are available in the [[AUR]].
=== Using Initscripts ===
+
* {{AUR|lightdm-webkit2-greeter}}: A greeter that uses Webkit2 for theming. It supersedes {{AUR|lightdm-webkit-greeter}}.
Lightdm can be loaded on startup by entering it in the daemons array in {{ic|rc.conf}}, or by modifying {{ic|inittab}} so it points to lightdm:
+
* {{AUR|lightdm-unity-greeter}}: The greeter used by Ubuntu's [[Unity]].
x:5:respawn:/usr/sbin/lightdm >& /dev/null
+
* {{AUR|lightdm-pantheon-greeter}}: A greeter from the elementary OS project.
{{Note|The 'inittab' method is the preferred method to use a graphical greeter. See [[Display_Manager#inittab_method]].}}
+
  
{{Note|Lightdm needs [[dbus]] to be running.  If you get an error about "respawing too fast" you may have forgotten this.  Ensure that dbus is in your [[DAEMONS]] array in {{ic|rc.conf}}.}}
+
You can set the default greeter by changing the {{ic|[Seat:*]}} section of the LightDM configuration file, like so:
=== Using Systemd ===
+
For systems using systemd, Lightdm also has a systemd service file, start it with {{ic|systemctl start lightdm.service}} or enable it for boot with {{ic|systemctl enable lightdm.service}}.
+
  
See [[Display Manager]] for detailed instructions.
+
{{hc|/etc/lightdm/lightdm.conf|2=
 +
[Seat:*]
 +
...
 +
greeter-session=lightdm-yourgreeter-greeter
 +
}}
  
== Optional Configuration and Tweaks ==
+
Which greeters are available? What values may be assigned to the {{ic|greeter-session}} option? Each {{ic|.desktop}} file in the {{ic|/usr/share/xgreeters}} directory denotes an available greeter. In this example, the {{ic|lightdm-gtk-greeter}} and {{ic|lightdm-kde-greeter}} greeters are available:
=== Changing Background Images/Colors ===
+
$ ls -1 /usr/share/xgreeters/
Users wishing to customize the wallpaper on the greeter screen need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} defining the '''background''' variable.
+
lightdm-gtk-greeter.desktop
 +
lightdm-kde-greeter.desktop
  
Example:
+
== Enabling LightDM ==
background=/usr/share/pixmaps/black_and_white_photography-wallpaper-1920x1080.jpg
+
  
{{Note|It is recommended to place png or jpg files in /usr/share/pixmaps since the lightdm user needs read access to the wallpaper file.}}
+
Make sure to [[enable]] {{ic|lightdm.service}} so LightDM will be started at boot, see also [[Display manager#Loading the display manager]].
  
Users wishing to have a flat color (no image) may simply set the '''background''' variable to a hex color.
+
== Command line tool ==
  
Example:
+
LightDM offers a command line tool, {{ic|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:
  background=#000000
+
  $ dm-tool --help
  
=== Changing the Icon ===
+
== Testing ==
Users wishing to customize the icon on the greeter screen need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} defining the '''logo''' variable.
+
  
Example:
+
First, [[install]] {{Pkg|xorg-server-xephyr}} from the [[official repositories]].
logo=/usr/share/icons/hicolor/64x64/devices/archlinux-icon-crystal-64.svg
+
  
==== Sources of Arch-centric 64x64 Icons ====
+
Then, run LightDM as an X application:
The archlinux-artwork package in [extra] contains some nice examples that install to {{ic|/usr/share/archlinux/icons}} and that can be copied to {{ic|/usr/share/icons/hicolor/64x64/devices}} as follows:
+
$ lightdm --test-mode --debug
 +
 
 +
== Optional configuration and tweaks ==
 +
 
 +
LightDM can be configured by modifying its config file, {{ic|/etc/lightdm/lightdm.conf}}.
 +
 
 +
Some greeters have their own configuration files. For example:
 +
 +
{{Pkg|lightdm-gtk-greeter}}: {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}}
 +
 
 +
{{AUR|lightdm-webkit2-greeter}}: {{ic|/etc/lightdm/lightdm-webkit2-greeter.conf}}
 +
 
 +
{{Pkg|lightdm-kde-greeter}}: {{ic|/etc/lightdm/lightdm-kde-greeter.conf}}
 +
 
 +
=== Changing background images/colors ===
 +
 
 +
You can set the background to a hex color or an image. Some greeters offer more robust background options like background selection from the login screen, random backgrounds, etc.
 +
 
 +
==== GTK+ greeter ====
 +
 
 +
You can use the {{Pkg|lightdm-gtk-greeter-settings}} gui.
 +
 
 +
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:
 +
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=
 +
[greeter]
 +
background=/usr/share/pixmaps/black_and_white_photography-wallpaper-1920x1080.jpg
 +
}}
 +
 
 +
{{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.}}
 +
 
 +
==== Webkit2 greeter ====
 +
 
 +
The {{AUR|lightdm-webkit2-greeter}} allows you to choose a background image directly on the login screen. It also offers an option to display a random image each time it starts. By default, images are sourced from {{ic|/usr/share/backgrounds}}. You can change the background images directory by editing {{ic|lightdm-webkit2-greeter.conf}}. For example:
 +
{{hc|/etc/lightdm/lightdm-webkit2-greeter.conf|2=
 +
[branding]
 +
background_images = /usr/share/backgrounds
 +
}}
 +
 
 +
{{Note|The background images directory must be accessible to the LightDM user so it should not be located anywhere under {{ic|/home}}. }}
 +
 
 +
==== Unity greeter ====
 +
 
 +
Users using the {{AUR|lightdm-unity-greeter}} must edit the {{ic|/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 [https://bbs.archlinux.org/viewtopic.php?id=149945 this] page.
 +
 
 +
==== KDE greeter ====
 +
 
 +
Go to ''System Settings > Login Screen (LightDM)'' and change the background image for your theme.
 +
 
 +
Alternatively, you can edit the {{ic|Background}} variable in {{ic|lightdm-kde-greeter.conf}} :
 +
 
 +
{{hc|/etc/lightdm/lightdm-kde-greeter.conf|2=
 +
[greeter]
 +
theme-name=classic
 +
 
 +
[greeter-settings]
 +
Background=/usr/share/archlinux/wallpaper/archlinux-underground.jpg
 +
BackgroundKeepAspectRatio=true
 +
GreetMessage=Welcome to %hostname%
 +
}}
 +
 
 +
=== Changing your avatar ===
 +
 
 +
{{Tip|If you are using KDE, you can change your avatar in KDE System Settings.}}
 +
 
 +
First, make sure the {{pkg|accountsservice}} package from the [[official repositories]] is installed, then set it up as follows, replacing {{ic|''username''}} with the desired user's login name. The ''.png'' file extension should not be included in the filename.
 +
 
 +
* Edit or create the file {{ic|/var/lib/AccountsService/users/''username''}}, and add the lines
 +
 
 +
[User]
 +
Icon=/var/lib/AccountsService/icons/''username''
 +
 
 +
* Create the file {{ic|/var/lib/AccountsService/icons/''username''}} using a 96x96 PNG image file.
 +
 
 +
{{Note|Make sure that both created files have 644 permissions, use [[chmod]] to correct them.}}
 +
 
 +
=== Sources of Arch-centric 64x64 icons ===
 +
 
 +
The {{AUR|archlinux-artwork}} package from the [[AUR]] contains some nice examples that install to {{ic|/usr/share/archlinux/icons}} and that can be copied to {{ic|/usr/share/icons/hicolor/64x64/devices}} as follows:
  
 
  # find /usr/share/archlinux/icons -name "*64*" -exec cp {} /usr/share/icons/hicolor/64x64/devices \;
 
  # find /usr/share/archlinux/icons -name "*64*" -exec cp {} /usr/share/icons/hicolor/64x64/devices \;
  
After copying, the archlinux-artwork package can be removed.
+
After copying, the {{AUR|archlinux-artwork}} package can be removed.
 +
 
 +
=== Enabling autologin ===
 +
 
 +
Edit the LightDM configuration file and ensure these lines are uncommented and correctly configured:
 +
 
 +
{{hc|/etc/lightdm/lightdm.conf|2=
 +
[Seat:*]
 +
pam-service=lightdm
 +
pam-autologin-service=lightdm-autologin
 +
autologin-user=''username''
 +
autologin-user-timeout=0
 +
session-wrapper=/etc/lightdm/Xsession
 +
}}
 +
 
 +
LightDM goes through [[PAM]] even when {{ic|autologin}} is enabled. You must be part of the {{ic|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:
 +
 
 +
{{hc|/etc/pam.d/lightdm|2=
 +
#%PAM-1.0
 +
'''auth        sufficient  pam_succeed_if.so user ingroup nopasswdlogin'''
 +
auth        include    system-login
 +
...
 +
}}
 +
 
 +
You must then also be part of the {{ic|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 {{Pkg|accountsservice}}, or add the user names to {{ic|/etc/lightdm/users.conf}} under {{ic|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 {{Pkg|numlockx}} package and then edit {{ic|/etc/lightdm/lightdm.conf}}:
 +
{{hc|/etc/lightdm/lightdm.conf|2=
 +
[Seat:*]
 +
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 {{ic|/usr/bin/gdmflexiserver}} consisting of
 +
 
 +
#!/bin/sh
 +
/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 {{ic|~/.dmrc}}. See [[Display manager#Session list]] for more info.
 +
 
 +
=== Adjusting the login window's position ===
 +
 
 +
==== GTK+ greeter ====
 +
 
 +
Users need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} and enter a value for the {{ic|position}} variable. It accepts {{ic|x}} and {{ic|y}} values, either absolute (in pixels) or relative (in percent). Each value can also have an additional anchor location for the window, {{ic|start}}, {{ic|center}} and {{ic|end}} separated from the value by a comma.
 +
 
 +
Example:
 +
 
 +
position=200,start 50%,center
 +
 
 +
== Troubleshooting ==
 +
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 {{ic|xsessions-directory}} (default: {{ic|/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 {{ic|/etc/environment}}
 +
  LANG=pt_PT.utf8
 +
 
 +
=== Xresources not being parsed correctly ===
 +
 
 +
LightDM has an [https://bugs.launchpad.net/lightdm/+bug/1084885 upstream bug] where your [[Xresources]] file will not be loaded with a pre-processor. In practical terms, this means that variables set with {{ic|#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 {{ic|/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 {{Pkg|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:
 +
 
 +
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=
 +
[greeter]
 +
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 {{Pkg|gdk-pixbuf2}} package. See [https://bbs.archlinux.org/viewtopic.php?id=179031 this forum thread].
  
=== Enabling Autologin ===
+
=== LightDM displaying in wrong monitor ===
Edit {{ic|/etc/lightdm/lightdm.conf}} and change these lines to:
+
  
[SeatDefaults]
+
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 {{ic|/etc/lightdm/lightdm.conf}} and change the ''display-setup-script'' parameter like this:
autologin-user=your_user
+
{{hc|/etc/lightdm/lightdm.conf|2=
autologin-user-timeout=0
+
display-setup-script=xrandr --output ''HDMI1'' --primary
pam-service=lightdm-autologin
+
}}
  
==== PAM settings ====
+
Replace ''HDMI1'' with your real monitor ID, which you can find from '''xrandr''' command output.
  
Lightdm goes through PAM even when autologin is enabled. You must make sure that
+
=== LightDM doesn't appear ===
PAM allows the login without prompting for a password.
+
  
Create a new group called, say, {{ic|autologin}} and add yourself to the group:
+
It may happen that your system boots so fast that LightDM service is started before your graphics drivers are properly loaded. If this is your case, you'll want to add the following config to your lightdm.conf file:
  groupadd autologin
+
  gpasswd -a ''username'' autologin
+
  
Edit {{ic|/etc/pam.d/lightdm-autologin}} and locate the line "auth required pam_unix.so". Add new lines before and after it so that the section now reads:
+
    [LightDM]
  auth [success=1 default=ignore] pam_succeed_if.so user ingroup autologin
+
    logind-check-graphical=true
  auth required pam_unix.so
+
  auth optional pam_permit.so
+
  
This ensures that the user will not be asked for a password when logging in through Lightdm autologin.
+
This setting will tell LightDM to wait until graphics devices are ready before spawning greeters/autostarting sessions on them.
  
=== NumLock ON ===
+
=== Pulseaudio not starting automatically ===
Install the {{ic|numlockx}} package and the edit {{ic| /etc/lightdm/lightdm.conf}} adding the following line:
+
greeter-setup-script=/usr/bin/numlockx on
+
  
=== User switching under xfce4 ===
+
See [[PulseAudio#Running]].
With the release of xfce4 v4.10, user switching is supported natively.  To use it with lightdm, users need only to create a symlink:
+
  
# ln -s /usr/lib/lightdm/lightdm/gdmflexiserver /usr/bin/gdmflexiserver
+
== See also ==
  
Alternatively, see the [[https://wiki.archlinux.org/index.php/Xscreensaver#LXDM Xscreensaver#Lightdm]] article.
+
* {{Pkg|light-locker}}, a screen locker using LightDM.
 +
* [https://wiki.ubuntu.com/LightDM Ubuntu Wiki article]
 +
* [http://wiki.gentoo.org/wiki/LightDM Gentoo Wiki article]
 +
* [https://launchpad.net/lightdm Launchpad Page]
 +
* [http://www.mattfischer.com/blog/?tag=lightdm LightDM blog]

Latest revision as of 08:11, 24 May 2016

Related articles

LightDM is a cross-desktop display manager. Its key features are:

  • Cross-desktop - supports different desktop technologies.
  • Supports different display technologies (X, Wayland, Mir, ...).
  • Lightweight - low memory usage and high performance.
  • Supports guest sessions.
  • Supports remote login (incoming - XDMCP, VNC, outgoing - XDMCP, pluggable).
  • Comprehensive test suite.
  • Low code complexity.

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

Installation

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.

Greeter

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 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 the following alternative greeters.

Other alternative greeters are available in the AUR.

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

/etc/lightdm/lightdm.conf
[Seat:*]
...
greeter-session=lightdm-yourgreeter-greeter

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/
lightdm-gtk-greeter.desktop
lightdm-kde-greeter.desktop

Enabling LightDM

Make sure to enable lightdm.service so LightDM will be started at boot, see also Display manager#Loading the display manager.

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

Testing

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

Then, run LightDM as an X application:

$ lightdm --test-mode --debug

Optional configuration and tweaks

LightDM can be configured by modifying its config file, /etc/lightdm/lightdm.conf.

Some greeters have their own configuration files. For example:

lightdm-gtk-greeter: /etc/lightdm/lightdm-gtk-greeter.conf

lightdm-webkit2-greeterAUR: /etc/lightdm/lightdm-webkit2-greeter.conf

lightdm-kde-greeter: /etc/lightdm/lightdm-kde-greeter.conf

Changing background images/colors

You can set the background to a hex color or an image. Some greeters offer more robust background options like background selection from the login screen, random backgrounds, etc.

GTK+ greeter

You can use the lightdm-gtk-greeter-settings gui.

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:

/etc/lightdm/lightdm-gtk-greeter.conf
[greeter]
background=/usr/share/pixmaps/black_and_white_photography-wallpaper-1920x1080.jpg
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.

Webkit2 greeter

The lightdm-webkit2-greeterAUR allows you to choose a background image directly on the login screen. It also offers an option to display a random image each time it starts. By default, images are sourced from /usr/share/backgrounds. You can change the background images directory by editing lightdm-webkit2-greeter.conf. For example:

/etc/lightdm/lightdm-webkit2-greeter.conf
[branding]
background_images = /usr/share/backgrounds
Note: The background images directory must be accessible to the LightDM user so it should not be located anywhere under /home.

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.

Alternatively, you can edit the Background variable in lightdm-kde-greeter.conf :

/etc/lightdm/lightdm-kde-greeter.conf
[greeter]
theme-name=classic

[greeter-settings]
Background=/usr/share/archlinux/wallpaper/archlinux-underground.jpg
BackgroundKeepAspectRatio=true
GreetMessage=Welcome to %hostname%

Changing your avatar

Tip: If you are using KDE, you can change your avatar in KDE System Settings.

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 .png file extension should not be included in the filename.

  • Edit or create the file /var/lib/AccountsService/users/username, and add the lines
[User]
Icon=/var/lib/AccountsService/icons/username
  • Create the file /var/lib/AccountsService/icons/username using a 96x96 PNG image 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:

/etc/lightdm/lightdm.conf
[Seat:*]
pam-service=lightdm
pam-autologin-service=lightdm-autologin
autologin-user=username
autologin-user-timeout=0
session-wrapper=/etc/lightdm/Xsession

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:

/etc/pam.d/lightdm
#%PAM-1.0
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 then edit /etc/lightdm/lightdm.conf:

/etc/lightdm/lightdm.conf
[Seat:*]
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

#!/bin/sh
/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.

Example:

position=200,start 50%,center

Troubleshooting

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

 LANG=pt_PT.utf8

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:

/etc/lightdm/lightdm-gtk-greeter.conf
[greeter]
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:

/etc/lightdm/lightdm.conf
display-setup-script=xrandr --output HDMI1 --primary

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

LightDM doesn't appear

It may happen that your system boots so fast that LightDM service is started before your graphics drivers are properly loaded. If this is your case, you'll want to add the following config to your lightdm.conf file:

   [LightDM]
   logind-check-graphical=true

This setting will tell LightDM to wait until graphics devices are ready before spawning greeters/autostarting sessions on them.

Pulseaudio not starting automatically

See PulseAudio#Running.

See also