> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/di-12-zhang-wayland-xi-tong/di-12.2-jie-wayland-xian-shi-guan-li-qi.md).

# 12.2 Wayland 显示管理器

## SDDM

SDDM 基于 QML，不仅支持 X11，还支持 Wayland 会话。在默认情况下，SDDM 界面左下角为 Wayland，如不是可手动修改。

还需要修改配置文件 **/usr/local/etc/sddm.conf** 启用 Wayland，查找下列文字：

```ini
#[General]
#DisplayServer=wayland
#GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell

#[Wayland]
#CompositorCommand=dbus-run-session ck-launch-session -- kwin_wayland --drm --no-lockscreen --no-global-shortcuts
```

将其注释全部取消掉，即为：

```ini
[General]
DisplayServer=wayland
GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell

[Wayland]
CompositorCommand=dbus-run-session ck-launch-session -- kwin_wayland --drm --no-lockscreen --no-global-shortcuts
```

然后重新启用 SDDM 服务即可：

```sh
# service sddm restart
```

## Ly

Ly 是 TUI 界面的登录管理器，界面较为简洁。

通过 pkg 安装：

```sh
# pkg install ly
```

通过 Ports 安装：

```sh
# cd /usr/ports/x11/ly/ 
# make install clean
```

使用 `pkg info -D ly` 获取最新的安装说明。

将以下行加入 **/etc/gettytab**，设置 Ly 条目：

```sh
Ly:\
	:lo=/usr/local/bin/ly_wrapper:\
	:al=root:
```

编辑 **/etc/ttys**，将以下行：

```sh
ttyv1	"/usr/libexec/getty Pc"		xterm	onifexists secure
```

修改为

```sh
ttyv1   "/usr/libexec/getty Ly"		xterm   on secure
```

重启系统即可。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://book.bsdcn.org/di-12-zhang-wayland-xi-tong/di-12.2-jie-wayland-xian-shi-guan-li-qi.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
