diff --git a/rpi-scripts/gui/gui-start.service b/rpi-scripts/gui/gui-start.service index c8ac916..07d4930 100644 --- a/rpi-scripts/gui/gui-start.service +++ b/rpi-scripts/gui/gui-start.service @@ -9,16 +9,19 @@ [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 -ExecStart=/usr/bin/python3 /home/pi/git/rpi-interface-board/rpi-scripts/gui/main.py + +# 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=always +Restart=no [Install] WantedBy=default.target