Difference between revisions of "LXDM"

From ArchWiki
Jump to: navigation, search
(Expected logout behavior)
(Move XDMCP into introduction.)
 
(72 intermediate revisions by 28 users not shown)
Line 1: Line 1:
 
[[Category:Display managers]]
 
[[Category:Display managers]]
 +
[[it:LXDM]]
 +
[[ja:LXDM]]
 
[[zh-CN:LXDM]]
 
[[zh-CN:LXDM]]
{{Article summary start}}
+
{{Related articles start}}
{{Article summary text|
+
{{Related|LXDE}}
LXDM is the lightweight display manager aimed to replace gdm in LXDE distros. The UI is implemented with GTK+. It is still in early stages of development.}}
+
{{Related|Display manager}}
{{Article summary heading|Related}}
+
{{Related articles end}}
{{Article summary wiki|Display_Manager}}
+
{{Article summary end}}
+
  
==Installation==
+
LXDM is a lightweight [[display manager]] for the [[LXDE]] [[desktop environment]]. The UI is implemented with [[GTK+]] 2.
The {{pkg|lxdm}} package is available in the [[Official Repositories|official repositories]] or {{AUR|lxdm-git}} is available in the [[AUR]].
+
  
== Usage ==
+
LXDM does not support the XDMCP protocol. An alternative that does is [[LightDM]].
Currently, {{pkg|lxdm}} provides an lxdm.service file. Enable it like any other systemd service:
+
 
# systemctl enable lxdm
+
== Installation ==
 +
 
 +
[[Install]] the {{Pkg|lxdm}} package. The development package is {{AUR|lxdm-git}}.
 +
 
 +
{{Pkg|lxdm}} provides the {{ic|lxdm}} [[systemd]] service. [[Enable]] it to start LXDM at boot.
 +
 
 +
== 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 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.
 
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.
  
Line 26: Line 30:
 
# {{ic|PreShutdown}} is run as root before poweroff with LXDM.
 
# {{ic|PreShutdown}} is run as root before poweroff with LXDM.
  
{{warning|1=The language select control in '''lxdm.conf''' is sometimes required and sometimes not. Set '''lang=''' to inverse value of itself when LXDM potentially enters a boot loop and fails to load target sessions.}}
+
=== Default session ===
  
=== Unlocking keyrings upon login===
+
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.
  
When using a key manager such as gnome-keyring to manage passwords for ssh keys, {{ic|/etc/pam.d/lxdm}} should be adjusted to allow users to unlock keyrings upon login if desired. Add the following to the package provided {{ic|/etc/pam.d/lxdm}}:
+
==== Globally ====
  
auth            optional        pam_gnome_keyring.so
 
session        optional        pam_gnome_keyring.so auto_start
 
 
=== 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.}}
 
 
===Default session===
 
==== Globally ====
 
 
Edit {{ic|/etc/lxdm/lxdm.conf}} and change the session line to whatever session or DE is desired:
 
Edit {{ic|/etc/lxdm/lxdm.conf}} and change the session line to whatever session or DE is desired:
  
{{bc|session<nowiki>=</nowiki>/usr/bin/startlxde}}
+
{{bc|1=session=/usr/bin/startlxde}}
  
Example using xfce:
+
Example using [[Xfce]]:
{{bc|session<nowiki>=</nowiki>/usr/bin/startxfce4}}
+
{{bc|1=session=/usr/bin/startxfce4}}
  
