在使用 WM
桌面环境的时候,配置 ttyN
指定跳过输入密码且自动执行 startx
无疑会带来更加好的体验。以下是参考 Arch Wiki 相关配置内容,书写的配置笔记。
直接运行:
|
|
其中 tty1
为指定的 tty
。
或者使用手动的方式编辑 getty@tty1
文件:
|
|
最后在 /etc/systemd/system/[email protected]/override.conf
添加以下内容:
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin username --noclear %I $TERM
这里的 ExecStart=
不要删掉,这里是先清除 ExecStart
原有的内容,然后在引入新的 exec
命令。
username
为你的用户的用户名称。
这个时候就实现了指定 tty
免密登录了。
接着就是配置 x11
默认执行 startx
,根据 Arch Wiki 在指定 shell
初始化文件中添加以下代码:
Bash
: ~/.bash_profile
Zsh
: ~/.zprofile
官方配置:
|
|
我的配置:
|
|