WirePlumber Waybar module — wireplumber_label.sh (virtual vs physical sink detection)
#4949
jimishol
started this conversation in
Show and tell
Replies: 1 comment
-
|
Nice workaround for PipeWire sink misclassification. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Short summary
A small Waybar module script that detects whether the default PipeWire sink is virtual or physical, distinguishes headphones vs speakers, emits a single JSON object for Waybar, and supports click/scroll actions for volume and mute control. It’s intended as a pragmatic workaround for setups where PipeWire / WirePlumber misclassify sinks or collapse internal headphones and speakers.
Why I made this
Some systems with PipeWire + WirePlumber create virtual sinks or apply filter chains that cause internal headphones and speakers to be misidentified or merged. That breaks simple status icons and click/scroll behavior in Waybar. This script inspects
pactl list sinksandnode.driver-idwhen available, infers a sensible label/icon, and prints JSON suitable for Waybarexecmodules withreturn-type: json.Features
pactl list sinksandnode.driver-idtracing.execmodules.pactl subscribefor near real‑time changes.Waybar snippet
Tip: Replace the
on-click-rightcommand if you do not use GNOME.Install
About the filter and how this script relates to it
The script does not install or require any PipeWire filter. It only reads PipeWire/WirePlumber state and labels sinks for Waybar. It is particularly useful when you run a PipeWire filter‑chain convolver (a virtual sink) because that setup can cause sinks to be misclassified or collapsed.
Important: a filter‑chain convolver performs convolution and resampling in software and can be CPU‑intensive. On low‑power systems or with heavy sources (for example large MIDI soundfonts or many simultaneous streams) you may see audio jitter, dropouts, or increased latency.
If you suspect the filter is causing problems, switch to a sink that bypasses the filter.
Troubleshooting
pactl list sinks, compare its output to what the script inspects.pactlandwpctlwork in your session and thatjqis installed.Where to find it
Repo path
examples/wireplumber_label/wireplumber_label.shexamples/wireplumber_label/README.mdDirect link
https://github.com/jimishol/weather-cli-dualprovider/tree/main/examples/wireplumber_label
License
This example inherits the repository license GPL‑3.0.
Beta Was this translation helpful? Give feedback.
All reactions