feat: start at login from the tray or the window's settings menu #25
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/18-start-at-login"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #18
What
$XDG_CONFIG_HOME/autostart/krane.desktop(or~/.config/autostart/…). That entry starts Krane in the tray only: Exec has no--show. Turning it off removes the file.How (following Nye's notes on #18)
Hidden=trueorX-GNOME-Autostart-enabled=false). So deleting the file, or turning it off in the desktop's startup settings, shows as off in both menus. The window re-reads it each time the menu opens, and the tray re-reads it whenever it rebuilds its menu.kranewhen it's on PATH (deb/rpm). Otherwise it is this binary's own path (tarball installs), quoted per the Desktop Entry spec (spaces,",$,`,\,%%).X-GNOME-Autostart-Delay=3gives the tray host time to come up at login./etc/xdg/autostartis never touched.tray::refresh).MenuEntrynow supportscheckable(a check mark). New screenshot scenesettings.Tests
--show, Exec quoting, the desktop's off keys, and writing, rewriting and removing the file (in a temp dir).XDG_CONFIG_HOMEset to a temp dir): window menu on → file written; the tray showed it checked; tray toggle off → file removed.mock, build, and tests (18 + 21 pass).Stacked on #24 (
feat/17-image-pull).e013ef52de440c6b710fRebased on #24 at
1848c37; now440c6b7. No changes to #18 itself.Review from Nye (posted by Upper Wolfjaw; Nye can't comment here).
PR #25 (#18 start at login) review, head
e013ef5— REQUEST CHANGES (1 finding)Check C5 passes: fmt, clippy -D warnings (with/without mock), 18 tests, mock build.
Live on Xfce (real panel, real Docker):
F6 (medium) — no tray icon when Krane starts before the panel's tray
At login, xfce4-session can start autostart apps before xfce4-panel's StatusNotifierWatcher is on the bus
(X-GNOME-Autostart-Delay is GNOME-only). tray.spawn() then fails with ServiceUnknown, tray.rs logs
"Failed to create tray" and returns, but Krane keeps running: no icon, no window. Nothing re-registers later.
Proof: notes/pr25-f6-proof.sh (+ notes/sni_watcher.py, a minimal watcher). Runs Krane on a private session bus,
starts the watcher 3 s later, checks Krane registers. Fails on
e013ef5.Fix (tested, proof passes): src/tray.rs
tray.assume_sni_available(true).spawn().await— ksni 0.3 thenregisters when the watcher's name appears (service.rs NameOwnerChanged loop).
Note (not a separate finding)
docs/screenshots/settings*.png show the "Docker Reported an Error: Pull cancelled" alert behind the menu:
the settings setup step calls cancelPull right after the pull step, which is F3 on PR #24. Regenerate the
screenshots after the F3 fix lands and check settings*.png is clean.
Nits (optional)
kraneis on PATH, even when running a different build; fine for deb/rpm.440c6b710f451e8afdca