1. 安装 numlockx

sudo apt update
sudo apt install numlockx

创建一个 systemd service 用于开机自启动

vi ~/numlock.service
[Unit]
Description=numlock

[Service]
ExecStart=/usr/bin/numlockx on
StandardInput=tty
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

3. 添加为开机自启动

sudo cp ~/numlock.service /usr/lib/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable numlock.service
sudo systemctl start numlock.service

标签: none

添加新评论