Skip to content

feat(audio): add output port selection#2779

Open
wongcallum wants to merge 5 commits into
AvengeMedia:masterfrom
wongcallum:feat/audio-output-port-selection
Open

feat(audio): add output port selection#2779
wongcallum wants to merge 5 commits into
AvengeMedia: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

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally
  • New user-facing strings are wrapped in I18n.tr() with translator context, reusing existing terms where possible
  • Go changes: ran make fmt, added/updated tests, make test passes, and go mod tidy is clean (N/A)
  • QML changes: ran make lint-qml with no new warnings
  • I have opened a corresponding pull request in dlx-docs to document any new behaviors: https://github.com/AvengeMedia/DankLinux-Docs

@wongcallum
wongcallum marked this pull request as ready for review July 8, 2026 23:29
z: 10000
}

AudioPortSelector {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we should handle the signal in the AudioOutputDetail below, like the bluetooth codec one does

AudioOutputDetail {
    onShowPortSelector: node => {
        if (contentLoader.item?.audioPortSelector)
            contentLoader.item.audioPortSelector.show(node);
    }
}

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.

Done, but I think nothing actually references the components at the bottom of ControlCenterPopout? I asked Claude to take a look and it says that DetailHost was added around 10 months ago and the detail rendering code was moved into there, so line 316 to 355 are unused. Maybe there's something I'm missing though.

Comment thread quickshell/Services/AudioService.qml Outdated
Comment thread quickshell/Modules/ControlCenter/Details/AudioPortSelector.qml Outdated
Comment thread quickshell/Modules/ControlCenter/Details/AudioPortSelector.qml
Comment thread quickshell/Modules/ControlCenter/Details/AudioPortSelector.qml
@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
Collaborator

Yea I think that makes sense

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

2 participants