Skip to content

feat: add stem press track control and headless mode support#469

Open
andreyondemand wants to merge 3 commits intokavishdevar:linux/rustfrom
andreyondemand:linux/rust
Open

feat: add stem press track control and headless mode support#469
andreyondemand wants to merge 3 commits intokavishdevar:linux/rustfrom
andreyondemand:linux/rust

Conversation

@andreyondemand
Copy link

  • Parse STEM_PRESS packets and emit AACPEvent::StemPress with press type and bud side
  • Enable double/triple tap detection on init via StemConfig control command (0x06)
  • Double press → next track, triple press → previous track via MPRIS D-Bus
  • Add next_track() and previous_track() to MediaController
  • Add --no-tray flag for headless operation without a GUI
  • Replace unwrap() on ui_tx.send() calls with graceful warn! logging

(vibecoded)

- Parse STEM_PRESS packets and emit AACPEvent::StemPress with press type and bud side
- Enable double/triple tap detection on init via StemConfig control command (0x06)
- Double press → next track, triple press → previous track via MPRIS D-Bus
- Add next_track() and previous_track() to MediaController
- Add --no-tray flag for headless operation without a GUI
- Replace unwrap() on ui_tx.send() calls with graceful warn! logging

(vibecoded)
@kavishdevar
Copy link
Owner

kavishdevar commented Mar 4, 2026

This would be a great addition, but I think this should be kept optional as some environments do handle the AVRCP commands from AirPods directly.

Add a --no-stem-control CLI flag and a toggle in the Settings tab for
environments that handle AirPods AVRCP commands natively (e.g. via
BlueZ/PipeWire). The feature remains enabled by default.

- Load stem_control from app settings JSON on startup; --no-stem-control
  overrides it to false regardless of the saved value
- Share an Arc<AtomicBool> between the async backend and the GUI thread;
  AirPodsDevice holds the Arc directly so the event loop reads the live
  value on every stem press — toggle takes effect immediately without
  reconnecting
- Persist stem_control to settings JSON alongside theme and tray_text_mode
- Add a "Controls" section to the Settings tab with a toggler labelled
  "Stem press track control", with a subtitle explaining the AVRCP
  conflict scenario
- Fix StemConfig bitmask comment to clarify it uses a separate numbering
  scheme from the StemPressType event enum values (0x05–0x08)
@andreyondemand
Copy link
Author

Added toggle in GUI settings, enabled by default. Also a CLI flag

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.

2 participants