> For the complete documentation index, see [llms.txt](https://handbook.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://handbook.bsdcn.org/di-6-zhang-freebsd-zhong-de-wayland/6.8.-wayland-deng-lu-guan-li-qi.md).

# 6.8.Wayland 登录管理器

虽然有多种登录管理器，并且它们正在慢慢迁移到 Wayland 上，其中一个选择是 [x11/ly](https://cgit.freebsd.org/ports/tree/x11/ly/) 文本用户界面（TUI）管理器。`ly` 的配置最简单，能通过在系统初始化时展示登录窗口来启动 Sway、Wayfire 等。要安装 `ly`，可以执行以下命令：

```sh
# pkg install ly
```

系统会给出一些配置提示。其中关键的一步是将以下内容添加到 **/etc/gettytab** 文件中：

```ini
Ly:\
  :lo=/usr/local/bin/ly:\
  :al=root:
```

然后修改 **/etc/ttys** 文件中的 `ttyv1` 行，修改为以下内容：

```ini
ttyv1 "/usr/libexec/getty Ly" xterm onifexists secure
```

重启系统后，登录界面应该会出现。要配置特定的设置，如语言，可以编辑 **/usr/local/etc/ly/config.ini** 文件。至少，这个文件中应该指定之前在 **/etc/ttys** 文件中设置的 tty。

> **注意**
>
> 如果将 `ttyv0` 设置为登录终端，可能需要按下 **alt** 和 **F1** 键，才能正确看到登录窗口。

当登录窗口出现时，使用左右箭头键可以切换不同的支持的窗口管理器。
