方法一:使用xfce Session and Startup

方法二:使用service

/etc/systemd/system/ 目录下新建一个 x.service 文件

1
2
3
4
5
6
7
8
[Unit]
Description=Script

[Service]
ExecStart=/usr/bin/script

[Install]
WantedBy=multi-user.target

设置该 service 随系统启动

1
2
sudo chmod 755 /usr/bin/script
sudo systemctl enable script.service