LightDM

LightDM is a cross-desktop display manager whose aim is to be the standard display manager for the X server.

The key features (as listed by upstream) include:

  • A well-defined greeter API allowing multiple GUIs.
  • Support for all display manager use cases, with plugins where appropriate.
  • Low code complexity.
  • Fast performance.

Installation[edit | edit source]

USE flags[edit | edit source]

USE flags for x11-misc/lightdm A lightweight display manager

audit Enable support for Linux audit subsystem using sys-process/audit
gnome Add GNOME support
gtk Pull in the gtk+ greeter
introspection Add support for GObject based introspection
non_root Use non-root user by default
qt5 Add support for the Qt 5 application and UI framework
vala Enable bindings for dev-lang/vala

Emerge[edit | edit source]

Install lightdm:

root #emerge --ask x11-misc/lightdm

Configuration[edit | edit source]

The (global) configuration file for LightDM can be found at:

  • /etc/lightdm/lightdm.conf

GTK[edit | edit source]

The GTK greeter configuration can be modified by manually editing the following file:

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

RazorQt[edit | edit source]

The RazorQt greeter currently does not offer any configuration options.

Boot service[edit | edit source]

OpenRC[edit | edit source]

Set LightDM as the default display manager:

FILE /etc/conf.d/xdm
DISPLAYMANAGER="lightdm"

To start LightDM on boot, add dbus and xdm to the default runlevel. dbus is necessary because LightDM depends on it to pass messages:

root #rc-update add dbus default
root #rc-update add xdm default

To start LightDM now:

root #/etc/init.d/dbus start
root #/etc/init.d/xdm start

systemd[edit | edit source]

To start LightDM on boot:

root #systemctl enable lightdm

To start LightDM now:

root #systemctl start lightdm

Command-line tool[edit | edit source]

LightDM includes a command-line tool, dm-tool, which can be used to switch user sessions, lock the current seat, etc. To see a list of available commands, use the --help option:

user $dm-tool --help

For example, to lock the current seat:

user $dm-tool lock

Tips[edit | edit source]

Running commands at log-in[edit | edit source]

A user can run some programs automatically when logging in using LightDM by adding commands in ~/.xprofile, which will be sourced by LightDM. For example:

FILE ~/.xprofile
# Starting redshift, setting the dpi with xrandr and set the brightness to 50% with xbacklight
xrandr --dpi 192 &
redshift-gtk &
xbacklight -set 50 &

Unlock GNOME Keyring[edit | edit source]

To unlock your GNOME Keyring (gnome-base/gnome-keyring) automatically on login, edit /etc/pam.d/lightdm to look as follows. Note: Lines ending with the comment #keyring should be added.

FILE /etc/pam.d/lightdm
auth	   include	system-local-login
auth       optional	pam_gnome_keyring.so #keyring
account    include	system-local-login
session	   include	system-local-login
session    optional	pam_gnome_keyring.so auto_start #keyring


Locking your Screen with elogind After Suspend-Sleep[edit | edit source]

Sometimes you want to lock your screen after elogin triggers suspend or sleep. This can be done easily by doing the following:

Install light-locker:

root #emerge --ask x11-misc/light-locker


Start light-locker once you startup X by putting light-locker & into ~/.xprofile or ~/.xinitrc.

FILE ~/.xprofile
# Starting light-lock with X session
light-locker &


Create lock.sh under /lib64/elogind/system-sleep/ and be sure to add execute permissions to the file.

root #chmod +x /lib64/elogind/system-sleep/lock.sh

(Artix elogind Reference )

Troubleshooting[edit | edit source]

LightDM crashes upon first login if hostname changes during login[edit | edit source]

In some cases LightDM may crash when trying to log in for the first time if the hostname changes in the time between the boot and login (launchpad bug #1677058 ).

This may be encountered if net-misc/networkmanager is using the default settings to obtain the hostname from DHCP server and the hostname differs from the default one set on boot.

To disable NetworkManager hostname setting behavior, set the following line in [main] section of /etc/NetworkManager/NetworkManager.conf:

FILE /etc/NetworkManager/NetworkManager.conf
[main]
...
hostname-mode=none
...

See also[edit | edit source]

External resources[edit | edit source]

This article is issued from Gentoo. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.