Skip to content

feat(audio): add output port selection - #2779

Merged
bbedward merged 7 commits into
duxlabs-dev:masterfrom
wongcallum:feat/audio-output-port-selection
Aug 20, 2026
Merged

bbedward merged 7 commits into
duxlabs-dev:masterfrom
wongcallum:feat/audio-output-port-selection

Conversation

@wongcallum

@wongcallum wongcallum commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a button to each audio output device in the control center which opens an output port selection modal. This allows users to switch from e.g. speakers to headphones without having to open pavucontrol.

I decided to add a button cuz that's how KDE Plasma does it. Happy to switch to a dropdown if preferred.

Quickshell.Services.Pipewire doesn't expose an interface to switch ports, so I used pactl in a similar way to the existing Bluetooth codec selector, using Proc.runCommand. If pactl is missing or an error happens, the button doesn't appear, so there is no need to warn about that.

This PR only handles output sinks, and only adds the selector to the control center and not the audio settings window. I'd like to open separate PRs for these to keep this one manageable. They should be fairly easy.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor / internal cleanup
  • Documentation
  • Other

Related issues

Closes #330

Screenshots / video

output-port-selection.mp4

Checklist

@wongcallum
wongcallum marked this pull request as ready for review July 8, 2026 23:29
Comment thread quickshell/Services/AudioService.qml Resolved
@wongcallum

Copy link
Copy Markdown
Contributor Author

Do you think it's worth refactoring this and BluetoothCodecSelector to use a common modal parent? Not DankModal because it spawns an overlay over the entire compositor, these both spawn one inside the control centre.

It seems to fit nicely when I vibe-refactored with Claude.

@bbedward

Copy link
Copy Markdown
Member

Yea I think that makes sense

@wongcallum

Copy link
Copy Markdown
Contributor Author

I was thinking of doing that refactor in a new PR, is there anything preventing this one from being merged?

Comment thread quickshell/Services/AudioService.qml Outdated
let availability = "unknown";
if (meta.includes("not available") || meta.includes("available: no"))
availability = "no";
else if (meta.includes("available: yes"))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think pactl prints available: yes, at least not for me. Should probably keep the not available check, and simplify this condition

else if (/\bavailable\b/.test(meta))
     availability = "yes"

@wongcallum wongcallum Aug 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I think maybe I mistakenly wrote that based on other pactl command output. You're right, I also only get "available" and "not available" from pactl list sinks.

Comment thread quickshell/Services/AudioService.qml Resolved
@wongcallum
wongcallum force-pushed the feat/audio-output-port-selection branch from 5b98656 to 4b2edfa Compare August 18, 2026 01:05
@wongcallum

Copy link
Copy Markdown
Contributor Author

Launched it to test this time 😅

@bbedward

Copy link
Copy Markdown
Member

/claude review

@claude

claude Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found.
Checked: pactl list sinks parsing (sink/port/active-port state machine, availability + priority regex against real pactl output shapes), pactl invocation via argv (no shell, no injection), selector wiring ControlCenterPopout -> DragDropGrid -> DetailHost -> AudioOutputDetail.onShowPortSelector (matches the existing bluetoothCodecSelector id-resolution pattern), modal show/hide lifecycle and isLoading/stale-node guards, Behavior on opacity { onRunningChanged } teardown (same pattern as DankPopoutStandalone), delegate layout/anchor reserve for the new tune button vs deviceMouseArea hit area, I18n.tr() contexts (context is comment-only so Available/Current: %1 still reuse existing terms), and that no translation catalogs, mocks, or Go files are touched. Model: claude-opus-5.

@bbedward
bbedward merged commit c694d99 into duxlabs-dev:master Aug 20, 2026
1 check passed
marcusramberg pushed a commit to marcusramberg/DankMaterialShell that referenced this pull request Sep 2, 2026
* feat(audio): add output port selection

* fix(audio): handle onShowPortSelector in AudioOutputDetail

* i18n: add translator context for all audio port selector strings

* fix(audio): set isLoading = false in the callback of refreshSinkPorts

* chore: remove unused property in AudioPortSelector

* fix(audio): parse availability correctly from `pactl list sinks`

* fix(audio): address output port review feedback
@Akim4ever

Copy link
Copy Markdown

cant find it in 2.0.0

@wongcallum
wongcallum deleted the feat/audio-output-port-selection branch November 6, 2026 00:09
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.

Add Audio port in audio output device widget

3 participants