Difference between revisions of "LightDM"

From ArchWiki
Jump to: navigation, search
(it's actually Xfce ;) (strange, but true: http://www.xfce.org/))
(Added Xresources section under troubleshooting heading showing how to fix problems with Xresources variables and lightdm)
(21 intermediate revisions by 9 users not shown)
Line 11: Line 11:
 
{{Article summary end}}
 
{{Article summary end}}
  
[http://www.freedesktop.org/wiki/Software/LightDM LightDM] is a cross-desktop display manager that aims to be the standard display manager for the X server. Its key features are:
+
[http://www.freedesktop.org/wiki/Software/LightDM LightDM] is a cross-desktop [[Display_Manager|display manager]] that aims to be the standard display manager for the X server. Its key features are:
 
* A lightweight codebase
 
* A lightweight codebase
 
* Standards compliant (PAM, ConsoleKit, etc)
 
* Standards compliant (PAM, ConsoleKit, etc)
Line 26: Line 26:
  
 
Other greeters can be installed from the [[AUR]] as well:  
 
Other greeters can be installed from the [[AUR]] as well:  
 +
* {{AUR|lightdm-another-gtk-greeter}}: A GTK3 greeter with custom theme support
 
* {{AUR|lightdm-webkit-greeter}}: A greeter that uses Webkit for theming.
 
* {{AUR|lightdm-webkit-greeter}}: A greeter that uses Webkit for theming.
 
* {{AUR|lightdm-crowd-greeter}}: A 3D greeter that lets you select your profile from 3D characters walking around.
 
* {{AUR|lightdm-crowd-greeter}}: A 3D greeter that lets you select your profile from 3D characters walking around.
 
* {{AUR|lightdm-unity-greeter}}: The greeter used by Ubuntu's [[Unity]].
 
* {{AUR|lightdm-unity-greeter}}: The greeter used by Ubuntu's [[Unity]].
 
* {{AUR|razor-lightdm-greeter}}: A greeter for the [[Razor-qt]] desktop environment.
 
* {{AUR|razor-lightdm-greeter}}: A greeter for the [[Razor-qt]] desktop environment.
* {{AUR|lightdm-pantheon-greeter}}: A LightDM greeter from the ElementaryOS Project.
+
* {{AUR|lightdm-pantheon-greeter}}: A greeter from the ElementaryOS Project.
  
 
You can change the default greeter by changing the configuration file to state:
 
You can change the default greeter by changing the configuration file to state:
Line 36: Line 37:
 
greeter-session=lightdm-yourgreeter-greeter
 
greeter-session=lightdm-yourgreeter-greeter
 
}}
 
}}
 
It is also possible to change the default greeter at compile time by changing the line containing:
 
--with-greeter-session=lightdm-gtk-greeter
 
to
 
--with-greeter-session=lightdm-yourgreeter-greeter
 
  
 
== Enabling LightDM ==
 
