testsAndMisc/python_pkg/morning_routine/morning-routine.service
Krzysztof kuhy Rudnicki 42e41319dd
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
Pre-commit checks / pre-commit (push) Has been cancelled
Python tests / test (push) Has been cancelled
Shell tests / shell-tests (push) Has been cancelled
Shell tests / arch-tests (push) Has been cancelled
Drop the alarm leg from the morning routine
wake_alarm._alarm no longer exists: the PC's waking role was deleted in
kuhyx/wake-alarm, and the phone owns the alarm now. This removes ALARM_MODULE,
_run_alarm() and the --with-alarm flag, leaving one leg -- the workout lock.

Landing this in the same change as the deletion is the point. An orchestrator
left pointing at a module that no longer exists is exactly the failure this
repo has already had once: after screen-locker was extracted on 2026-05-28 the
reference here went stale and the workout lock died with ModuleNotFoundError on
every run for a month, while the alarm half kept working and hid it.

morning-routine.service loses --with-alarm and its comments now name what
actually starts it: wake-alarm-trigger.timer, at the phone's synced alarm time,
not the deleted systemd-sleep hook. Environment=DISPLAY=:0 stays -- the comment
credited it to the alarm's Tk window, but workout-locker.service needs it too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PcdngP688mW6rJye3LRkSN
2026-08-30 15:26:04 +02:00

21 lines
731 B
Desktop File

[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/testsAndMisc
ExecStartPre=/bin/sleep 1
ExecStart=/usr/bin/python -m python_pkg.morning_routine._orchestrator --production
WorkingDirectory=%h/testsAndMisc
Restart=on-failure
RestartSec=2s
RestartPreventExitStatus=0
User=%u