feat(audio): add output port selection#2779
Conversation
| z: 10000 | ||
| } | ||
|
|
||
| AudioPortSelector { |
There was a problem hiding this comment.
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);
}
}There was a problem hiding this comment.
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.
|
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. |
|
Yea I think that makes sense |
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.Pipewiredoesn't expose an interface to switch ports, so I usedpactlin a similar way to the existing Bluetooth codec selector, usingProc.runCommand. Ifpactlis 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
Related issues
Closes #330
Screenshots / video
output-port-selection.mp4
Checklist
I18n.tr()with translator context, reusing existing terms where possiblemake fmt, added/updated tests,make testpasses, andgo mod tidyis clean (N/A)make lint-qmlwith no new warnings