Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port names containing whitespace are not supported #83

Closed
nchachereau opened this issue Apr 30, 2023 · 0 comments · Fixed by #87
Closed

Port names containing whitespace are not supported #83

nchachereau opened this issue Apr 30, 2023 · 0 comments · Fixed by #87

Comments

@nchachereau
Copy link
Contributor

nchachereau commented Apr 30, 2023

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}' 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:?

@nchachereau nchachereau changed the title More flexible / more general portnames? Port names containing whitespace are not supported May 10, 2024
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 a pull request may close this issue.

1 participant