Skip to content

feat: add audio device switcher to bar#131

Open
flathead wants to merge 1 commit intoAxenide:devfrom
flathead:feature/audio-device-switcher
Open

feat: add audio device switcher to bar#131
flathead wants to merge 1 commit intoAxenide:devfrom
flathead:feature/audio-device-switcher

Conversation

@flathead
Copy link
Copy Markdown

@flathead flathead commented Mar 25, 2026

Adds a bar button for switching audio output/input devices with a popup selector.

What was added

New file

modules/bar/AudioDeviceSwitcher.qml -- bar button that:

  • Shows a dynamic icon based on the current default sink type
  • Opens a popup with Output and Input sections listing available devices
  • Clicking a device sets it as the default sink/source
  • Supports headset battery display (ArctisManager D-Bus) when a headset-type sink is active
  • Filters out devices listed in the exclusion config

Device type detection

Icons are assigned dynamically from PipeWire node properties, not hardcoded names:

Type Icon Detection
HDMI/DP speakerHigh device.profile.name contains hdmi or displayport
Headphones/USB headphones device.bus is usb or bluetooth, or headset/headphone profile
Audio processor faders node.virtual=true or application.id matches easyeffects, carla, jamesdsp, pulseeffects
Virtual routed sink inherits from driver node.driver-id traced to real device, classified by its properties
Speakers speaker PCI analog, fallback
Microphone mic any source

Settings integration

config/Config.qml -- added showAudioDeviceSwitcher (bool, default true) and excludedAudioSinks (string list, default empty) to the bar adapter.

modules/widgets/dashboard/controls/ShellPanel.qml -- added to Bar section:

  • Toggle: "Show Audio Device Switcher"
  • Chip selector: "Hidden Audio Devices" with clickable chips for all current audio devices. Click to exclude, click again to restore. Follows the same pattern as the Screen selector.

modules/widgets/dashboard/controls/SettingsIndex.qml -- added search entries for "Audio Device Switcher" and "Excluded Audio Sinks".

Modified files

modules/bar/BarContent.qml -- added AudioDeviceSwitcher via Loader in both horizontal and vertical layouts, between ControlsButton and BatteryIndicator. Visibility controlled by Config.bar.showAudioDeviceSwitcher.

Demo

1
2026-04-01T21-22-02-413Z.mp4

Add a bar button for switching audio output/input devices with a popup
selector. Device type icons (headphones, speakers, HDMI, mic) are
determined dynamically from PipeWire node properties instead of
hardcoded name matching.

Includes settings integration:
- Toggle to show/hide the switcher
- Comma-separated exclusion list to hide unwanted sinks from the popup

New files:
- modules/bar/AudioDeviceSwitcher.qml

Modified files:
- modules/bar/BarContent.qml
- config/Config.qml
- modules/widgets/dashboard/controls/ShellPanel.qml
- modules/widgets/dashboard/controls/SettingsIndex.qml
@Axenide
Copy link
Copy Markdown
Owner

Axenide commented Mar 28, 2026

Nice, please add some screenshots. :)

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