Skip to content

Add fleetdeck update, an install script, and pause refresh on focus loss - #2

Merged
jayjongcheolpark merged 1 commit into
mainfrom
fm/fleetdeck-self-update
Oct 3, 2026
Merged

jayjongcheolpark merged 1 commit into
mainfrom
fm/fleetdeck-self-update

Conversation

@jayjongcheolpark

Copy link
Copy Markdown
Owner

What changed

  • fleetdeck update installs the latest GitHub Release over the running binary. It uses the self_update crate (GitHub backend, ureq + rustls, no token).
    • It selects fleetdeck-<version>-<target>.tar.gz by exact name for the target that the binary was built for.
    • It checks the archive against the release's SHA256SUMS (checksum_from_asset) before extraction.
    • It runs the new binary with --version (verify_binary), then renames it over the old one. If any step fails, the old binary stays.
    • fleetdeck update --check only reports whether a newer release exists.
  • install.sh (POSIX sh, for curl -fsSL …/main/install.sh | sh) detects OS and CPU, reads the latest tag from the releases/latest redirect, checks SHA256SUMS, and installs to ~/.local/bin or $FLEETDECK_INSTALL_DIR. It says when that directory is not on PATH. FLEETDECK_VERSION selects a version. CI now runs ShellCheck on it.
  • Pause on focus loss (captain's addition): the TUI enables focus reporting (EnableFocusChange). On FocusLost the timed refresh stops and the status bar shows paused. On FocusGained fleetdeck reads every home at once and the timer starts again. r still works while paused. A terminal that sends no focus events never pauses, so the old behavior stays.
  • README: install with the script, update with fleetdeck update, and the pause behavior.
  • Version 0.2.0.

Tests

  • update.rs: version comparison (v prefix, 0.9.0 < 0.10.0, bad input), archive selection for the four release targets (and no match for musl), and SHA256SUMS parsing in the exact sha256sum format of release.yml (right digest, tampered digest differs, missing entry is an error).
  • app.rs: focus loss pauses the timer, r still refreshes, focus gain refreshes once and resumes the timer.
  • cli.rs: update, update --check, bad arguments.
  • cargo fmt --check, cargo clippy -D warnings, cargo test --all --locked and ShellCheck pass locally.

Verified on this Mac (aarch64)

  • A build with the version set to 0.0.1: update --check reported 0.1.0, then update downloaded v0.1.0, passed the SHA256SUMS check, replaced itself, and --version printed fleetdeck 0.1.0.
  • install.sh with FLEETDECK_INSTALL_DIR in a scratch directory installed 0.1.0 and printed the PATH hint. A copy that corrupts the archive after download stopped with checksum mismatch and installed nothing. A version that does not exist stopped on the 404.
  • After v0.2.0 is tagged, ~/.local/bin/fleetdeck (0.1.0) cannot run fleetdeck update, because 0.1.0 has no update command. Update it once with install.sh (or replace it manually). fleetdeck update then works for later releases.

Focus events: herdr, Kaku, Ghostty

All three terminals implement focus reporting (DECSET 1004). I checked their binaries; I did not run a live focus test, because a live test moves the focus of windows on the captain's desktop.

  • herdr 0.9.3: it sends ESC[?1004h to the outer terminal, handles OuterFocusLost/OuterFocusGained, and keeps a per-pane focus_reporting input state. So herdr forwards focus events to a pane that enables them.
  • Kaku (WezTerm based): has FocusTracking mode and a focus_changed: focus-tracking response path.
  • Ghostty: has the focus_event mode.

To check live: run fleetdeck, click another window, and look for paused in the status bar. Click back: paused goes away and the status bar shows reading….

- `fleetdeck update` installs the latest GitHub Release over the running
  binary with self_update. It picks the archive for the build target,
  checks it against the release's SHA256SUMS, runs the new binary with
  --version, and renames it into place. `--check` only reports.
- install.sh detects OS and CPU, checks SHA256SUMS, and installs to
  ~/.local/bin or $FLEETDECK_INSTALL_DIR. CI runs ShellCheck on it.
- The TUI enables focus reporting. On focus loss the timed refresh stops
  and the status bar shows "paused"; on focus gain it refreshes at once.
- Bump the version to 0.2.0.
@jayjongcheolpark
jayjongcheolpark merged commit 9b36ac7 into main Oct 3, 2026
3 checks passed
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.

1 participant