manjaro lightdm 设置 背景/自用登录

配置和调整

/etc/lightdm/lightdm.conf 包含 LightDM 的默认配置。某些 greeter 拥有自己的配置文件。例如

可以直接修改 LightDM 的配置文件,或者使用位于 /usr/lib/lightdm/lightdm/ 的 lightdm-set-defaults程序。想知道一些可用选项,执行:

$ man lightdm-set-defaults

然而一大部分变量要直接编辑配置文件而不是使用 lightdm-set-defaults 程序。

更改背景图片/颜色

如果您想使用一个纯色 (非图片) 的背景,只需将 background 变量设置为十六进制的颜色。

例如:

background=#000000

如果你想用图像来代替,请看下文。

GTK+ greeter

可以使用 lightdm-gtk-greeter-settings 图形界面进行设置。

如果需要在 greeter 上使用自定义图片,请修改 /etc/lightdm/lightdm-gtk-greeter.conf 中的 background 变量值。变量位于 [greeter] 会话,例如:

/etc/lightdm/lightdm-gtk-greeter.conf
[greeter]
background=/usr/share/pixmaps/black_and_white_photography-wallpaper-1920x1080.jpg

注意: 建议将 PNG 或 JPG 文件放到 /usr/share/pixmaps,因为 LightDM 用户需要有背景文件的读取权限。

Webkit2 greeter

The lightdm-webkit2-greeter allows you to choose a background image directly on the login screen. It also offers an option to display a random image each time it starts. By default, images are sourced from /usr/share/backgrounds. You can change the background images directory by editing lightdm-webkit2-greeter.conf. For example:

/etc/lightdm/lightdm-webkit2-greeter.conf
[branding]
background_images = /usr/share/backgrounds

Unity greeter

如果使用的是 lightdm-unity-greeterAUR,请修改 /usr/share/glib-2.0/schemas/com.canonical.unity-greeter.gschema.xml,然后执行:

# glib-compile-schemas /usr/share/glib-2.0/schemas/

可以参考这个页面。

KDE greeter

转到 系统设置 > 登录界面 (LightDM) 设置你的主题与背景图片。

改变你的头像

Tip: If you are using KDE, you can change your avatar in KDE System Settings.

首先确保已安装 accountsservice 软件包,然后如下设置,把 username 替换为目标用户的登录名。文件名中不要加 .png 后缀。

  • 编辑或创建 /var/lib/AccountsService/users/username, 添加如下内容:
[User]
Icon=/var/lib/AccountsService/icons/username.png

I

  • 使用 96×96 PNG 图表文件来创建 /var/lib/AccountsService/icons/username.png.

注意: 确保创建的文件都是 644 权限,使用 chmod 来更正。

Arch 为中心的 64×64 图标来源

AUR 的 archlinux-artworkAUR 软件包包含了一些不错的例子。它们被安装到 /usr/share/archlinux/icons, 可如下复制到 /usr/share/icons/hicolor/64x64/devices:

# find /usr/share/archlinux/icons -name "*64*" -exec cp {} /usr/share/icons/hicolor/64x64/devices \;

复制之后,可删除 archlinux-artworkAUR.

启用自动登录

编辑 LightDM 配置文件,取消该行的注释,并添加要自动登陆的用户名:

/etc/lightdm/lightdm.conf
autologin-user=username

你必须是 autologin 组的成员来使得自己登录时不用输入密码:

# groupadd autologin
# gpasswd -a username autologin

注意: GNOME 用户, 更一般地 gnome-keyring 用户需要把他们的密码环设置一个空白密码以自动禁用。

启用无密码交互登录

LightDM goes through PAM so you must configure the lightdm configuration of PAM:

/etc/pam.d/lightdm
#%PAM-1.0
auth        sufficient  pam_succeed_if.so user ingroup nopasswdlogin
auth        include     system-login
...

You must then also be part of the nopasswdlogin group to be able to login interactively without entering your password:

# groupadd -r nopasswdlogin
# gpasswd -a username nopasswdlogin

Note: GNOME users, and by extension any gnome-keyring user may have to follow the instructions at the end of the previous section on enabling autologin.

To create a new user account that logs in automatically and additionally able to login again without a password the user can be created with supplementary membership of both groups, e.g.:

# useradd -mG autologin,nopasswdlogin -s /bin/bash username
0 0 投票数
Article Rating
订阅评论
提醒
guest

0 评论
内联反馈
查看所有评论
0
希望看到您的想法,请您发表评论x