== Enabling LightDM ==
Make sure that the '''lightdm''' daemon is [[Daemons#Managing_daemons|started]] at boot.
+
Make sure that the '''lightdm''' daemon is [[Systemd#Running_DMs_under_systemd|started]] at boot:
 +
 +
# systemctl enable lightdm
  
=== Testing ===
+
== Testing ==
 
First, [[Pacman|install]] {{Pkg|xorg-server-xephyr}} from the [[official repositories]].
 
First, [[Pacman|install]] {{Pkg|xorg-server-xephyr}} from the [[official repositories]].
  
Line 51: Line 49:
 
  $ lightdm --test-mode --debug
 
  $ lightdm --test-mode --debug
  
== Optional Configuration and Tweaks ==
+
== Optional configuration and Tweaks ==
 
Some greeters have their own configuration files. For example, {{Pkg|lightdm-gtk3-greeter}} has:
 
Some greeters have their own configuration files. For example, {{Pkg|lightdm-gtk3-greeter}} has:
 
  /etc/lightdm/lightdm-gtk-greeter.conf
 
  /etc/lightdm/lightdm-gtk-greeter.conf
Line 104: Line 102:
 
* A 96x96 PNG icon file in {{ic|/var/lib/AccountsService/icons/johndoe}}
 
* A 96x96 PNG icon file in {{ic|/var/lib/AccountsService/icons/johndoe}}
  
 +
{{Note|As at June 2013, the PNG icon file does not get picked up and a workaround is to put the file in /usr/share/icons/hicolor/64x64/devices directory and call it from your /var/lib/AccountsService/users/johndoe user file.  This directory CAN be read by lightdm and the profile avatar will be rendered correctly.
 +
Also, If using AccountsService, it is not necessary to enable the accounts-daemon.service as it's called automatically with the above configuration.}}
 
==== Sources of Arch-centric 64x64 Icons ====
 
==== Sources of Arch-centric 64x64 Icons ====
 
The {{Pkg|archlinux-artwork}} package from the [[official repositories]] 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:
 
The {{Pkg|archlinux-artwork}} package from the [[official repositories]] 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:
Line 112: Line 112:
 
=== Enabling Autologin ===
 
=== Enabling Autologin ===
 
Edit the LightDM configuration file and change these lines to:
 
Edit the LightDM configuration file and change these lines to:
{{hc|/etc/lightdm/lightdm.conf|<nowiki>
+
{{hc|/etc/lightdm/lightdm.conf|2=
autologin-user=<your_username>
+
autologin-user=''USERNAME''
autologin-user-timeout=0</nowiki>
+
autologin-user-timeout=0
 
}}
 
}}
 
or execute:
 
or execute:
  
  # /usr/lib/lightdm/lightdm/lightdm-set-defaults --autologin=USERNAME
+
  # /usr/lib/lightdm/lightdm/lightdm-set-defaults --autologin=''USERNAME''
  
 
LightDM goes through PAM even when {{ic|autologin}} is enabled. You must be part of the {{ic|autologin}} group to be able to login without entering your password:
 
LightDM goes through PAM even when {{ic|autologin}} is enabled. You must be part of the {{ic|autologin}} group to be able to login without entering your password:
  
 
  # groupadd autologin
 
  # groupadd autologin
  # gpasswd -a ''username'' 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.}}
 
{{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.}}
 +
 +
=== 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 updated the list when more users are added or removed.
  
 
=== Migrating from SLiM ===
 
=== Migrating from SLiM ===
Line 131: Line 134:
  
 
=== NumLock ON ===
 
=== NumLock ON ===
Install the {{ic|numlockx}} package and the edit {{ic| /etc/lightdm/lightdm.conf}} adding the following line:
+
Install the {{Pkg|numlockx}} package and the edit {{ic|/etc/lightdm/lightdm.conf}} adding the following line:
 
  greeter-setup-script=/usr/bin/numlockx on
 
  greeter-setup-script=/usr/bin/numlockx on
  
Line 141: Line 144:
  
 
== Troubleshooting ==
 
== 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/xessions}}) exists and contains at least one .desktop file.
+
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.
 +
 
 +
=== Power menu (restart, poweroff etc.) not available ===
 +
If you have installed lightdm before lightdm-1:1.6.0-6, you might have been struck by this bug: [https://bugs.archlinux.org/task/36613 FS#36613], to fix it run:
 +
# chown polkitd:root /usr/share/polkit-1/rules.d
 +
 
 +
=== 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 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.
  
 
== See Also ==
 
== See Also ==

Revision as of 19:13, 16 October 2013

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end

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, ConsoleKit, 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.

Installation

Install lightdm from the official repositories. You can also install lightdm-develAUR for the development branch or lightdm-bzrAUR from the AUR.

Greeter

You will also need to install a greeter (a user interface for LightDM). The reference greeter is lightdm-gtk-greeter, which is provided by lightdm-gtk3-greeter. KDE users can install lightdm-kde-greeter, a greeter based on Qt.

Other greeters can be installed from the AUR as well:

You can change the default greeter by changing the configuration file to state:

/etc/lightdm/lightdm.conf
greeter-session=lightdm-yourgreeter-greeter

Enabling LightDM

Make sure that the lightdm daemon is started at boot:

# systemctl enable lightdm

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

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

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

and lightdm-kde-greeter has:

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

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

LightDM can be configured by directly modifying its configuration script or by using the lightdm-set-defaults applications that can be found in /usr/lib/lightdm/lightdm/. To see some of the options available, execute:

$ man lightdm-set-defaults

There are, however, a lot more variables to modify in the configuration file than by using the lightdm-set-defaults application.

Changing Background Images/Colors

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

Example:

background=#000000

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 defining the background variable.

Example:

background=/usr/share/pixmaps/black_and_white_photography-wallpaper-1920x1080.jpg

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.

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.

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 image called .face or .face.icon in their home directory. Make sure it can be read by LightDM.

The AccountsService way

The .face way is known to cause issues, fortunately LightDM is able to automatically use AccountsService if it is installed. AccountsService files need to be set up as follows:

  • A user file named after your user in /var/lib/AccountsService/users/johndoe containing:
[User]
Icon=/var/lib/AccountsService/icons/johndoe
  • A 96x96 PNG icon file in /var/lib/AccountsService/icons/johndoe
Note: As at June 2013, the PNG icon file does not get picked up and a workaround is to put the file in /usr/share/icons/hicolor/64x64/devices directory and call it from your /var/lib/AccountsService/users/johndoe user file. This directory CAN be read by lightdm and the profile avatar will be rendered correctly. Also, If using AccountsService, it is not necessary to enable the accounts-daemon.service as it's called automatically with the above configuration.

Sources of Arch-centric 64x64 Icons

The archlinux-artwork package from the official repositories 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-artwork package can be removed.

Enabling Autologin

Edit the LightDM configuration file and change these lines to:

/etc/lightdm/lightdm.conf
autologin-user=USERNAME
autologin-user-timeout=0

or execute:

# /usr/lib/lightdm/lightdm/lightdm-set-defaults --autologin=USERNAME

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

# groupadd 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.

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 updated 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

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 Xfce 4

With the release of Xfce 4.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/local/bin/gdmflexiserver

Alternatively, see the XScreenSaver#Lightdm article.

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.

Power menu (restart, poweroff etc.) not available

If you have installed lightdm before lightdm-1:1.6.0-6, you might have been struck by this bug: FS#36613, to fix it run:

# chown polkitd:root /usr/share/polkit-1/rules.d

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.

See Also