Example using openbox:
+
Example using [[Openbox]]:
{{bc|session<nowiki>=</nowiki>/usr/bin/openbox-session}}
+
{{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.
 
This is useful for themes that have no visible session selection box, and if experiencing trouble using autologin.
  
 
==== Per user ====
 
==== Per user ====
 +
 
To define an individual user's preferred session, simply edit his/her respective {{ic|~/.dmrc}} to define the selection.
 
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:
+
Example: user1 wants Xfce4, user2 wants [[Cinnamon]], and user3 wants GNOME:
  
 
For user1:
 
For user1:
Line 71: Line 69:
 
  Session=gnome
 
  Session=gnome
  
===Autologin===
+
=== Autologin ===
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, substituting the target user instead of "username".
+
  
This will cause LXDM to automatically login to the specified account when it first starts up.  However, if one were to log out of that account, one would have to enter its password to log back into it; if the password was empty, that user will be unable to log into the accountTo remedy this and be able to log into the account without entering a password, first delete the password:
+
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''.
  
$ passwd -d USERNAME
+
=== Last used options ===
  
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:
+
It stores information about last used options in the:
  
  auth    required    pam_unix.so
+
{{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}}
  
to this:
+
{{Note|This file is not removed after uninstallation. And must be removed manually if you want to remove all traces of LXDM used options.}}
  
auth    required    pam_unix.so nullok
+
== Tips and tricks ==
  
This will tell the pam_unix authentication module that blank passwords are to be accepted. After making this change, LXDM will log into accounts with blank passwords.
+
=== Adding face icons ===
  
===Expected logout behavior===
+
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.
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. Users desiring this behavior, can edit {{ic|/etc/lxdm/PostLogout}} like this:
+
  
#!/bin/sh
+
{{Note|Users need not keep {{Pkg|gnome-control-center}} installed to use this images. Simply install it, copy them elsewhere, and remove it.}}
+
# Kills all your processes when you log out.
+
killall --user $USER -TERM
+
+
# Sets 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.}}
+
{{Note|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.}}
  
Users can replace killall command with the following to exclude ssh and screen processes from termination:
+
{{Note|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.}}
  
ps --user $USER | egrep -v "ssh|screen" | cut -b11-15 | xargs -t kill
+
=== Simultaneous users and switching users ===
  
Or to (hopefully) only kill X-Processes and childs:
+
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
  
ps --user $USER | cut -f1,2 -d' ' | egrep "\?$" | cut -d' ' -f1 | xargs -t kill
+
{{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.}}
  
Another option than killall is to use loginctl:
+
If you use the [[Xfce]] desktop, the Switch User functionality of its Action Button panel item specifically looks for the ''gdmflexiserver'' executable in order to enable itself. If you provide it with an executable shell script {{ic|/usr/bin/gdmflexiserver}} consisting of
  
 
  #!/bin/sh
 
  #!/bin/sh
+
  /usr/bin/lxdm -c USER_SWITCH
# Terminate current user session
+
  /usr/bin/loginctl terminate-session $XDG_SESSION_ID
+
+
# Restart lxdm
+
/usr/bin/systemctl restart lxdm.service
+
  
{{note|Because the lxdm-binary process is part of the user session and so killed with the other processes of the session, it is required to restart the lxdm service}}
+
then user switching in Xfce should work fine also with LXDM.
{{note|The variable $XDG_SESSION_ID is described in the man page: pam_systemd}}
+
  
===Shutdown and reboot commands===
+
[[XScreenSaver]] can also perform this task. For more, see the [[XScreenSaver#LXDM|this section]] of the Xscreensaver article.
Shutdown and reboot commands can be configured in {{ic|/etc/lxdm/lxdm.conf}} by adding the [cmd] section:
+
  
[cmd]
+
=== Themes ===
# reboot command
+
reboot=/usr/bin/systemctl reboot
+
+
# shutdown command
+
shutdown=/usr/bin/systemctl poweroff
+
  
===Session list===
+
The LXDM themes are located in {{ic|/usr/share/lxdm/themes}}.
  
To add/remove entries to LXDM's session dropdown menu; create/remove the .desktop files in /usr/share/xsessions as desired. A typical .desktop file will look something like:
+
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.
  
[Desktop Entry]
+
{{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).
Encoding=UTF-8
+
Name=Openbox
+
Comment=Log in using the Openbox window manager (without a session manager)
+
Exec=/usr/bin/openbox-session
+
TryExec=/usr/bin/openbox-session
+
Icon=openbox.png
+
Type=XSession
+
  
===.xinitrc===
+
You can configure them on {{ic|/etc/lxdm/lxdm.conf}}:
By default, LXDM doesn't read ~/.xinitrc but ~/.xprofile. That setup is defined in the {{ic|/etc/lxdm/Xsession}} script.
+
The default behaviour can be adapted by modifying the {{ic|Xsession}} file like this:
+
  
  #!/bin/bash
+
  ## the theme of greeter
   
+
  theme=theme_name
LXSESSION="$1"
+
+
if [ -f ~/.xinitrc ]; then
+
  . ~/.xinitrc lxdm
+
fi
+
+
exec /bin/bash -l -c "$LXSESSION"
+
  
=== Simultaneous users and switching users ===
+
=== Advanced Session Configuration ===
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
+
After a user logs on, LXDM sources ''all'' of the following files, in order:
  
{{Note|When the new user logs in, his/her session is now on the NEXT tty. For example, user1 logs in and issues the USER_SWITCH command.  Now user2 logs in.  User2 will be on tty8 while user1 will be on tty7.}}
+
# {{ic|/etc/profile}}
 +
# {{ic|~/.profile}}
 +
# {{ic|/etc/xprofile}}
 +
# {{ic|~/.xprofile}}
  
[[Xscreensaver]] can also perform this task. For more, see the [[Xscreensaver#LXDM]] article.
+
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.
  
=== PulseAudio ===
+
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}}.
 
+
After a user logs out, subsequent users have no access to [[PulseAudio]]. The reason is that PulseAudio stores server credentials as properties on the X11 root window, and since LXDM does not restart the X server, these properties are not cleaned up and prevent the sound server from starting up for the next users. To remove these properties on logout, add the following line to {{ic|/etc/lxdm/PostLogout}}:
+
 
+
{{bc|test -x /usr/bin/pax11publish && /usr/bin/pax11publish -r}}
+
 
+
=== 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 {{pkg|librsvg}} installed.
+
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]

Latest revision as of 02:05, 17 July 2016

Related articles

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. The development package is lxdm-gitAUR.

lxdm provides the lxdm systemd service. Enable it 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.
Note: 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.
Note: 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.

If you use the Xfce desktop, the Switch User functionality of its Action Button panel item specifically looks for the gdmflexiserver executable in order to enable itself. If you provide it with an executable shell script /usr/bin/gdmflexiserver consisting of

#!/bin/sh
/usr/bin/lxdm -c USER_SWITCH

then user switching in Xfce should work fine also with LXDM.

XScreenSaver can also perform this task. For more, see the this section of the Xscreensaver article.

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

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.

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]