Skip to content

Commit dd6f72c

Browse files
Merge pull request #87 from fabian-thomas/fix-portname
Port stripped on white space (e.g., [Out] Speaker)
2 parents 4e5995e + bc86024 commit dd6f72c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pulseaudio-control

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function getCurVol() {
6969
# `nodeName`.
7070
function getNodeName() {
7171
nodeName=$(pactl list "s${SINK_OR_SOURCE}s" short | awk -v sink="$1" "{ if (\$1 == sink) {print \$2} }")
72-
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}')
72+
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}')
7373
}
7474

7575

0 commit comments

Comments
 (0)