Skip to content

packaging: add a systemd user unit for the LCD stats ticker - #294

Open
Dexlabo wants to merge 1 commit into
Lexonight1:mainfrom
Dexlabo:feature/display-ticker-unit
Open

Dexlabo wants to merge 1 commit into
Lexonight1:mainfrom
Dexlabo:feature/display-ticker-unit

Conversation

@Dexlabo

@Dexlabo Dexlabo commented Sep 8, 2026

Copy link
Copy Markdown

The gap

trccd.service registers the IPC daemon, but nothing drives the panel on login. After a reboot the LCD keeps whatever frame it last had until someone opens the GUI or runs trcc display play by hand. On a machine where the cooler display is the point, that reads as "the app stopped working."

What this adds

  • packaging/systemd/trcc-display.service — user unit running the render-and-send ticker
  • packaging/systemd/trcc-display-ticker — small wrapper that resolves the device via trcc detect, so the unit hardcodes no VID:PID. display play requires an explicit key, and a shipped unit naming one contributor's panel is useless to everyone else. TRCC_DEVICE / TRCC_BIN overrides come from ~/.config/trcc/ticker.env for multi-panel setups and pip/pipx installs.
  • README — install/uninstall, the env-file overrides, and an explicit note that trccd and trcc-display must not both run, since only one process can hold a panel's USB interface.

Design notes

Restart=always with StartLimitBurst=0: USB enumeration frequently lands after graphical-session.target, so a first attempt at login often finds no device. The helper exits non-zero when nothing is detected, letting systemd back off and retry rather than recording a success and giving up.

ExecStopPost blanks the panel, so stopping the unit doesn't leave a stale frame lit.

Testing

Arch Linux, Hyprland, Thermalright Trofeo Vision 9.16 (0416:5408, ly wire, 1920×462):

  • survives reboot; the ticker drives the panel from login
  • device detection still resolves the key while the ticker holds the interface
  • systemd-analyze verify clean once the helper is installed to /usr/bin

Separate finding, not fixed here

When another process holds the USB interface, the GUI's splash blocks indefinitely instead of reporting the device is busy — discover_and_connect during bootstrap hangs rather than raising. With a ticker running this is easy to hit, and it presents as a frozen app with nothing in ~/.trcc/trcc.log. The README works around it by telling users to stop the unit first, but a "device busy — stop trcc-display.service" error would be the real fix. Happy to open a separate issue if useful.

trccd.service covers the IPC daemon, but nothing drives the panel on
login — so after a reboot the LCD holds whatever frame it had until
someone opens the GUI or runs `trcc display play` by hand. This adds the
missing piece.

- packaging/systemd/trcc-display.service — user unit running the ticker
- packaging/systemd/trcc-display-ticker — wrapper that resolves the
  device via `trcc detect` so the unit hardcodes no VID:PID, with
  TRCC_DEVICE / TRCC_BIN overrides via ~/.config/trcc/ticker.env
- README: install/uninstall, the env-file overrides, and the fact that
  trccd and trcc-display must not both run

Restart=always with StartLimitBurst=0 because USB enumeration frequently
lands after graphical-session.target; the helper exits non-zero when no
device is present so systemd backs off and retries rather than treating
it as success.

Tested on Arch (Hyprland, Thermalright Trofeo Vision 9.16, 0416:5408,
ly wire, 1920x462): survives reboot, ticker drives the panel from login,
and detection still resolves the key while the ticker holds the
interface.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 8, 2026 22:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Dexlabo Dexlabo left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (human + GitKraken MCP — no GK AI credits)

Verdict: Looks good to merge from a packaging/design standpoint, with small non-blocking hardening notes. (GitHub won’t let the author approve their own PR, so this is a comment review.)

What works

  • trcc-display-ticker auto-detects via trcc detect, with TRCC_DEVICE / TRCC_BIN overrides — right call for a shipped unit.
  • Restart=always + StartLimitBurst=0 + exit 1 on missing device matches late USB at login.
  • README documents the USB mutex with trccd and the GUI-busy workaround.
  • Matches existing trccd.service style; real hardware test called out (Trofeo Vision 0416:5408).

Nits (non-blocking)

  1. ExecStopPost is fragile — empty detect still runs display sleep "". Prefer reuse of the helper (or no-op when no key). Also it only uses ${TRCC_BIN:-/usr/bin/trcc} and won’t fall back to PATH the way the helper does, so pip/pipx-only installs may fail to blank on stop.
  2. Helper path is root-onlyExecStart=/usr/bin/trcc-display-ticker + sudo install is fine for distro packaging, awkward for fully user-local installs. Optional: allow ~/.local/bin for the helper.
  3. Follow-up — GUI hang when USB is busy (noted in the PR body) deserves its own issue; README workaround isn’t enough long-term.

Checks

No CI/reviews previously; Copilot review failed on quota. Merge state was otherwise mergeable.

@Lexonight1

Copy link
Copy Markdown
Owner

@Dexlabo — thank you for this, and apologies for the delay.

A systemd user unit is the right shape for the stats ticker — it's what the platform expects, rather than us inventing our own supervision. There are two reviews on it already; I haven't given it a proper pass yet and didn't want that to keep reading as silence.

It's wanted and it hasn't been forgotten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants