How to Install LightDM Display Manager on Arch Linux

LightDM is a cross-platform X display manager that aims to be fast, extensible, lightweight and with support for multi-desktop. LightDM uses various front-ends to draw login interfaces, which are usually referred to as LightDM greeters. It was written by Robert Ancell and David Edmundson and its license is GNU General Public License, version 3. In this tutorial, we'll take a look at how to install LightDM in Arch Linux.

Main features of LightDM

  • Low memory usage and high performance
  • By default, it has support for guest sessions
  • LightDM has low code complexity
  • Cross-desktop - It supports different desktop technologies.
  • Supports different display technologies X, Mir e.t.c.

Install LightDM on Arch

LightDM is installed from the lightdm package which is available on official Arch repositories. The stable release is even-numbered e.g 1.12 while development releases are odd-numbered e.g 1.13. To install lightdm on Arch, execute the following commands on the terminal.

$ sudo pacman -S lightdm

After successfully installing LightDM, you may want to install LightDM greeter as well. A greeter is a GUI that prompts the user for credentials, lets the user select a session, and so on. Without LightDM greeter, you'll need to have an automatic login for your shell session. The package name to install is lightdm-gtk-greeter.

$ sudo pacman -S lightdm-gtk-greeter

Other alternative LightDM greeters are available on Arch AUR.  These act as lightdm themes which you can install if you want to have a different look and feel. The following  lightdm greeters are available for you:

lightdm-kde-greeter              # on official repository. This is a greeter used with KDE4
lightdm-deepin-greeter         # on official repository. It is a greeter from Deepin project
lightdm-unity-greeter            # on AUR. Used by Unity
lightdm-pantheon-greeter     # on AUR. Used by Elementary OS project.
lightdm-webkit2-greeter       # Also available on AUR. It uses Webkit2 for theming.

To install any package from AUR, use any wrapper like yaourt or pacaur, e.g

$ yaourt -S lightdm-unity-greeter

Set default LightDM greeter

To set a default greeter for your Arch LightDM, edit the file /etc/lightdm/lightdm.conf. You need to change the [Seat:*]. For example, to set the default greeter to lightdm-pantheon-greeter, you'll first install it then change the line as shown.

$ yaourt -S lightdm-pantheon-greeter

Then the line in the file we look something like this:

[Seat:*]
...
greeter-session=lightdm-gtk-greeter

The list of installed lightdm greeters can be found on /usr/share/xgreeters directory. Some greeters have their own configuration files. For example:

lightdm-gtk-greeter ---> /etc/lightdm/lightdm-gtk-greeter.conf
lightdm-webkit2-greeter --->  /etc/lightdm/lightdm-webkit2-greeter.conf
lightdm-kde-greeter ---> /etc/lightdm/lightdm-kde-greeter.conf

Start and Enable LightDM

On Arch, LightDM service is controlled by systemd. The name of the service is lightdm.service. To start the service and set it to start on boot, run:

# systemctl start lightdm.service && systemctl enable lightdm.service

There is a simple command line tool called dm-tool for some which can be used to lock the current seat, switch sessions, etc. It allows multiple users to be logged in on separate ttys. To see a list of available commands, execute:

$ dm-tool --help

To lock the current session and initialize LightDM greeter and login new user using a dm-tool command, type:

$ dm-tool switch-to-greeter

Enable LightDM  autologin

If you want the autologin feature to work with your LightDM, edit the configuration file to ensure the following line are uncommented. The file to be modified is /etc/lightdm/lightdm.conf. There should be a line below:

[Seat:*]
autologin-user=username

Make sure you replace username with the account username you want to set autologin for. After setting this, now add the user to autologin system group:

# groupadd -r autologin
# gpasswd -a username autologin

This will ensure the user doesn't provide password whenever the system boots up.

Changing LightDM avatar

First, you need to install the 'accountsservice' package from the official repositories;

$ sudo pacman -S accountsservice

Now download .png avatar icon file to the system file system and modify the configuration file as shown below:

# vim /var/lib/AccountsService/users/username

It should have the line:

[User]
Icon=/var/lib/AccountsService/icons/username

The png icon file is username.png but the .png extension is not included in the name defined. The created file should have the permission of  644.

# chmod 644 /var/lib/AccountsService/icons/username

A number nice looking avatar icons are provided by the package archlinux-artwork from AUR. It will 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 \;

Set NumLock on by default

If you would like to enable the NumLock on your system to be on always, you need to install numlockx  package then modify the config file:

$ sudo pacman -S numlockx

Then ensure below line exists in LightDM configuration file.

# cat /etc/lightdm/lightdm.conf
[Seat:*]
greeter-setup-script=/usr/bin/numlockx on

LightDM screen locker

You can install light-locker to get screen locker ready.

$ sudo pacman -S light-locker

To lock your screen, use the command:

$ light-locker-command -l

Change background images on Webkit2 LightDM greeter

Please install package from AUR which will allow you to change the background image directly from the login screen.

$ yaourt -S lightdm-webkit2-greeter

This also enables you 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. This is part of LightDM theme setup. For example:

# cat /etc/lightdm/lightdm-webkit2-greeter.conf
[branding]
background_images = /usr/share/backgrounds

Download images you want to use and place them in the specified directory.

Hiding system and services users

In case you want to hide system users from showing up in the login, install the optional dependency 'accountsservice'.

$ sudo pacman -S accountsservice

Allow VNC Server

Lightdm can act as VNC Server, a connection to it can then be made via VNC. Make sure to install tigervnc on the server side and optionally as your VNC client on the client PC. Check How to install TigerVNC on Arch Linux for a complete guide. Also, make sure to set up an authentication password on the server as root:

# vncpasswd /etc/vncpasswd

Now edit your configuration file as below.

# cat /etc/lightdm/lightdm.conf
.....
[VNCServer]
enabled=true
command=Xvnc -rfbauth /etc/vncpasswd
port=5900
listen-address=localhost
width=1024
height=768
depth=24

Change listen-address to the IP address accessible on your LAN or remote machine if not using ssh tunneling. Then configure tigervnc client as shown on the link above. If tunneling traffic, you can use localhost then run the command below on the machine you're connecting from.

$ ssh -X 10.1.10.2 -L 5901:localhost:5901

Wrapping up

We have come to the end of how to set up LightDM in Arch Linux. If you need a Display manager with minimal resource utilization, then LightDM is the tool for you. It works well on older machines and recent ones as well. Configuring  LightDM seems to be a straightforward process, considering that it has only one main configuration file where you can do most of the changes. Other Linux display managers are available, you can go further and try more if you have some time to spare.

Josphat Mutai 12:05 am

About Josphat Mutai

Hat Certified Engineer with more than 2 years experience managing critical Cloud Infrastructures and Services. Passionate about Technology and loves testing and reviewing gadgets and Open-source tools.

Author Archive Page

Have anything to say?

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.