[OneDev #32] axon: resolve awaken.file path relative to profile dir, not cwd #5

Closed
opened 2026-05-24 04:46:36 +00:00 by joseph · 1 comment
Owner

Imported from OneDev issue #32 (id 35555)
Original project: internal-joseph
Original state: Closed
Original submitterId: 5
Original submitDate: 2026-05-05T19:19:33.037+00:00
Original lastActivity: {'date': '2026-05-05T21:27:25.835+00:00', 'description': "changed state to 'Closed'", 'userId': 5}

Original fields:

  • Type: New Feature
  • Priority: Normal
  • Assignees: None

Issue

G915XDriver.configure() stores awaken.file as a literal string from YAML and awaken() opens it via Path(writes_file).read_text() — which resolves relative to the current working directory at runtime, not the profile file's location.

If axon is launched from anywhere other than ~/git/axon/ (e.g. autostart, scheduled task, system service), replay_hid_writes will silently fail with FileNotFoundError and the daemon will crash before opening the device.

Fix

In axon/cli.py or axon/profile.py, resolve any file: paths inside DeviceConfig.extra against profile_path.parent at load time, so the value passed to replay_hid_writes is already absolute.

Alternative: pass profile_path.parent into Daemon.__init__() and have it inject the base path into driver.configure(cfg.extra, base_path). Cleaner architecturally.

Why this matters

Issue internal-joseph#30 (productize as autostart service) will run from a different cwd. This needs to be fixed before that lands.

  • Plan: internal-joseph/docs/2026-05-05-inputd-core.md Task 5
  • File: axon/drivers/g915x.py:46-55
Imported from OneDev issue #32 (id 35555) Original project: internal-joseph Original state: Closed Original submitterId: 5 Original submitDate: 2026-05-05T19:19:33.037+00:00 Original lastActivity: {'date': '2026-05-05T21:27:25.835+00:00', 'description': "changed state to 'Closed'", 'userId': 5} Original fields: - Type: New Feature - Priority: Normal - Assignees: None ## Issue `G915XDriver.configure()` stores `awaken.file` as a literal string from YAML and `awaken()` opens it via `Path(writes_file).read_text()` — which resolves relative to the **current working directory at runtime**, not the profile file's location. If axon is launched from anywhere other than `~/git/axon/` (e.g. autostart, scheduled task, system service), `replay_hid_writes` will silently fail with `FileNotFoundError` and the daemon will crash before opening the device. ## Fix In `axon/cli.py` or `axon/profile.py`, resolve any `file:` paths inside `DeviceConfig.extra` against `profile_path.parent` at load time, so the value passed to `replay_hid_writes` is already absolute. Alternative: pass `profile_path.parent` into `Daemon.__init__()` and have it inject the base path into `driver.configure(cfg.extra, base_path)`. Cleaner architecturally. ## Why this matters Issue internal-joseph#30 (productize as autostart service) will run from a different cwd. This needs to be fixed before that lands. ## Related - Plan: `internal-joseph/docs/2026-05-05-inputd-core.md` Task 5 - File: `axon/drivers/g915x.py:46-55`
Author
Owner

Imported from OneDev comment id 552 on issue #32
Original userId: 5
Original date: 2026-05-05T21:27:24.835+00:00

Resolved in axon commit bba3d21. load_profile() now resolves file: keys inside DeviceConfig.extra against the profile path's parent dir at load time. The Frida writes file is bundled at profiles/g915x_open_writes_frida.txt and default.yaml references it as a bare filename. Test added: test_awaken_file_path_resolved_against_profile_dir. axon is now self-contained — axon --profile profiles/default.yaml activates the keyboard from cold without requiring a separate gopen step.

Imported from OneDev comment id 552 on issue #32 Original userId: 5 Original date: 2026-05-05T21:27:24.835+00:00 Resolved in axon commit `bba3d21`. `load_profile()` now resolves `file:` keys inside `DeviceConfig.extra` against the profile path's parent dir at load time. The Frida writes file is bundled at `profiles/g915x_open_writes_frida.txt` and `default.yaml` references it as a bare filename. Test added: `test_awaken_file_path_resolved_against_profile_dir`. axon is now self-contained — `axon --profile profiles/default.yaml` activates the keyboard from cold without requiring a separate `gopen` step.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
joseph/internal-joseph#5
No description provided.