[Unit] Description=Monitor GUI After=graphical.target [Service] Type=simple WorkingDirectory=/home/forlinx/Desktop/workspace/monitor ExecStart=bash run.sh SyslogIdentifier=monitor Restart=always RestartSec=3 User=forlinx Environment=DISPLAY=:0 # Environment=XAUTHORITY=/home/forlinx/.Xauthority # 如果需要日志 StandardOutput=journal StandardError=journal [Install] WantedBy=graphical.target