Difference between revisions of "LXDM"

From ArchWiki
Jump to navigation Jump to search
m (Default background color: Make the mentioned package a link to AUR with template)
m (no more plus in gtk)
 
(162 intermediate revisions by 63 users not shown)
Line 1: Line 1:
[[Category:Display managers (English)]]
+
[[Category:Display managers]]
{{i18n|LXDM}}
+
[[fr:LXDM]]
 +
[[it:LXDM]]
 +
[[ja:LXDM]]
 +
[[ru:LXDM]]
 +
[[zh-hans:LXDM]]
 +
{{Related articles start}}
 +
{{Related|LXDE}}
 +
{{Related|Display manager}}
 +
{{Related articles end}}
  
From [http://wiki.lxde.org/en/LXDM LXDM - LXDE Display Manager]:
+
LXDM is a lightweight [[display manager]] for the [[LXDE]] [[desktop environment]]. The UI is implemented with [[GTK]] 2.
  
:''LXDM is the lightweight display manager aimed to replace gdm in LXDE distros. The UI is implemented with GTK+. It is stil in early stages of development.''
+
LXDM does not support the [[XDMCP]] protocol. An alternative that does is [[LightDM]].
  
==Installation==
+
== Installation ==
  
[[pacman|Install]] the {{pkg|lxdm}} package which is available in the [[Official Repositories|official repositories]].
+
[[Install]] the {{Pkg|lxdm}} package, or {{Pkg|lxdm-gtk3}} for the GTK3 version. The development package is {{AUR|lxdm-git}}.
  
To make the graphical login the default method of logging into the system, edit your {{ic|/etc/inittab}} file (recommended) by adding or uncommenting this line:
+
[[Enable]] the provided {{ic|lxdm.service}} [[systemd]] unit to start LXDM at boot.
{{bc|x:5:respawn:/usr/sbin/lxdm >& /dev/null}}
 
Alternatively you can add {{ic|lxdm}} to your list of daemons in {{ic|/etc/rc.conf}}. These procedures are detailed on the [[Display Manager]] page.
 
  
==Configuration==
+
== Configuration ==
The configuration files for LXDM are all located in {{ic|/etc/lxdm}}. The main configuration file is {{ic|lxdm.conf}}, and is well documented in it's comments. Another file, {{ic|Xsession}}, is the systemwide x session configuration file and should generally not be edited. The other files in this folder are all bash scripts, which are run when certain events happen in LXDM.
+
 
 +
The configuration files for LXDM are all located in {{ic|/etc/lxdm/}}. The main configuration file is {{ic|lxdm.conf}}, and is well documented in its comments. Another file, {{ic|Xsession}}, is the systemwide x session configuration file and should generally not be edited. The other files in this folder are all shell scripts, which are run when certain events happen in LXDM.
  
 
These are:
 
These are:
# {{ic|LoginReady}}: Is executed with root priviledges when LXDM is ready to show the login window.
+
# {{ic|LoginReady}} is executed with root privileges when LXDM is ready to show the login window.
# {{ic|PreLogin}}: Is run as root before logging a user in.
+
# {{ic|PreLogin}} is run as root before logging a user in.
# {{ic|PostLogin}}: Is run as the logged-in user right after they have logged in.
+
# {{ic|PostLogin}} is run as the logged-in user right after he has logged in.
# {{ic|PostLogout}}: Is run as the logged-in user right after they have logged out.
+
# {{ic|PostLogout}} is run as the logged-in user right after he has logged out.
# {{ic|PreReboot}}: Is run as root before rebooting with LXDM.
+
# {{ic|PreReboot}} is run as root before rebooting with LXDM.
# {{ic|PreShutdown}}: Is run as root before poweroff with LXDM.
+
# {{ic|PreShutdown}} is run as root before poweroff with LXDM.
 +
 
 +
=== Default session ===
 +
 
 +
It can be specified which session will be loaded when the users select the 'Default' session from the session list. Note that the user setting takes preference over global setting.
 +
 
 +
==== Globally ====
 +
 
 +
Edit {{ic|/etc/lxdm/lxdm.conf}} and change the session line to whatever session or DE is desired:
 +
 
 +
{{bc|1=session=/usr/bin/startlxde}}
 +
 
 +
Example using [[Xfce]]:
 +
{{bc|1=session=/usr/bin/startxfce4}}
 +
 
 +
Example using [[Openbox]]:
 +
{{bc|1=session=/usr/bin/openbox-session}}
 +
 
 +
Example using [[GNOME]]:
 +
{{bc|1=session=/usr/bin/gnome-session}}
 +
 
 +
This is useful for themes that have no visible session selection box, and if experiencing trouble using autologin.
 +
 
 +
==== Per user ====
 +
 
 +
To define an individual user's preferred session, simply edit his/her respective {{ic|~/.dmrc}} to define the selection.
 +
 
 +
Example: user1 wants Xfce4, user2 wants [[Cinnamon]], and user3 wants GNOME:
 +
 
 +
For user1:
 +
[Desktop]
 +
Session=xfce
 +
 
 +
For user2:
 +
[Desktop]
 +
Session=cinnamon
 +
 
 +
For user3:
 +
[Desktop]
 +
Session=gnome
 +
 
 +
=== Autologin ===
 +
 
 +
To log in to one account automatically on startup, without providing a password, find the line in {{ic|/etc/lxdm/lxdm.conf}} that looks like this:
 +
#autologin=dgod
 +
Uncomment it, substituting the target user instead of ''dgod''.
 +
 
 +
=== Last used options ===
 +
 
 +
It stores information about last used options in the:
 +
 
 +
{{hc|/var/lib/lxdm/lxdm.conf|2=
 +
[base]
 +
last_session=/usr/share/xsessions/LXDE.desktop
 +
last_lang=sv_SE.UTF-8
 +
last_langs=sv_SE.UTF-8 fa_IR.UTF-8 en_US.UTF-8}}
 +
 
 +
{{Note|This file is not removed after uninstallation. And must be removed manually if you want to remove all traces of LXDM used options.}}
 +
 
 +
== Tips and tricks ==
 +
 
 +
=== Adding face icons ===
 +
 
 +
A 96x96 px image (jpg or png) can optionally be displayed on a per-user basis replacing the stock icon. Simply copy or symlink the target image to {{ic|$HOME/.face}}. The {{Pkg|gnome-control-center}} package supplies some default icons suitable for the lxdm screen. Look under {{ic|/usr/share/pixmaps/faces}} after installing that package.
 +
 
 +
{{Note|
 +
* Users need not keep {{Pkg|gnome-control-center}} installed to use this images. Simply install it, copy them elsewhere, and remove it.
 +
* The user's directory needs have r-x permissions for others and the .face file needs have r-- permissions for others. Obviously though this has security and access implications as now anyone can browse your home directory.
 +
* A graphical tool {{ic|lxdm-config}} shipped with lxdm can be used to place a {{ic|.face}} file in the home directory, along with other configuration.}}
 +
 
 +
=== Simultaneous users and switching users ===
 +
 
 +
LXDM allows multiple users to be logged into different ttys at the same time. The following command is used to allow another user to login without logging out the current user:
  
===Autologin===
+
$ lxdm -c USER_SWITCH
If you want to log in to one account automatically, without providing a password, find the line in {{ic|/etc/lxdm/lxdm.conf}} that looks like this:
 
#autologin=username
 
Uncomment it, then substitute your own username instead of "username".
 
  
This will cause LXDM to automatically log you in to the specified account when it first starts up. However, if you were to log out of that account, you would have to enter its password to log back into it; and if the password was empty, you would find yourself unable to log into the account. To make it so that you can manually log into the account without entering a password, first delete the password:
+
{{Note|When the new user logs in, his/her session is now on the NEXT tty from tty7. For example, user1 logs in and issues the USER_SWITCH command. Now user2 logs in. User2 will be on tty7 while user1 will be on tty1.}}
  
$ passwd -d USERNAME
+
=== Themes ===
  
Then, edit the PAM file for LXDM, which is {{ic|/etc/pam.d/lxdm}}. The files in this directory describe how users are authenticated by the various installed programs that need to do some sort of authentication.  Change the line that says
+
The LXDM themes are located in {{ic|/usr/share/lxdm/themes}}.
  
auth    required    pam_unix.so
+
There is only one theme provided with LXDM, namely Industrial. To display the background file {{ic|wave.svg}} which is part of this theme, make sure you have {{Pkg|librsvg}} installed.
  
to this:
+
{{AUR|lxdm-themes}} provides 6 extra themes. Archlinux, ArchlinuxFull, ArchlinuxTop, Arch-Dark, Arch-Stripes and IndustrialArch. The ArchStripes and ArchDark themes are also provided with {{AUR|lxdm-git}} (with different names to avoid file conflicts).
  
auth    required    pam_unix.so nullok
+
You can configure them on {{ic|/etc/lxdm/lxdm.conf}}:
  
This will tell the pam_unix authentication module that blank passwords are to be accepted. After making this change, LXDM will let you log into accounts with blank passwords.
+
## the theme of greeter
 +
theme=theme_name
  
===Default background color===
+
You can also configure LXDM to use a GTK theme (stored in {{ic|/usr/share/themes}}) on the mentioned configuration file:
Useful if you have a theme such as {{aur|archlinux-lxdm-theme}} from the AUR. All you have to do to set a background is add the following to the configuration file.
 
  
  bg=#deadbeaf
+
  ## GTK theme
 +
gtk_theme=gtk_theme_name
  
===Default session===
+
=== Advanced Session Configuration ===
If you want to change the default session or DE for LXDM to run instead of the default LXDE. Edit {{ic|/etc/lxdm/lxdm.conf}} and change the line:
 
  
{{bc|session<nowiki>=</nowiki>/usr/bin/startlxde}}
+
After a user logs on, LXDM sources ''all'' of the following files, in order:
  
to whatever session or DE you want as default. Example to use Xfce as your default:
+
# {{ic|/etc/profile}}
 +
# {{ic|~/.profile}}
 +
# {{ic|/etc/xprofile}}
 +
# {{ic|~/.xprofile}}
  
{{bc|session<nowiki>=</nowiki>/usr/bin/startxfce4}}
+
These files can be used to set session environment variables and to start services which  must set certain environment variables in order for clients in the session to be able to use the service, like ssh-agent. See [[Xprofile]] for details.
  
This is useful if your theme has no visible session selection box or you have trouble using autologin.
+
Note that LXDM does ''not'' source {{ic|~/.xinitrc}}, so those migrating from a DM that ''does'' use this file, like [[SLiM]], will have to move their settings elsewhere — probably {{ic|~/.xprofile}}. Also note LXDM does not source {{ic|~/.bash_profile}}.
  
===Expected Logout Behavior===
+
If you still want to use your {{ic|~/.xinitrc}} file, you can add a line to the {{ic|/etc/lxdm/PostLogin}} event file:
What might be slightly surprising with LXDM is that, by default, it does not clear the last user's desktop background or kill the user's processes when that user logs out. If you desire this behaviour, you can edit {{ic|/etc/lxdm/PostLogout}} like this:
 
  
  #!/bin/sh
+
  source ~/.xinitrc
 
# Kills all your processes when you log out.
 
killall --user $USER -TERM
 
 
# Set's the desktop background to solid black. Useful if you have multiple monitors.
 
xsetroot -solid black
 
  
{{note|This will kill daemons such as tmux, urxvtd, etc.}}
+
LXDM also makes use of .[[Xresources]], .[[Xkbmap]], and .[[Xmodmap]]. See {{ic|/etc/lxdm/Xsession}} for details on how LXDM uses system-wide and per-user configuration files to configure the session.[https://projects.archlinux.org/svntogit/community.git/tree/trunk/Xsession?h=packages/lxdm]
  
=== Unlocking Keyrings upon Login===
+
== Troubleshooting ==
  
When using a key manager such as gnome-keyring to manage passwords for ssh keys, {{ic|/etc/pam.d/lxde}} should be adjusted to allow users to unlock keyrings upon login if desired.  The following is an functional configuration:
+
=== White flash ===
  
#%PAM-1.0
+
When using the default LXDM {{ic|1=theme=Industrial}} and a dark background image (e.g. {{ic|1=bg=/usr/share/backgrounds/img.png}}) there may be a short bright flash before LXDM starts. This is caused by the {{ic|bg_color:}} property of the selected [[GTK]] theme. To avoid this change {{ic|1=gtk_theme=Adwaita}} to {{ic|1=gtk_theme=Adwaita-dark}} or to another dark theme.
auth            requisite      pam_nologin.so
 
auth            required        pam_env.so
 
auth            required        pam_unix.so
 
auth            optional        pam_gnome_keyring.so
 
account        required        pam_unix.so
 
session        required        pam_limits.so
 
session        required        pam_unix.so
 
session        optional        pam_gnome_keyring.so auto_start
 
password        required        pam_unix.so
 

Latest revision as of 07:11, 16 August 2019

LXDM is a lightweight display manager for the LXDE desktop environment. The UI is implemented with GTK 2.

LXDM does not support the XDMCP protocol. An alternative that does is LightDM.

Installation

Install the lxdm package, or lxdm-gtk3 for the GTK3 version. The development package is lxdm-gitAUR.

Enable the provided lxdm.service systemd unit to start LXDM at boot.

Configuration

The configuration files for LXDM are all located in /etc/lxdm/. The main configuration file is lxdm.conf, and is well documented in its comments. Another file, Xsession, is the systemwide x session configuration file and should generally not be edited. The other files in this folder are all shell scripts, which are run when certain events happen in LXDM.

These are:

  1. LoginReady is executed with root privileges when LXDM is ready to show the login window.
  2. PreLogin is run as root before logging a user in.
  3. PostLogin is run as the logged-in user right after he has logged in.
  4. PostLogout is run as the logged-in user right after he has logged out.
  5. PreReboot is run as root before rebooting with LXDM.
  6. PreShutdown is run as root before poweroff with LXDM.

Default session

It can be specified which session will be loaded when the users select the 'Default' session from the session list. Note that the user setting takes preference over global setting.

Globally

Edit /etc/lxdm/lxdm.conf and change the session line to whatever session or DE is desired:

session=/usr/bin/startlxde

Example using Xfce:

session=/usr/bin/startxfce4

Example using Openbox:

session=/usr/bin/openbox-session

Example using GNOME:

session=/usr/bin/gnome-session

This is useful for themes that have no visible session selection box, and if experiencing trouble using autologin.

Per user

To define an individual user's preferred session, simply edit his/her respective ~/.dmrc to define the selection.

Example: user1 wants Xfce4, user2 wants Cinnamon, and user3 wants GNOME:

For user1:

[Desktop]
Session=xfce

For user2:

[Desktop]
Session=cinnamon

For user3:

[Desktop]
Session=gnome

Autologin

To log in to one account automatically on startup, without providing a password, find the line in /etc/lxdm/lxdm.conf that looks like this:

#autologin=dgod

Uncomment it, substituting the target user instead of dgod.

Last used options

It stores information about last used options in the:

/var/lib/lxdm/lxdm.conf
[base]
last_session=/usr/share/xsessions/LXDE.desktop
last_lang=sv_SE.UTF-8
last_langs=sv_SE.UTF-8 fa_IR.UTF-8 en_US.UTF-8
Note: This file is not removed after uninstallation. And must be removed manually if you want to remove all traces of LXDM used options.

Tips and tricks

Adding face icons

A 96x96 px image (jpg or png) can optionally be displayed on a per-user basis replacing the stock icon. Simply copy or symlink the target image to $HOME/.face. The gnome-control-center package supplies some default icons suitable for the lxdm screen. Look under /usr/share/pixmaps/faces after installing that package.

Note:
  • Users need not keep gnome-control-center installed to use this images. Simply install it, copy them elsewhere, and remove it.
  • The user's directory needs have r-x permissions for others and the .face file needs have r-- permissions for others. Obviously though this has security and access implications as now anyone can browse your home directory.
  • A graphical tool lxdm-config shipped with lxdm can be used to place a .face file in the home directory, along with other configuration.

Simultaneous users and switching users

LXDM allows multiple users to be logged into different ttys at the same time. The following command is used to allow another user to login without logging out the current user:

$ lxdm -c USER_SWITCH
Note: When the new user logs in, his/her session is now on the NEXT tty from tty7. For example, user1 logs in and issues the USER_SWITCH command. Now user2 logs in. User2 will be on tty7 while user1 will be on tty1.

Themes

The LXDM themes are located in /usr/share/lxdm/themes.

There is only one theme provided with LXDM, namely Industrial. To display the background file wave.svg which is part of this theme, make sure you have librsvg installed.

lxdm-themesAUR provides 6 extra themes. Archlinux, ArchlinuxFull, ArchlinuxTop, Arch-Dark, Arch-Stripes and IndustrialArch. The ArchStripes and ArchDark themes are also provided with lxdm-gitAUR (with different names to avoid file conflicts).

You can configure them on /etc/lxdm/lxdm.conf:

## the theme of greeter
theme=theme_name

You can also configure LXDM to use a GTK theme (stored in /usr/share/themes) on the mentioned configuration file:

## GTK theme
gtk_theme=gtk_theme_name

Advanced Session Configuration

After a user logs on, LXDM sources all of the following files, in order:

  1. /etc/profile
  2. ~/.profile
  3. /etc/xprofile
  4. ~/.xprofile

These files can be used to set session environment variables and to start services which must set certain environment variables in order for clients in the session to be able to use the service, like ssh-agent. See Xprofile for details.

Note that LXDM does not source ~/.xinitrc, so those migrating from a DM that does use this file, like SLiM, will have to move their settings elsewhere — probably ~/.xprofile. Also note LXDM does not source ~/.bash_profile.

If you still want to use your ~/.xinitrc file, you can add a line to the /etc/lxdm/PostLogin event file:

source ~/.xinitrc

LXDM also makes use of .Xresources, .Xkbmap, and .Xmodmap. See /etc/lxdm/Xsession for details on how LXDM uses system-wide and per-user configuration files to configure the session.[1]

Troubleshooting

White flash

When using the default LXDM theme=Industrial and a dark background image (e.g. bg=/usr/share/backgrounds/img.png) there may be a short bright flash before LXDM starts. This is caused by the bg_color: property of the selected GTK theme. To avoid this change gtk_theme=Adwaita to gtk_theme=Adwaita-dark or to another dark theme.