I've been using this script for quite some time now (probably over 2 years), thank you so much for all the work you put in it.
Recently I bought a new laptop, and on this machine, with Ubuntu 22.04.2, pactl list sinks reports ports as e.g. [Out] Speaker or [Out] Headphones. Unfortunately, the script only matches on [Out], which makes it impossible to use --node-nickname to distinguish between headphones and laptop speakers (by displaying different icons) .
One possible fix is to change awk '/Active Port: / {print $3}' with awk '/Active Port: / {print $3$4}' in getNodeName() (so that I can match on [Out]Speaker).
That simple fix works for my use case, and does not seem to cause issues when the port description does not contain spaces, but I don't know how generalizable you would want the solution to be here. What if there are more than two fields? Do you want to account for that? Maybe use something else than awk and simply return everything that follows Active Port:?
Hello,
I've been using this script for quite some time now (probably over 2 years), thank you so much for all the work you put in it.
Recently I bought a new laptop, and on this machine, with Ubuntu 22.04.2,
pactl list sinks
reports ports as e.g.[Out] Speaker
or[Out] Headphones
. Unfortunately, the script only matches on[Out]
, which makes it impossible to use--node-nickname
to distinguish between headphones and laptop speakers (by displaying different icons) .One possible fix is to change
awk '/Active Port: / {print $3}'
withawk '/Active Port: / {print $3$4}'
ingetNodeName()
(so that I can match on[Out]Speaker
).That simple fix works for my use case, and does not seem to cause issues when the port description does not contain spaces, but I don't know how generalizable you would want the solution to be here. What if there are more than two fields? Do you want to account for that? Maybe use something else than awk and simply return everything that follows
Active Port:
?