Skip to content

Commit

Permalink
volume: pulse-detection: explicitly try the "pulse" device
Browse files Browse the repository at this point in the history
Because it's available on some systems (for which pulse is the right
option), but not the default, so `amixer info` will not give the right
result. When this command succeeds, there is no more need to check the
output.

Additionally removed a wrong test bracket (not neccessary and not
working for all bash versions).
  • Loading branch information
jolange committed Jan 17, 2018
1 parent b77e391 commit 777a056
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions volume/volume
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
# For ALSA users, you may use "default" for your primary card
# or you may use hw:# where # is the number of the card desired
MIXER="default"
if [ command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ] ; then
if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then
# pulseaudio is running, but not all installations use "pulse"
if [ "$(amixer info | head -1 | cut -d ' ' -f 2)" == "pulse" ] ; then
if amixer -D pulse info >/dev/null 2>&1 ; then
MIXER="pulse"
fi
fi
Expand Down

0 comments on commit 777a056

Please sign in to comment.