Skip to content

feat(audio): Corsair VOID Elite auto-switch + portable Arch installer - #205

Merged
codepuncher merged 7 commits into
masterfrom
feat/corsair-headset-autoswitch
Jun 22, 2026
Merged

codepuncher merged 7 commits into
masterfrom
feat/corsair-headset-autoswitch

Conversation

@codepuncher

Copy link
Copy Markdown
Owner

What

Two related changes.

1. Portable Arch package installer (Manjaro/pamac -> any Arch + paru)

The installer hard-assumed Manjaro/pamac, so it did nothing on CachyOS (ID=cachyos, ships paru). Now:

  • New shell/functions helpers: detect_aur_helper (prefers paru -> pamac -> yay), arch_install (paru/yay without sudo, pamac with sudo), enable_aur (pamac-only AUR config), and is_arch (true on ID=arch or ID_LIKE containing arch).
  • All former pamac call sites (install_arch_packages, post_install_packages, setup_arch_system_emoji_support) route through arch_install.
  • setup.sh OS gate broadened from ID=manjaro to is_arch, so the Arch path runs on CachyOS/EndeavourOS/etc. WSL (apt) and macOS paths are unaffected.

2. Headset auto-switch daemon

The VOID Elite's USB dongle stays connected whether the headset is on or off, so neither udev nor PipeWire node events fire on power toggle. Detection instead polls headsetcontrol -o json for .devices[0].battery.status.

  • bin/corsair-headset-switch: a systemd --user poll loop (2s). On power-on it sets the VOID Elite as the default PipeWire sink; on power-off it restores the previously-default sink. Edge-detected in memory; baseline state captured at startup so a restart never hijacks audio; transient query failures hold state rather than flipping the sink.
  • systemd/corsair-headset.service unit, symlinked into ~/.config/systemd/user/ via a new move_link line.
  • headsetcontrol added to the Arch package list.

Enabling

setup.sh symlinks the unit; enable it once (kept manual, by design):

systemctl --user daemon-reload
systemctl --user enable --now corsair-headset.service

Verification

  • ShellCheck clean on shell/functions and bin/corsair-headset-switch.
  • Live end-to-end on CachyOS: service active; powering the headset on switched the default sink to the VOID Elite, powering it off restored HDMI (confirmed in journalctl --user -u corsair-headset).

@codepuncher
codepuncher force-pushed the feat/corsair-headset-autoswitch branch from 8e37925 to ad057bc Compare June 22, 2026 21:27
@codepuncher
codepuncher merged commit 4a4bb61 into master Jun 22, 2026
2 checks passed
@codepuncher
codepuncher deleted the feat/corsair-headset-autoswitch branch June 22, 2026 21:29
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