Difference between revisions of "LightDM"

From ArchWiki
Jump to: navigation, search
(Changing the Icon: added section for some Arch icons)
(Greeter)
(42 intermediate revisions by 23 users not shown)
Line 1: Line 1:
[[Category:Display managers (English)]]
+
[[Category:Display managers]]
{{i18n|LightDM}}
+
[[es:LightDM]]
 
+
[[fr:LightDM]]
 
{{Article summary start}}
 
{{Article summary start}}
 
{{Article summary text|Provides an overview and setup of the Light Display Manager.}}
 
{{Article summary text|Provides an overview and setup of the Light Display Manager.}}
 
{{Article summary heading|Related}}
 
{{Article summary heading|Related}}
 
{{Article summary wiki|Display Manager}}
 
{{Article summary wiki|Display Manager}}
 +
{{Article summary wiki|GDM}}
 +
{{Article summary wiki|KDM}}
 +
{{Article summary wiki|SLiM}}
 
{{Article summary end}}
 
{{Article summary 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 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 [http://www.freedesktop.org/wiki/Software/LightDM/Design here].
  
 
== Installation ==
 
== Installation ==
 +
Install {{Pkg|lightdm}} from the [[official repositories]] or {{AUR|lightdm-bzr}} from the [[AUR]].
  
Currently, {{AUR|lightdm}} resides in the [[AUR]]. Install it like any other AUR package.
+
=== 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 either {{Pkg|lightdm-gtk3-greeter}} or {{Pkg|lightdm-gtk2-greeter}}. KDE users can install {{Pkg|lightdm-kde-greeter}}, a greeter based on Qt.
  
== Enabling Lightdm ==
+
Other greeters can be installed from the [[AUR]] as well:
Lightdm can be loaded on startup by entering it in the daemons array in {{ic|rc.conf}}, or by appending the following line to {{ic|inittab}}:
+
* {{AUR|lightdm-webkit-greeter}}: A greeter that uses Webkit for theming.
x:5:respawn:/usr/sbin/lightdm 2>&1 /dev/null
+
* {{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 bye Ubuntu's [[Unity]].
 +
* {{AUR|razor-lightdm-greeter}}: A greeter for the [[Razor-qt]] desktop environment.
 +
* {{AUR|lightdm-pantheon-greeter}}: A LightDM greeter from the ElementaryOS Project.
  
{{Note|The 'inittab' method is the preferred method to use a graphical greeter.}}
+
You can 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
  
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}}.
+
Or, more easily, change the configuration file to state:
 +
{{hc|/etc/lightdm/lightdm.conf|
 +
greeter-session=lightdm-kde-greeter
 +
}}
  
See [[Display Manager]] for detailed instructions.
+
== Enabling LightDM ==
 +
Make sure that the '''lightdm''' daemon is [[Daemons#Managing_daemons|started]] at boot.
  
== Required Configuration ==
+
=== Testing ===
Lightdm will only show a blank screen until a greeter is chosen.  Define one in {{ic| /etc/lightdm/lightdm.conf}} as follows:
+
First, [[Pacman|install]] {{Pkg|xorg-server-xephyr}} from the [[official repositories]].
  
Example:
+
Then, run LightDM as an X application:
  greeter-session=lightdm-gtk-greeter
+
  $ lightdm --test-mode --debug
  
Additional greeters are available in the [[AUR]]. To see which greeters are installed, look in {{ic|/usr/share/xgreeters}}. Do not include the .desktop extension.
+
== Optional Configuration and Tweaks ==
 +
Some greeters have their own configuration files. For example, {{Pkg|lightdm-gtk3-greeter}}  and {{Pkg|lightdm-gtk2-greeter}} have:
 +
/etc/lightdm/lightdm-gtk-greeter.conf
 +
and {{Pkg|lightdm-kde-greeter}} has:
 +
/etc/lightdm/lightdm-kde-greeter.conf
 +
as well as a section in KDE's System Settings (recommended).
  
{{Note|The following requires [http://www.archlinux.org/packages/extra/i686/xorg-server-xephyr/ xorg-server-xephyr] to be installed.}}
+
LightDM can be configured by directly modifying its configuration script or by using the {{ic|lightdm-set-defaults}} applications
 +
that can be found in {{ic|/usr/lib/lightdm/lightdm/}}. To see some of the options available, execute:
 +
$ man lightdm-set-defaults
  
It is possible to test lightdm with the following command:
+
There are, however, a lot more variables to modify in the configuration file than by using the {{ic|lightdm-set-defaults}} application.
{{bc|$ lightdm --test-mode -c /etc/lightdm/lightdm.conf}}
+
  
== Optional Configuration and Tweaks ==
 
 
=== Changing Background Images/Colors ===
 
=== 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 {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} defining the '''background''' variable.
 
Users wishing to customize the wallpaper on the greeter screen need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} defining the '''background''' variable.
  
Line 44: Line 78:
 
  background=/usr/share/pixmaps/black_and_white_photography-wallpaper-1920x1080.jpg
 
  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.}}
+
==== 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/
  
Users wishing to have a flat color (no image) may simply set the '''background''' variable to a hex color.
+
According to [https://bbs.archlinux.org/viewtopic.php?id=149945 this] page.
  
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.}}
background=#000000
+
 
 +
==== KDE Greeter ====
 +
Go to ''System Settings > Login Screen (LightDM)'' and change the background image for your theme.
  
 
=== Changing the Icon ===
 
=== Changing the Icon ===
Users wishing to customize the icon (by default, the 'computer' graphic) should follow this 3-step procedure:
+
Users wishing to customize the icon on the greeter screen need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} defining the '''logo''' variable.
  
# Copy a 64x64 image to {{ic|/usr/share/icons/hicolor/64x64/devices}}
+
Example:
# Run {{ic|gtk-update-icon-cache /usr/share/icons/hicolor}}
+
logo=/usr/share/icons/hicolor/64x64/devices/archlinux-icon-crystal-64.svg
# Edit {{ic|/usr/share/lightdm-gtk-greeter/greeter.ui}}
+
Search for 'image1' and edit the 'property' xml to be the filename (less the extension).  By default it should be 'computer' by default.
+
  
 
==== Sources of Arch-centric 64x64 Icons ====
 
==== Sources of Arch-centric 64x64 Icons ====
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:
+
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:
 
+
 
  # 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 {{Pkg|archlinux-artwork}} package can be removed.
  
 
=== Enabling Autologin ===
 
=== Enabling Autologin ===
# gedit /etc/lightdm/lightdm.conf
+
Edit the LightDM configuration file and change these lines to:
 +
{{hc|/etc/lightdm/lightdm.conf|<nowiki>
 +
[SeatDefaults]
 +
autologin-user=USERNAME
 +
autologin-user-timeout=0
 +
pam-service=lightdm-autologin</nowiki>
 +
}}
 +
or execute:
 +
# /usr/lib/lightdm/lightdm/lightdm-set-defaults --autologin=USERNAME
  
Change these lines to:
+
==== PAM settings ====
[SeatDefaults]
+
{{Note|These steps may no longer be necessary.}}
autologin-user=your_user
+
autologin-user-timeout=0
+
pam-service=lightdm-autologin
+
(last one might need to be created)
+
  
# gedit /etc/pam.d/lightdm-autologin
+
LightDM goes through PAM even when ''autologin'' is enabled. You must make sure that PAM allows login without prompting for a password.
(create if it doesn't exist)
+
 
Add:
+
Create a new group called, say, {{ic|autologin}} and add yourself to the group:
#%PAM-1.0
+
  groupadd autologin
auth requisite pam_nologin.so
+
  gpasswd -a ''username'' autologin
auth required pam_env.so
+
 
auth requisite pam_permit.so
+
Edit {{ic|/etc/pam.d/lightdm}} and locate the line "auth required pam_unix.so". Add new lines before and after it so that the section now reads:
auth sufficient pam_succeed_if.so uid >= 1000 quiet
+
  auth [success=1 default=ignore] pam_succeed_if.so user ingroup autologin
auth required pam_deny.so
+
  auth required pam_unix.so
account required pam_unix.so
+
  auth optional pam_permit.so
password required pam_deny.so
+
 
session required pam_loginuid.so
+
This ensures that the user will not be asked for a password when logging in through LightDM's autologin.
-session optional pam_systemd.so
+
So any user you would like to login without typing password in LightDM just add to this group.
session optional pam_keyinit.so revoke
+
session required pam_limits.so
+
session required pam_unix.so
+
  
 
=== NumLock ON ===
 
=== NumLock ON ===
 
Install the {{ic|numlockx}} package and the edit {{ic| /etc/lightdm/lightdm.conf}} adding the following line:
 
Install the {{ic|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
 +
 +
=== User switching under xfce4 ===
 +
With the release of Xfce4 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/bin/gdmflexiserver
 +
 +
Alternatively, see the [[XScreenSaver#Lightdm]] article.
 +
 +
== See Also ==
 +
* [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]

Revision as of 23:16, 14 March 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 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 either lightdm-gtk3-greeter or lightdm-gtk2-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 at compile time by changing the line containing:

--with-greeter-session=lightdm-gtk-greeter

to

--with-greeter-session=lightdm-yourgreeter-greeter

Or, more easily, change the configuration file to state:

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

Enabling LightDM

Make sure that the lightdm daemon is started at boot.

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 and lightdm-gtk2-greeter have:

/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 the Icon

Users wishing to customize the icon on the greeter screen need to edit /etc/lightdm/lightdm-gtk-greeter.conf defining the logo variable.

Example:

logo=/usr/share/icons/hicolor/64x64/devices/archlinux-icon-crystal-64.svg

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
[SeatDefaults]
autologin-user=USERNAME
autologin-user-timeout=0
pam-service=lightdm-autologin

or execute:

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

PAM settings

Note: These steps may no longer be necessary.

LightDM goes through PAM even when autologin is enabled. You must make sure that PAM allows login without prompting for a password.

Create a new group called, say, autologin and add yourself to the group:

 groupadd autologin
 gpasswd -a username autologin

Edit /etc/pam.d/lightdm and locate the line "auth required pam_unix.so". Add new lines before and after it so that the section now reads:

 auth [success=1 default=ignore] pam_succeed_if.so user ingroup autologin
 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's autologin. So any user you would like to login without typing password in LightDM just add to this group.

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 xfce4

With the release of Xfce4 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/bin/gdmflexiserver

Alternatively, see the XScreenSaver#Lightdm article.

See Also