LXDM (简体中文)

翻译状态:本文是 LXDM翻译。上次翻译日期:2019-03-07。如果英文版本有所更改,则您可以帮助同步翻译。

LXDM 是轻量级的 LXDE 桌面环境 使用的 显示管理器。界面使用 GTK+ 2.

LXDM 不支持 XDMCP 协议,要使用 XDMCP,请使用 LightDM.

安装

安装 lxdm 软件包或安装 GTK 软件包 lxdm-gtk3

或者安装AUR中的 lxdm-gitAUR.

启用 systemd 服务 lxdm.service

配置

LXDM 的配置文件都位于 。主配置文件是 ,注释非常详细。 是系统 X 会话配置文件,一般不需要修改。目录中的其他文件都是 bash 脚本,在 LXDM 发生相应事件时运行:

  1. LoginReady: 在 LXDM 准备显示登录窗口时以 root 权限运行。
  2. : 用户登录前以 root 权限运行。
  3. PostLogin: 用户登录后以登录的用户运行。
  4. : 用户注销后以用户权限运行。
  5. : 通过 LXDM 重启时以 root 运行。
  6. : 通过 LXDM关机时以 root 运行。

登录时解锁密钥环

使用 gnome-keyring 等密钥管理器管理 ssh 密钥密码时, 应该调整成允许用户在登录时解锁密钥,在文件中加入:

auth            optional        pam_gnome_keyring.so
session         optional        pam_gnome_keyring.so auto_start

全局

要修改 LXDM 的默认会话或桌面环境,请编辑 /etc/lxdm/lxdm.conf 将下行配置:

例如 Xfce:

例如 Openbox:

例如 GNOME:

在使用无法选择会话的主题或者登录有问题时,这个配置很有用。

分用户配置

要定义独立用户的会话,请编辑 并定义会话。

例如:用户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 的会话列表,可以修改 中的 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 . The package supplies some default icons suitable for the lxdm screen. Look under after installing that package.

自动用户和切换用户

LXDM 可以让多个用户同时登陆到不同 ttys,使用此用户可以自动以新用户登陆,并保留老用户的会话:

$ lxdm -c USER_SWITCH
注意: 当新用户登陆时,使用的是下一个tty。例如 tty7 上的用户甲登陆并使用 USER_SWITCH 命令后,新登陆的用户乙将会位于 tty8。

XScreenSaver 也支持此功能,参见 XScreenSaver#LXDM.

主题

LXDM 主题位于 .

LXDM 仅提供了一个主题 Industrial. 要显示主题背景文件 ,请安装软件包 .

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 使用 GTK 主题(位于 ),在配置文件中设置:

## GTK theme
gtk_theme=gtk_theme_name

高级会话配置

用户登录后,LXDM 会按下面顺序引用全部文件:

这些文件可以设置会话的环境变量,启动必须的服务例如 ssh-agent. 详情请参考 Xprofile.

LXDM 不会 引用 ~/.xinitrc,所以如果需要从使用这些文件的显示管理器迁移到 LXDM,需要将设置移动到其它文件,例如 . LXDM 也不会引用 .

如果还想使用 ~/.xinitrc,可以在 中加入:

source ~/.xinitrc

LXDM 也会使用 .Xresources, .Xkbmap, 和 .Xmodmap. LXDM 系统配置和用户配置的详细状况可以参考

问题处理

白闪

When using the default LXDM and a dark background image (e.g. ) there may be a short bright flash before LXDM starts. This is caused by the bg_color: property of the selected GTK+ theme. To avoid this change to or to another dark theme.

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.