# 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 for IO-control and monitoring after startup # note: when using After=graphical.target: it only starts after successful network connection... After=display-manager.service Wants=display-manager.service [Service] Environment=DISPLAY=:0 # note: some delay is needed for DISPLAY :0 to be available ExecStart=/bin/bash -c "/bin/sleep 6 && /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=no [Install] WantedBy=default.target