[Unit] Description=Morning Routine (workout lock) After=graphical-session.target [Service] Type=simple # Started by wake-alarm-trigger.timer at the phone's synced alarm time, so # there is intentionally no [Install] WantedBy=graphical-session.target: it # must only run at alarm time, never on an ordinary evening login. # DISPLAY/PYTHONPATH mirror workout-locker.service so Tk can open the X server; # the short sleep lets the session export DISPLAY first. Environment=DISPLAY=:0 Environment=PYTHONPATH=%h/src/testsAndMisc ExecStartPre=/bin/sleep 1 ExecStart=/usr/bin/python -m python_pkg.morning_routine._orchestrator --production WorkingDirectory=%h/src/testsAndMisc Restart=on-failure RestartSec=2s RestartPreventExitStatus=0 User=%u