ci, packaging and docs: GitHub Actions, systemd user unit, install task

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWSBjtVZ2zi8fJxS2hH
This commit is contained in:
ziadarafatandClaude Opus 5.5 committed 2026-10-30 16:12:42 -06:00
1 parent 04f028cb52
commit 56ce0401d9
5 files changed
+127 -23

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
name: ci
on:
push:
branches: [main]
pull_request:
jobs:
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: test -z "$(gofmt -l .)"
- run: go vet ./...
- run: go test ./...
env:
CGO_ENABLED: "0"
qml:
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- uses: actions/checkout@v4
- run: pacman -Syu --noconfirm --needed qt6-declarative qt6-websockets
- run: /usr/lib/qt6/bin/qmltestrunner -input ui/tests
env:
QT_QPA_PLATFORM: offscreen
QT_FORCE_STDERR_LOGGING: "1"
+38 -4
View File
@@ -3,9 +3,43 @@
On-screen HUD for Steam Input in **KDE Plasma (Wayland) Desktop Mode** on the Steam Deck:
- **Radial menu HUD**: see which radial item you're selecting, as in Game Mode.
- **Key-chord toasts**: see which keys a button just sent (`[R4] Ctrl + Shift + T`).
- **Layer cheat sheet**: see what every control does in the current action layer.
- **Key-chord toasts**: see which keys a button just sent (`[R4] → Meta + Shift + .`).
- **Action set / layer banner**: see when you switch sets or hold a layer (cheat sheet next).
Transparent, click-through overlays tinted with your KDE accent colour.
Overlays are translucent and click-through, and follow your KDE accent colour, including wallpaper-derived accents.
> Status: planning. See [docs/PLAN.md](docs/PLAN.md).
> Status: early development. See [docs/PLAN.md](docs/PLAN.md).
## How it works
`deckhudd` (Go) reads the Deck controller's raw HID reports passively alongside Steam. It also parses
your active Steam Input config, using Steam's `controller.txt` log to find it, and replays Steam's
activator/layer/radial logic. Events go over a token-protected loopback WebSocket to a QML overlay,
which runs on SteamOS's own Qt with LayerShellQt and Kirigami. Nothing touches the read-only root, and
nothing needs root.
## Try it
Requires [mise](https://mise.jdx.dev/) (for Go).
```sh
mise run build
./bin/deckhudd dump # what deckhud thinks your current layout does
./bin/deckhudd monitor # live button names / stick angles
./bin/deckhudd demo ui # scripted preview of the overlay (no controller needed)
./bin/deckhudd run ui # the real thing, from the source tree
./bin/deckhudd events # no overlay; print events as JSON lines
```
## Install (per user)
```sh
mise run install
systemctl --user enable --now deckhud # starts with Plasma, not in Game Mode
```
`mise run uninstall` removes it.
## Develop
TDD: `mise run test` (Go + Qt Quick Test, offscreen) and `mise run check` (vet, gofmt, qmllint).
+25 -19
View File
@@ -14,6 +14,12 @@ controllers, desktops and X11 are non-goals for v1.
---
## Progress log
- **2026-10-30:** M1–M6 core landed (parser, config model, HID, engine, daemon, overlay). Still needs hand-checking on the Deck: back-button bit mapping, radial geometry and fire behaviour, long/double-press timing, click-through.
---
## 1. What we found on the target system (2026-10-30)
| Item | Finding | Consequence |
@@ -141,7 +147,7 @@ commits.
Each milestone is a small, demoable vertical slice. Checkboxes become GitHub issues.
### M0: Spikes (time-boxed, throwaway code, findings recorded in `docs/research/`)
- [ ] **Overlay spike:** QML `Window` + `LayerShell.Window` (layer `LayerOverlay`, `keyboardInteractivity: None`,
- [x] **Overlay spike** ([findings](research/overlay-spike.md)): QML `Window` + `LayerShell.Window` (layer `LayerOverlay`, `keyboardInteractivity: None`,
`Qt.WindowTransparentForInput`), run via `/usr/lib/qt6/bin/qml`. Confirm transparency, click-through,
stays above fullscreen apps, no focus steal, and that the touchscreen and pointer pass through.
- [ ] **HID spike:** document the report `0x09` byte layout (buttons bitmask incl. L4/L5/R4/R5/QAM/…,
@@ -157,40 +163,40 @@ Each milestone is a small, demoable vertical slice. Checkboxes become GitHub iss
If yes, it is an optional ground-truth source for chords.
### M1: Config model
- [ ] `vdf` parser: quoted/unquoted tokens, escapes, `//` comments, `#include`/`#base`, duplicate keys, ordering
- [ ] `binding` grammar: `key_press`, `mouse_button`, `mouse_wheel`, `xinput_button`, `controller_action …`
- [x] `vdf` parser: quoted/unquoted tokens, escapes, `//` comments, `#include`/`#base`, duplicate keys, ordering
- [x] `binding` grammar: `key_press`, `mouse_button`, `mouse_wheel`, `xinput_button`, `controller_action …`
(`add_layer`, `hold_layer`, `remove_layer`, `change_preset`, `SHOW_KEYBOARD`, …), label + icon fields
- [ ] `steamcfg`: presets (action sets), action layers, `group_source_bindings` (incl. `active`/`inactive`/modeshift),
- [x] `steamcfg`: presets (action sets), action layers, `group_source_bindings` (incl. `active`/`inactive`/modeshift),
groups by mode (`four_buttons`, `dpad`, `radial_menu`, `touch_menu`, `joystick_move`, `trigger`, …)
- [ ] Resolver: userdata id → active desktop config (and per-app configs); `dump-config` CLI prints the model
- [x] Resolver: userdata id → active desktop config (and per-app configs); `dump-config` CLI prints the model
### M2: Controller input
- [ ] `hid` decoder (pure function: `[]byte → State`) tested with recorded reports
- [x] `hid` decoder (pure function: `[]byte → State`) tested with recorded reports
- [ ] Device discovery by VID/PID + usage page, reconnect on suspend/resume
- [ ] `record` / `replay` subcommands
- [x] `record` subcommand (`replay` still to do)
### M3: Engine
- [ ] Activators: `Full_Press`, `Start_Press`, `Release_Press`, `Long_Press`, `Double_Press`, `chord`, plus
soft-press for triggers, all on an injectable clock
- [ ] Action set switching and **layer stack** (add/hold/remove), with source-binding overrides per layer
- [ ] Radial menu: open/close, per-frame highlight index, fired item
- [ ] Chord events: button → resolved bindings → `{"glyph":"R4","keys":["Ctrl","Shift","T"],"label":"…"}`
- [x] Activators: `Full_Press`, `Start_Press`, `Release_Press`, `Long_Press`, `Double_Press` on an injectable clock
- [ ] `chord` activators, trigger soft-press, trackpad radial menus
- [x] Action set switching and **layer stack** (add/hold/remove), with source-binding overrides per layer
- [x] Radial menu: open/close, per-frame highlight index, fired item
- [x] Chord events: button → resolved bindings → `{"glyph":"R4","keys":["Ctrl","Shift","T"],"label":"…"}`
- [ ] Golden replay tests for each behaviour
### M4: Daemon + IPC
- [ ] `appwatch` (tail log, handle rotation), config hot-reload via fsnotify
- [ ] JSON-lines event protocol v1 (`hello`, `radial.open/highlight/close`, `chord`, `layer.changed`,
- [x] `appwatch` (tail log, handle rotation), config hot-reload via fsnotify
- [x] JSON event protocol v1 (over a token-guarded loopback **WebSocket**, since QML has no Unix-socket client) (`hello`, `radial.open/highlight/close`, `chord`, `layer.changed`,
`actionset.changed`, `sheet.show/hide`, `config.reloaded`)
- [ ] systemd user unit; only active in Plasma sessions (Game Mode already has Steam's own overlay)
- [x] systemd user unit; only active in Plasma sessions (Game Mode already has Steam's own overlay)
### M5: Radial HUD (first user-visible feature)
- [ ] `RadialHud.qml`: translucent accent-tinted ring, wedge per item, label + Steam binding icon,
- [x] `RadialHud.qml`: translucent accent-tinted ring, wedge per item, label + Steam binding icon,
animated highlight, "fired" flash, positioned per config (or centred)
- [ ] QML tests for wedge maths and highlight state
- [x] QML tests for wedge maths and highlight state
### M6: Chord toasts
- [ ] `ChordToast.qml`: glyph + key caps, stacking/queueing, configurable timeout and screen corner
- [ ] Coalesce repeats (holding a button doesn't spam), hide while a radial menu is open
- [x] `ChordToast.qml`: glyph + key caps, stacking/queueing, configurable timeout and screen corner
- [x] Coalesce repeats (holding a button doesn't spam), hide while a radial menu is open
### M7: Layer / action-set cheat sheet
- [ ] `LayerSheet.qml`: Deck outline with callouts for every mapped control in the current layer
+20
View File
@@ -23,3 +23,23 @@ run = ["go vet ./...", "test -z \"$(gofmt -l .)\"", "/usr/lib/qt6/bin/qmllint ui
[tasks.build]
description = "Build the daemon"
run = "go build -o bin/deckhudd ./cmd/deckhudd"
[tasks.install]
description = "Install deckhudd, the overlay and the systemd user unit under $HOME (does not enable it)"
depends = ["build"]
run = [
"install -Dm755 bin/deckhudd ~/.local/bin/deckhudd",
"rm -rf ~/.local/share/deckhud/ui && mkdir -p ~/.local/share/deckhud && cp -r ui ~/.local/share/deckhud/ui && rm -rf ~/.local/share/deckhud/ui/tests",
"install -Dm644 packaging/systemd/deckhud.service ~/.config/systemd/user/deckhud.service",
"systemctl --user daemon-reload",
"echo 'installed; enable with: systemctl --user enable --now deckhud'",
]
[tasks.uninstall]
description = "Stop and remove deckhud from $HOME"
run = [
"systemctl --user disable --now deckhud || true",
"rm -f ~/.local/bin/deckhudd ~/.config/systemd/user/deckhud.service",
"rm -rf ~/.local/share/deckhud",
"systemctl --user daemon-reload",
]
+13
View File
@@ -0,0 +1,13 @@
[Unit]
Description=deckhud: on-screen HUD for Steam Input in Plasma
Documentation=https://github.com/RustyRaptor/deckhud
PartOf=graphical-session.target
After=plasma-workspace.target
[Service]
ExecStart=%h/.local/bin/deckhudd run
Restart=on-failure
RestartSec=3
[Install]
WantedBy=plasma-workspace.target