diff --git a/rpi-scripts/gui/gui-start.service b/rpi-scripts/gui/gui-start.service index bf7a7c3..c8ac916 100644 --- a/rpi-scripts/gui/gui-start.service +++ b/rpi-scripts/gui/gui-start.service @@ -1,14 +1,24 @@ +# systemd service file for auto starting the python gui +# at the correct time after startup (when window manager finished starting) + + +# Usage: +# - Install: `sudo cp rpi-scripts/gui/gui-start.service /etc/systemd/system/` +# - Enable autostart: `sudo systemctl enable gui-start.service` +# - Disable autostart: `sudo systemctl disable gui-start.service` + [Unit] -Description=Start Python GUI on boot -After=graphical.target +Description=Start Python GUI for IO-control and monitoring after startup +After=display-manager.service +Wants=display-manager.service [Service] Environment=DISPLAY=:0 -ExecStart=/bin/python ./main.py +ExecStart=/usr/bin/python3 /home/pi/git/rpi-interface-board/rpi-scripts/gui/main.py WorkingDirectory=/home/pi/git/rpi-interface-board/rpi-scripts/gui User=pi Group=pi Restart=always [Install] -WantedBy=graphical.target +WantedBy=default.target