LXDM (简体中文)
LXDM 是轻量级的 LXDE 桌面环境 使用的 显示管理器。界面使用 GTK+ 2.
LXDM 不支持 XDMCP 协议,要使用 XDMCP,请使用 LightDM.
Contents
安装
用法
现在 lxdm 提供了 lxdm.service 文件。启用:
# systemctl enable lxdm.service
配置
LXDM 的配置文件都位于 /etc/lxdm
。主配置文件是 lxdm.conf
,注释非常详细。Xsession
是系统 X 会话配置文件,一般不需要修改。目录中的其他文件都是 bash 脚本,在 LXDM 发生相应事件时运行:
-
LoginReady
: 在 LXDM 准备显示登录窗口时以 root 权限运行。 -
PreLogin
: 用户登录前以 root 权限运行。 -
PostLogin
: 用户登录后以登录的用户运行。 -
PostLogout
: 用户注销后以用户权限运行。 -
PreReboot
: 通过 LXDM 重启时以 root 运行。 -
PreShutdown
: 通过 LXDM关机时以 root 运行。
登录时解锁密钥环
使用 gnome-keyring 等密钥管理器管理 ssh 密钥密码时,/etc/pam.d/lxdm
应该调整成允许用户在登录时解锁密钥,在文件中加入:
auth optional pam_gnome_keyring.so session optional pam_gnome_keyring.so auto_start
默认会话
全局
要修改 LXDM 的默认会话或桌面环境,请编辑 /etc/lxdm/lxdm.conf
将下行配置:
session=/usr/bin/startlxde
例如 Xfce:
session=/usr/bin/startxfce4
例如 Openbox:
session=/usr/bin/openbox-session
例如 GNOME:
session=/usr/bin/gnome-session
在使用无法选择会话的主题或者登录有问题时,这个配置很有用。
分用户配置
要定义独立用户的会话,请编辑 ~/.dmrc
并定义会话。
例如:用户1要用 xfce4,用户2要用cinnamon,用户3要用GNOME:
For user1:
[Desktop] Session=xfce
For user2:
[Desktop] Session=cinnamon
For user3:
[Desktop] Session=gnome
自动登录
如果要不输入密码就自动登录一个用户,找到 /etc/lxdm/lxdm.conf
中的:
#autologin=dgod
取消前面的注释,并将dgod改成要自动登录的用户名。
注销行为
LXDM 有点让人意外的是用户注销时并不会清空用户的桌面背景和用户进程。如果要修改这个行为,请编辑 /etc/lxdm/PostLogout
为:
#!/bin/sh # 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
将 killall 命令替换为下列内容可以不停止 ssh 和 screen:
ps --user $USER | egrep -v "ssh|screen" | cut -b11-15 | xargs -t kill
会话列表
要配置 LXDM 的会话列表,可以修改/usr/share/xsessions
中的 Desktop 文件,示例:
[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
提示和技巧
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.
lxdm-config
shipped with lxdm can be used to place a .face
file in the home directory, along with other configuration.自动用户和切换用户
LXDM 可以让多个用户同时登陆到不同 ttys,使用此用户可以自动以新用户登陆,并保留老用户的会话:
$ lxdm -c USER_SWITCH
XScreenSaver 也支持此功能,参见 XScreenSaver#LXDM.
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.
主题
LXDM 主题位于 /usr/share/lxdm/themes
.
LXDM 仅提供了一个主题 Industrial. 要显示主题背景文件 wave.svg
,请安装软件包 librsvg.
lxdm-themesAUR 提供了 6 个额外的主题:Archlinux, ArchlinuxFull, ArchlinuxTop, Arch-Dark, Arch-Stripes 和 IndustrialArch. lxdm-gitAUR 也提供了 ArchStripes 和 ArchDark(名字改了一下以避免冲突).
主题文件通过 /etc/lxdm/lxdm.conf
配置:
## the theme of greeter theme=theme_name
高级会话配置
用户登录后,LXDM 会按下面顺序引用全部文件:
/etc/profile
~/.profile
/etc/xprofile
~/.xprofile
这些文件可以设置会话的环境变量,启动必须的服务例如 ssh-agent. 详情请参考 Xprofile.
LXDM 不会 引用 ~/.xinitrc
,所以如果需要从使用这些文件的显示管理器迁移到 LXDM,需要将设置移动到其它文件,例如 ~/.xprofile
. LXDM 也不会引用 ~/.bash_profile
.
LXDM 也会使用 .Xresources, .Xkbmap, 和 .Xmodmap. LXDM 系统配置和用户配置的详细状况可以参考 /etc/lxdm/Xsession
[1]