Difference between revisions of "LightDM"

From ArchWiki
Jump to: navigation, search
m (minor tweak to intitab example)
(Autologin seemed to work fine for me without asking for a password)
(43 intermediate revisions by 19 users not shown)
Line 1: Line 1:
[[Category:Display managers (English)]]
+
[[Category:Display managers]]
{{i18n|LightDM}}
+
[[es:LightDM]]
 
+
 
{{Article summary start}}
 
{{Article summary start}}
{{Article summary text|Provides an overview 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}}
Line 11: Line 10:
  
 
== Installation ==
 
== Installation ==
You can install {{AUR|lightdm}} from the [[AUR]].
+
 
{{warning|1=Lightdm changes your $PATH and it might create issues. See [https://bbs.archlinux.org/viewtopic.php?pid=982145#p982145] for how to fix the $PATH.}}
+
Currently,  {{AUR|lightdm}} resides in the [[AUR]].  Install it like any other AUR package.
 +
 
 +
 
 +
=== Greeter===
 +
You will also need {{AUR|lightdm-gtk-greeter}} from the [[AUR]].
 +
 
 +
Other greeters can be installed:
 +
* {{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
 +
--with-greeter-session=lightdm-gtk-greeter
 +
to
 +
--with-greeter-session=lightdm-yourgreeter-greeter
 +
 
 +
To change default greeter by modifying lightdm.conf. <br>
 +
{{bc|greeter-session&#61;lightdm-kde-greeter}}Lightdm.conf can be found at :<br>
 +
{{bc|/etc/lightdm/lightdm.conf}} <br>
  
 
== Enabling Lightdm ==
 
== Enabling Lightdm ==
Lightdm can be loaded on startup by entering it in your daemons array in {{ic|rc.conf}}, or by appending the following line to {{ic|inittab}}:
+
=== Using Initscripts ===
  x:5:respawn:/usr/sbin/lightdm 2>&1 /dev/null
+
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:
 +
  x:5:respawn:/usr/sbin/lightdm >& /dev/null
 +
{{Note|The 'inittab' method is the preferred method to use a graphical greeter. See [[Display_Manager#inittab_method]].}}
  
If you're 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}}.
+
{{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}}.}}
 +
=== 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.
 
See [[Display Manager]] for detailed instructions.
  
== Configuration ==
+
=== Testing ===
Lightdm will only show a blank screen until a greeter is chosen. Open the The configuration file at
+
Install xorg-server-xephyr:
  /etc/lightdm/lightdm.conf
+
  pacman -S xorg-server-xephyr
Find the {{ic|1=#greeter-session=}} option, uncomment it, and change it to the greeter of your choice. For example, to use the default gtk3 greeter, change it to this:
+
Run lightdm as a 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 when setting your greeter.
+
== Optional Configuration and Tweaks ==
 +
=== Changing Background Images/Colors ===
 +
Users wishing to customize the wallpaper on the greeter screen need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} defining the '''background''' variable.
  
It is possible to test lightdm with the following command:
+
Example:
{{bc|$ lightdm --test-mode -c /etc/lightdm/lightdm.conf}}
+
background=/usr/share/pixmaps/black_and_white_photography-wallpaper-1920x1080.jpg
  
Note that this requires [http://www.archlinux.org/packages/extra/i686/xorg-server-xephyr/ xorg-server-xephyr] to be installed, first.
+
Users using the unity-greeter version must edit the {{ic|/usr/share/glib-2.0/schemas/com.canonical.unity-greeter.gschema.xml}} file
  
== NumLock ON ==
+
And then execute
Install {{ic|numlockx}}.
+
  
for lightDM to turn your NumLock On do this:
+
{{ic|glib-compile-schemas /usr/share/glib-2.0/schemas/}}
  
# gedit /etc/lightdm/lightdm.conf
+
According to [https://bbs.archlinux.org/viewtopic.php?id=149945 this] page.
  
add the next line at the end:
 
  
greeter-setup-script=/usr/bin/numlockx on
 
  
== Enable Autologin ==
+
{{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.}}
  # gedit /etc/lightdm/lightdm.conf
+
 
 +
Users wishing to have a flat color (no image) may simply set the '''background''' variable to a hex color.
 +
 
 +
Example:
 +
background=#000000
 +
 
 +
=== Changing the Icon ===
 +
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:
 +
logo=/usr/share/icons/hicolor/64x64/devices/archlinux-icon-crystal-64.svg
 +
 
 +
==== 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:
 +
 
 +
  # 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 {{ic|/etc/lightdm/lightdm.conf}} and change these lines to:
  
Change these lines to:
 
 
  [SeatDefaults]
 
  [SeatDefaults]
 
  autologin-user=your_user
 
  autologin-user=your_user
 
  autologin-user-timeout=0
 
  autologin-user-timeout=0
 
  pam-service=lightdm-autologin
 
  pam-service=lightdm-autologin
(last one might need to be created)
 
  
# gedit /etc/pam.d/lightdm-autologin
+
==== PAM settings ====
(create if it doesn't exist)
+
{{Note|One Arch user found that these steps weren't needed.}}
Add:
+
 
#%PAM-1.0
+
Lightdm goes through PAM even when autologin is enabled. You must make sure that
auth requisite pam_nologin.so
+
PAM allows the login without prompting for a password.
auth required pam_env.so
+
 
auth requisite pam_permit.so
+
Create a new group called, say, {{ic|autologin}} and add yourself to the group:
auth sufficient pam_succeed_if.so uid >= 1000 quiet
+
  groupadd autologin
auth required pam_deny.so
+
  gpasswd -a ''username'' autologin
account required pam_unix.so
+
 
password required pam_deny.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:
session required pam_loginuid.so
+
  auth [success=1 default=ignore] pam_succeed_if.so user ingroup autologin
-session optional pam_systemd.so
+
  auth required pam_unix.so
session optional pam_keyinit.so revoke
+
  auth optional pam_permit.so
session required pam_limits.so
+
 
  session required pam_unix.so
+
This ensures that the user will not be asked for a password when logging in through Lightdm autologin.
 +
So any user you would like to login without typing password in LightDM just add to this group.
 +
 
 +
=== NumLock ON ===
 +
Install the {{ic|numlockx}} package and the edit {{ic| /etc/lightdm/lightdm.conf}} adding the following line:
 +
  greeter-setup-script=/usr/bin/numlockx on
  
== Add user and group "Lightdm" ==
+
=== User switching under xfce4 ===
Some packages from AUR might need this to make lightdm and persmissions function correctly. This CAN help automounting of dvd/cd/usb if you are having problems. You can check beforehand with; cat /etc/group and see what groups you have.
+
With the release of xfce4 v4.10, user switching is supported natively. To use it with lightdm, users need only to create a symlink:
  
  # groupadd --system lightdm
+
  # ln -s /usr/lib/lightdm/lightdm/gdmflexiserver /usr/bin/gdmflexiserver
# useradd --system -c "Light Display Manager" -g lightdm -d /var/lib/lightdm -s /sbin/nologin lightdm
+
  
{{Note|There is NO need to do the above steps if using this {{AUR|lightdm}} package.}}
+
Alternatively, see the [[XScreenSaver#Lightdm]] article.

Revision as of 10:47, 31 January 2013

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

Lightdm LightDM is a cross-desktop display manager that aims to be the standard display manager for the X.org X server.

Installation

Currently, lightdmAUR resides in the AUR. Install it like any other AUR package.


Greeter

You will also need lightdm-gtk-greeterAUR from the AUR.

Other greeters can be installed:

To change the default greeter (lightdm-gtk-greeterAUR) edit the lightdm PKGBUILD and change the line

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

to

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

To change default greeter by modifying lightdm.conf.

greeter-session=lightdm-kde-greeter
Lightdm.conf can be found at :
/etc/lightdm/lightdm.conf

Enabling Lightdm

Using Initscripts

Lightdm can be loaded on startup by entering it in the daemons array in rc.conf, or by modifying inittab so it points to lightdm:

x:5:respawn:/usr/sbin/lightdm >& /dev/null
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 rc.conf.

Using Systemd

For systems using systemd, Lightdm also has a systemd service file, start it with systemctl start lightdm.service or enable it for boot with systemctl enable lightdm.service.

See Display Manager for detailed instructions.

Testing

Install xorg-server-xephyr:

pacman -S xorg-server-xephyr

Run lightdm as a X application:

lightdm --test-mode --debug

Optional Configuration and Tweaks

Changing Background Images/Colors

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

Users using the unity-greeter version 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 png or jpg files in /usr/share/pixmaps since the lightdm user needs read access to the wallpaper file.

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

Example:

background=#000000

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 in [extra] 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 /etc/lightdm/lightdm.conf and change these lines to:

[SeatDefaults]
autologin-user=your_user
autologin-user-timeout=0
pam-service=lightdm-autologin

PAM settings

Note: One Arch user found that these steps weren't needed.

Lightdm goes through PAM even when autologin is enabled. You must make sure that PAM allows the 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 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 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

Alternatively, see the XScreenSaver#Lightdm article.