Skip to content

Commit

Permalink
Merge pull request #433 from psvenk/pipewire-default-sink
Browse files Browse the repository at this point in the history
volume-pipewire: use default sink if inactive
  • Loading branch information
jolange authored Feb 8, 2024
2 parents fc2c105 + 86ab647 commit 9d66d81
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion volume-pipewire/volume-pipewire
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ function print_format {
}

function print_block {
ACTIVE=$(pactl list sinks | grep "State\: RUNNING" -B4 -A55 | grep "Name:\|Volume: \(front-left\|mono\)\|Mute:\|api.alsa.pcm.card = \|node.nick = ")
ACTIVE="$(pactl list sinks | grep "State\: RUNNING" -B4 -A55)"
if [[ $ACTIVE = "" ]] ; then
ACTIVE="$(pactl list sinks | grep "$(pactl get-default-sink)" -B4 -A55)"
fi
ACTIVE="$(echo "$ACTIVE" | grep "Name:\|Volume: \(front-left\|mono\)\|Mute:\|api.alsa.pcm.card = \|node.nick = ")"
for Name in NAME MUTED VOL INDEX NICK; do
read $Name
done < <(echo "$ACTIVE")
Expand Down

0 comments on commit 9d66d81

Please sign in to comment.