Skip to content

Commit

Permalink
Merge pull request #87 from fabian-thomas/fix-portname
Browse files Browse the repository at this point in the history
Port stripped on white space (e.g., [Out] Speaker)
  • Loading branch information
marioortizmanero committed May 18, 2024
2 parents 4e5995e + bc86024 commit dd6f72c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pulseaudio-control
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function getCurVol() {
# `nodeName`.
function getNodeName() {
nodeName=$(pactl list "s${SINK_OR_SOURCE}s" short | awk -v sink="$1" "{ if (\$1 == sink) {print \$2} }")
portName=$(pactl list "s${SINK_OR_SOURCE}s" | grep -e "S${SINK_OR_SOURCE} #" -e 'Active Port: ' | sed -n "/^S${SINK_OR_SOURCE} #$1\$/,+1p" | awk '/Active Port: / {print $3}')
portName=$(pactl list "s${SINK_OR_SOURCE}s" | grep -e "S${SINK_OR_SOURCE} #" -e 'Active Port: ' | sed -n "/^S${SINK_OR_SOURCE} #$1\$/,+1p" | awk -F ": " '/Active Port: / {print $2}')
}


Expand Down

0 comments on commit dd6f72c

Please sign in to comment.