增加待机报文缓存,无网状态也能执行待机任务;投影仪指令结果以设备状态为准
This commit is contained in:
59
init_device.md
Normal file
59
init_device.md
Normal file
@@ -0,0 +1,59 @@
|
||||
### ubuntu 24 开机慢优化
|
||||
|
||||
```bash
|
||||
# 在 systemd-networkd-wait-online.service Service 加入 TimeoutStartSec=2sec
|
||||
sudo vim /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service
|
||||
```
|
||||
|
||||
### 初始化设备
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install curl gpg
|
||||
sudo add-apt-repository ppa:xtradeb/apps
|
||||
sudo add-apt-repository ppa:trzsz/ppa
|
||||
sudo apt install -y ungoogled-chromium fonts-noto-cjk fonts-noto-color-emoji unclutter xorg i3-wm libvlc-dev libasound2-dev alsa-utils trzsz wireguard wireguard-tools
|
||||
sudo timedatectl set-timezone Asia/Shanghai
|
||||
sudo usermod -aG audio,video,dialout $USER
|
||||
```
|
||||
|
||||
### 配置 wireguard
|
||||
|
||||
从服务器获取配置文件,保存到 `/etc/wireguard/wg0.conf`,并修改配置文件
|
||||
|
||||
> Interface 的 DNS 移除掉,不要配置
|
||||
|
||||
```bash
|
||||
sudo vim /etc/wireguard/wg0.conf
|
||||
```
|
||||
|
||||
### 开启 wireguard
|
||||
|
||||
```bash
|
||||
sudo systemctl enable wg-quick@wg0
|
||||
sudo systemctl start wg-quick@wg0
|
||||
```
|
||||
|
||||
### 自动启动 Xorg 和窗口管理器
|
||||
|
||||
编辑 `.bashrc`文件,在文件的末尾添加以下行:
|
||||
|
||||
```bash
|
||||
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
|
||||
startx
|
||||
fi
|
||||
```
|
||||
|
||||
这会在你登录后,自动启动 Xorg 和窗口管理器。该脚本检查当前是否在 tty1 控制台(默认终端)上
|
||||
|
||||
### 自动登录
|
||||
|
||||
编辑 `/etc/systemd/system/getty.target.wants/getty@tty1.service` 文件,将 `ExecStart` 行修改为:
|
||||
|
||||
```bash
|
||||
ExecStart=-/sbin/agetty --autologin <your_username> --noclear %I $TERM
|
||||
```
|
||||
|
||||
其中:
|
||||
|
||||
- <your_username>:替换为你想自动登录的用户名。
|
||||
Reference in New Issue
Block a user