Difference between revisions of "LXDM"
(→Configuration) |
(→Themes) |
||
(24 intermediate revisions by 7 users not shown) | |||
Line 5: | Line 5: | ||
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 still in early stages of development.}} | ||
{{Article summary heading|Related}} | {{Article summary heading|Related}} | ||
− | {{Article summary wiki| | + | {{Article summary wiki|LXDE}} |
+ | {{Article summary wiki|Display manager}} | ||
{{Article summary end}} | {{Article summary end}} | ||
Line 21: | Line 22: | ||
# {{ic|LoginReady}} is executed with root privileges 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 | + | # {{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 | + | # {{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. | ||
Line 29: | Line 30: | ||
=== Unlocking keyrings upon login=== | === Unlocking keyrings upon login=== | ||
− | + | {{Note|lxdm 0.4.1-25 ships with {{ic|/etc/pam.d/lxdm}} preconfigured to unlock keyrings upon login. Users no longer need to modify the file.}} | |
− | |||
− | |||
− | |||
− | |||
=== Adding face icons === | === Adding face icons === | ||
Line 42: | Line 39: | ||
===Default session=== | ===Default session=== | ||
==== Globally ==== | ==== 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: | ||
Line 51: | Line 49: | ||
Example using openbox: | Example using openbox: | ||
{{bc|session<nowiki>=</nowiki>/usr/bin/openbox-session}} | {{bc|session<nowiki>=</nowiki>/usr/bin/openbox-session}} | ||
+ | |||
+ | Example using GNOME: | ||
+ | {{bc|session<nowiki>=</nowiki>/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. | ||
Line 76: | Line 77: | ||
Uncomment it, substituting the target user instead of "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 | + | 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. To avoid this, delete the password: |
− | + | $ passwd -d USERNAME | |
− | $ passwd -d USERNAME | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {{Note|lxdm 0.4.1-25 ships with {{ic|/etc/pam.d/lxdm}} preconfigured to allow users with empty password to log in. Users no longer need to modify the file.}} | |
− | + | Note: As with most Linux-related documentation, this is quite frequently a total lie. If the settings you make to lxdm.conf have no effect, look in /etc/lxdm for other similar configuration files. For example, some systems have /etc/lxdm/lxdm.conf -- the purpose of which is apparently only to fool you with its existence, as it is not actually read -- but *actually* use /etc/lxdm/default.conf (which may or may not be a symlink to somewhere else, like /etc/alternatives/lxdm.conf). So if the above does not work, poke around and try applying the changes to any other files you may find. | |
===Expected logout behavior=== | ===Expected logout behavior=== | ||
Line 100: | Line 94: | ||
# Sets the desktop background to solid black. Useful if you have multiple monitors. | # Sets the desktop background to solid black. Useful if you have multiple monitors. | ||
xsetroot -solid black | xsetroot -solid black | ||
− | |||
− | |||
− | |||
− | |||
− | |||
{{note|This will kill daemons such as tmux, urxvtd, etc.}} | {{note|This will kill daemons such as tmux, urxvtd, etc.}} | ||
Line 116: | Line 105: | ||
ps --user $USER | cut -f1,2 -d' ' | egrep "\?$" | cut -d' ' -f1 | xargs -t kill | ps --user $USER | cut -f1,2 -d' ' | egrep "\?$" | cut -d' ' -f1 | xargs -t kill | ||
− | === Session list=== | + | Another option than killall is to use loginctl: |
+ | |||
+ | #!/bin/sh | ||
+ | |||
+ | # 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}} | ||
+ | {{note|The variable $XDG_SESSION_ID is described in the man page: pam_systemd}} | ||
+ | |||
+ | ===Shutdown and reboot commands=== | ||
+ | Shutdown and reboot commands can be configured in {{ic|/etc/lxdm/lxdm.conf}} by adding the [cmd] section: | ||
+ | |||
+ | [cmd] | ||
+ | # reboot command | ||
+ | reboot=/usr/bin/systemctl reboot | ||
+ | |||
+ | # shutdown command | ||
+ | shutdown=/usr/bin/systemctl poweroff | ||
+ | |||
+ | ===Session list=== | ||
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: | 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: | ||
Line 128: | Line 140: | ||
Icon=openbox.png | Icon=openbox.png | ||
Type=XSession | Type=XSession | ||
+ | |||
+ | ===.xinitrc=== | ||
+ | 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 | ||
+ | |||
+ | LXSESSION="$1" | ||
+ | |||
+ | if [ -f ~/.xinitrc ]; then | ||
+ | . ~/.xinitrc lxdm | ||
+ | fi | ||
+ | |||
+ | exec /bin/bash -l -c "$LXSESSION" | ||
=== Simultaneous users and switching users === | === Simultaneous users and switching users === | ||
Line 135: | Line 161: | ||
{{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.}} | {{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.}} | ||
+ | |||
+ | 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 | ||
+ | /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 [[Xscreensaver#LXDM]] article. | [[Xscreensaver]] can also perform this task. For more, see the [[Xscreensaver#LXDM]] article. | ||
Line 145: | Line 178: | ||
=== Themes === | === Themes === | ||
+ | The LXDM themes are localized 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 {{pkg|librsvg}} installed. | ||
− | There | + | There are 2 themes provided with {{aur|lxdm-git}}. ArchStripes and ArchDark. |
+ | You can configure them on /etc/lxdm/lxdm.conf in theme=theme_name |
Revision as of 19:10, 17 October 2013
zh-CN:LXDM Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary end
Contents
Installation
The lxdm package is available in the official repositories or lxdm-gitAUR is available in the AUR.
Usage
Currently, lxdm provides an lxdm.service file. Enable it like any other systemd service:
# systemctl enable lxdm
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:
-
LoginReady
is executed with root privileges when LXDM is ready to show the login window. -
PreLogin
is run as root before logging a user in. -
PostLogin
is run as the logged-in user right after he has logged in. -
PostLogout
is run as the logged-in user right after he has logged out. -
PreReboot
is run as root before rebooting with LXDM. -
PreShutdown
is run as root before poweroff with LXDM.
Unlocking keyrings upon login
/etc/pam.d/lxdm
preconfigured to unlock keyrings upon login. Users no longer need to modify the file.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.
Default session
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, without providing a password, find the line in /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. To avoid this, delete the password:
$ passwd -d USERNAME
/etc/pam.d/lxdm
preconfigured to allow users with empty password to log in. Users no longer need to modify the file.Note: As with most Linux-related documentation, this is quite frequently a total lie. If the settings you make to lxdm.conf have no effect, look in /etc/lxdm for other similar configuration files. For example, some systems have /etc/lxdm/lxdm.conf -- the purpose of which is apparently only to fool you with its existence, as it is not actually read -- but *actually* use /etc/lxdm/default.conf (which may or may not be a symlink to somewhere else, like /etc/alternatives/lxdm.conf). So if the above does not work, poke around and try applying the changes to any other files you may find.
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
Users can replace killall command with the following to exclude ssh and screen processes from termination:
ps --user $USER | egrep -v "ssh|screen" | cut -b11-15 | xargs -t kill
Or to (hopefully) only kill X-Processes and childs:
ps --user $USER | cut -f1,2 -d' ' | egrep "\?$" | cut -d' ' -f1 | xargs -t kill
Another option than killall is to use loginctl:
#!/bin/sh # Terminate current user session /usr/bin/loginctl terminate-session $XDG_SESSION_ID # Restart lxdm /usr/bin/systemctl restart lxdm.service
Shutdown and reboot commands
Shutdown and reboot commands can be configured in /etc/lxdm/lxdm.conf
by adding the [cmd] section:
[cmd] # reboot command reboot=/usr/bin/systemctl reboot # shutdown command shutdown=/usr/bin/systemctl poweroff
Session list
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
.xinitrc
By default, LXDM doesn't read ~/.xinitrc but ~/.xprofile. That setup is defined in the /etc/lxdm/Xsession
script.
The default behaviour can be adapted by modifying the Xsession
file like this:
#!/bin/bash LXSESSION="$1" if [ -f ~/.xinitrc ]; then . ~/.xinitrc lxdm fi exec /bin/bash -l -c "$LXSESSION"
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
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 Xscreensaver#LXDM article.
PulseAudio
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 /etc/lxdm/PostLogout
:
test -x /usr/bin/pax11publish && /usr/bin/pax11publish -r
Themes
The LXDM themes are localized 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.
There are 2 themes provided with lxdm-gitAUR. ArchStripes and ArchDark. You can configure them on /etc/lxdm/lxdm.conf in theme=theme_name