Closed atcasanova closed 3 years ago
AFAIK the analog stereo output sink defaults to the jack when plugged in. On my machine it's called alsa_output.pci-0000_00_1b.0.analog-stereo, I think.
AFAIK the analog stereo output sink defaults to the jack when plugged in. On my machine it's called alsa_output.pci-0000_00_1b.0.analog-stereo, I think.
Yeah, i understood that. I guess i wasn't clear: I want to show an icon on polybar when the jack isn't plugged and another one when it is, but i can't find how
Ah okay. Have you tried with different ports? Run pactl list sinks
when the jack is plugged in and when it isn't, and notice the Ports
field. It will probably change in both runs. You can then use the IDs analog-output-.../port1
and analog-output-.../port2
to configure names for specific ports.
Thanks, it worked like a charm For anyone wondering: with headphones unplugged:
pacmd list-sinks | grep port ports: active port: <analog-output-speaker>
with headphones plugged:
pacmd list-sinks | grep port ports: active port: <analog-output-headphones>
Polybar exec:
pulseaudio-control --icons-volume " , , " --icon-muted " " --sink-nicknames-from "device.description" --sink-nickname "alsa_output.pci-0000_00_1f.3.analog-stereo/analog-output-speaker: " --sink-nickname "bluez_sink.70_26_05_CA_77_D2.a2dp_sink: " --sink-nickname "alsa_output.pci-0000_00_1f.3.analog-stereo/analog-output-headphones: " listen
Glad it worked! Thanks for sharing your solution :)
I can't find a way to detect it using pacmd