Display manager (简体中文)
显示管理器或登录管理器是一个在启动最后显示的图形界面。和窗口管理器一样,显示管理器有很多种。通常每个显示管理器都能进行一些定制。
Contents
显示管理器列表
控制台
- CDM: 控制台显示管理器 (available in the AUR: cdm-gitAUR)
- Console TDM — Extension for xinit written in pure Bash.
- nodm — 支持自动登录的简单显示管理器。
图形界面
- Entrance — An EFL based display manager, highly experimental.
- GDM: GNOME 显示管理器 。http://projects.gnome.org/gdm/gdm
- KDM: KDE4 显示管理器 (kdebase-workspaceAUR)(已经停止开发).
- LightDM:Ubuntu 开发的 GDM 替代品,使用 WebKit。跨桌面的显示管理器,可以使用各种前端写的任何工具。http://www.freedesktop.org/wiki/Software/LightDMlightdm||lightdm-bzrAUR
- LXDM: LXDE 显示管理器 (独立于桌面环境) (lxdm)
- MDM — MDM 显示管理器使用在Linux Mint, a fork of GDM 2.
- SDDM:基于QML的显示管理器,在 Plasma5 之后替代 SDDM。https://github.com/sddm/sddmsddm
- SLiM: 简单登录管理器 (slim)
- wdm: WINGs 显示管理器 (wdmAUR)
- XDM — X 显示管理器支持XDMCP, host chooser.
加载显示管理器
通过启动登录管理器(或称显示管理器),即可进行图形界面登录。目前,Arch 提供了 GDM、KDM、SLiM、XDM、LXDM、LightDM 和 sddm 的 systemd 服务文件。以 Sddm 为例,配置开机启动:
# systemctl enable sddm.service
执行上述命令后,登录管理器应当能正常工作了。如果不是的话,可能是default.target
没有指向graphical.target
。
启用 SDDM 后, /etc/systemd/system/
应该创建 display-manager.service
软链接,可以用 --force
覆盖已有链接。
$ ls -l /etc/systemd/system/display-manager.service
[...] /etc/systemd/system/display-manager.service -> /usr/lib/systemd/system/sddm.service
使用 systemd-logind
可使用 loginctl
来查看用户会话的状态。所有 PolicyKit 操作,如挂起系统、挂载外部驱动器,都无需配置即可使用。
$ loginctl show-session $XDG_SESSION_ID
会话配置
多数显示管理器会读取 /usr/share/xsessions/
目录已获取可用的会话列表,此目录中包含各个 DM/WM 的标准 桌面文件。
要新建会话,可以在 /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
运行 ~/.xinitrc 会话
安装 xinit-xsessionAUR 后会在显示管理器中提供一个运行 .xinitrc 会话的选项。
没有窗口管理启动应用程序
您也可以启动没有窗口修饰、桌面或窗口管理器的会话。例如要启动 google-chromeAUR,在/usr/share/xsessions/
中创建web-browser.desktop
:
[Desktop Entry] Encoding=UTF-8 Name=Web Browser Comment=Use a web browser as your session Exec=/usr/bin/google-chrome --auto-launch-at-startup TryExec=/usr/bin/google-chrome --auto-launch-at-startup Icon=google-chrome
登录后,程序会立即执行 Exec
中的设定。关闭程序后,会和退出登录一样,将会回到显示管理器。大部分图形程序都不支持此环境,窗口无法移动或改变大小。
参阅 xinitrc#Starting applications without a window manager.
提示和技巧
自动启动
Most of display managers sources /etc/xprofile
, ~/.xprofile
and /etc/X11/xinit/xinitrc.d/
. For more details, see xprofile.
设置语言
For display manager's that use AccountsService the display manager locale can be set by editing /var/lib/AccountsService/users/$USER
:
[User] Language=your_locale
where your_locale is a value such as en_GB.UTF-8
.
Restart your display manager for the changes to take effect.
已知问题
不兼容在systemd
Affected DMs: Entrance, MDM
Some display managers are not fully compatible with systemd, because they reuse the PAM session process. It causes various problems on second login, e.g.:
- NetworkManager applet does not work,
- PulseAudio volume cannot be adjusted,
- login failed into GNOME with another user.