Difference between revisions of "LXDM"

From ArchWiki
Jump to: navigation, search
(Installation)
m (Simultaneous Users and Switching Users: Fix section level.)
(32 intermediate revisions by 17 users not shown)
Line 1: Line 1:
 
[[Category:Display managers]]
 
[[Category:Display managers]]
{{i18n|LXDM}}
+
[[zh-CN:LXDM]]
 
+
{{Article summary start}}
From [http://wiki.lxde.org/en/LXDM LXDM - LXDE Display Manager]:
+
{{Article summary text|
 
+
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.}}
:''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.''
+
{{Article summary heading|Related}}
 +
{{Article summary wiki|Display_Manager}}
 +
{{Article summary end}}
  
 
==Installation==
 
==Installation==
 
 
[[pacman|Install]] the {{pkg|lxdm}} package which is available in the [[Official Repositories|official repositories]].
 
[[pacman|Install]] the {{pkg|lxdm}} package which is available in the [[Official Repositories|official repositories]].
  
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:  
+
== Usage ==
{{bc|x:5:respawn:/usr/sbin/lxdm >& /dev/null}}
+
Currently, {{pkg|lxdm}} provides an lxdm.service file.  Enable it like any other systemd service:
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.
+
# systemctl enable lxdm.service
  
 
==Configuration==
 
==Configuration==
{{warning|1=The language select control in '''lxdm.conf''' is sometimes required. Set '''lang=1''' or LXDM can potentially enter a boot loop and fail to load your session.}}
+
{{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 your session.}}
 
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 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 bash 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 they have logged in.
Line 26: Line 27:
 
# {{ic|PreShutdown}}: Is run as root before poweroff with LXDM.
 
# {{ic|PreShutdown}}: Is run as root before poweroff with LXDM.
  
===Autologin===
+
===Expected Logout Behavior===
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:
+
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:
#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 accountTo make it so that you can manually log into the account without entering a password, first delete the password:
+
#!/bin/sh
 +
 +
# 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
  
$ passwd -d USERNAME
+
{{note|This will kill daemons such as tmux, urxvtd, etc.}}
  
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
+
Or you can replace killall command with this to exclude ssh and screen processes from termination:
  
  auth    required    pam_unix.so
+
  ps --user $USER | egrep -v "ssh|screen" | cut -b11-15 | xargs -t kill
  
to this:
+
===Default session===
 +
==== Globally ====
 +
Edit {{ic|/etc/lxdm/lxdm.conf}} and change the line:
  
auth    required    pam_unix.so nullok
+
{{bc|session<nowiki>=</nowiki>/usr/bin/startlxde}}
  
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.
+
To whatever session or DE is desired. To use xfce you would modify it to:
  
===Default background color===
+
{{bc|session<nowiki>=</nowiki>/usr/bin/startxfce4}}
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
+
This is useful for themes that have no visible session selection box, or if you're experiencing trouble using autologin.
  
===Default session===
+
==== Per user ====
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:
+
To define an individual user's preferred session, simply edit his/her respective {{ic|~/.dmrc}} to define the selection.
  
{{bc|session<nowiki>=</nowiki>/usr/bin/startlxde}}
+
Example: user1 wants xfce4, user2 wants cinnamon, and user3 wants gnome:
  
to whatever session or DE you want as default. Example to use Xfce as your default:
+
For user1:
 +
[Desktop]
 +
Session=xfce
  
{{bc|session<nowiki>=</nowiki>/usr/bin/startxfce4}}
+
For user2:
 +
[Desktop]
 +
Session=cinnamon
  
This is useful if your theme has no visible session selection box or you have trouble using autologin.
+
For user3:
 +
[Desktop]
 +
Session=gnome
  
===Expected Logout Behavior===
+
===Autologin===
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:
+
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".
  
#!/bin/sh
+
This will cause LXDM to automatically login to the specified account when it first starts upHowever, 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:
+
# 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.}}
+
$ passwd -d USERNAME
 +
 
 +
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
 +
 
 +
auth    required    pam_unix.so
 +
 
 +
to this:
 +
 
 +
auth    required    pam_unix.so nullok
 +
 
 +
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.
  
 
=== Unlocking Keyrings upon Login===
 
=== Unlocking Keyrings upon Login===
Line 89: Line 107:
 
  password        required        pam_unix.so
 
  password        required        pam_unix.so
  
=== Adding alternative X sessions with .desktop files ===
+
=== Sessionlist===
 +
 
 +
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:
  
If additional Window Managers, Desktop Environments or X sessions are required and are not provided by their respective installation, you'll need to add custom {{ic|.desktop}} files to {{ic|/usr/share/xsessions/}} for LXDM to recognise them.
 
{{note|LXDM will only look for {{ic|[Desktop Entry]}}, {{ic|Name}} and {{ic|Exec}} within your {{ic|.desktop}} file.}}
 
Example:
 
 
  [Desktop Entry]
 
  [Desktop Entry]
  Name=Subtle
+
Encoding=UTF-8
  Exec=subtle
+
  Name=Openbox
LXDM will launch this {{ic|.desktop}} file using the following command: {{ic|ck-launch-session subtle}} (if {{ic|/etc/Xsessions}} is unaltered.)
+
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
 +
 
 +
=== 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. 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.}}
  
=== Adding Keyboard to the display ===
+
[[Xscreensaver]] can also perform this taskFor more, see the [[Xscreensaver#LXDM]] article.
First edit /etc/lxdm/lxdm.conf and change
+
  keyboard=0
+
to
+
keyboard=1
+
this abilitate the keyboard selection in the display manager, but by default is blank
+
then you need to...
+

Revision as of 07:09, 29 December 2012

Summary help replacing me

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

Installation

Install the lxdm package which is available in the official repositories.

Usage

Currently, lxdm provides an lxdm.service file. Enable it like any other systemd service:

# systemctl enable lxdm.service

Configuration

Warning: 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 your session.

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 bash 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 they have logged in.
  4. PostLogout: Is run as the logged-in user right after they have logged out.
  5. PreReboot: Is run as root before rebooting with LXDM.
  6. PreShutdown: Is run as root before poweroff with LXDM.

Expected Logout Behavior

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 /etc/lxdm/PostLogout like this:

#!/bin/sh

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

Or you can replace killall command with this to exclude ssh and screen processes from termination:

ps --user $USER | egrep -v "ssh|screen" | cut -b11-15 | xargs -t kill

Default session

Globally

Edit /etc/lxdm/lxdm.conf and change the line:

session=/usr/bin/startlxde

To whatever session or DE is desired. To use xfce you would modify it to:

session=/usr/bin/startxfce4

This is useful for themes that have no visible session selection box, or if you're 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, without providing a password, find the line in /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 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 account. To remedy this and be able to log into the account without entering a password, first delete the password:

$ passwd -d USERNAME

Then, edit the PAM file for LXDM, which is /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

auth    required    pam_unix.so

to this:

auth    required    pam_unix.so nullok

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.

Unlocking Keyrings upon Login

When using a key manager such as gnome-keyring to manage passwords for ssh keys, /etc/pam.d/lxdm should be adjusted to allow users to unlock keyrings upon login if desired. The following is a functional configuration:

#%PAM-1.0
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

Sessionlist

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:

[Desktop Entry]
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

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

Xscreensaver can also perform this task. For more, see the Xscreensaver#LXDM article.