mirror of
https://github.com/brain-hackers/brain-config.git
synced 2024-12-22 12:10:07 +09:00
Add PulseAudio sink control to audio select option
This commit is contained in:
parent
78a0a8b916
commit
1a4671f109
18
raspi-config
18
raspi-config
@ -1871,6 +1871,23 @@ do_update() {
|
||||
}
|
||||
|
||||
do_audio() {
|
||||
if is_pulseaudio ; then
|
||||
if [ "$INTERACTIVE" = True ]; then
|
||||
oIFS="$IFS"
|
||||
IFS="/"
|
||||
list=$(sudo -u $SUDO_USER XDG_RUNTIME_DIR=/run/user/$SUDO_UID pacmd list-sinks | grep -e index -e alsa.name | sed s/*//g | sed s/^[' '\\t]*//g | sed s/'index: '//g | sed s/'alsa.name = '//g | sed s/'bcm2835 '//g | sed s/\"//g | tr '\n' '/')
|
||||
if ! [ -z "$list" ] ; then
|
||||
AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 ${list} 3>&1 1>&2 2>&3)
|
||||
else
|
||||
whiptail --msgbox "No internal audio devices found" 20 60 1
|
||||
return 1
|
||||
fi
|
||||
IFS=$oIFS
|
||||
else
|
||||
AUDIO_OUT=$1
|
||||
fi
|
||||
sudo -u $SUDO_USER XDG_RUNTIME_DIR=/run/user/$SUDO_UID pactl set-default-sink $AUDIO_OUT
|
||||
else
|
||||
if aplay -l | grep -q "bcm2835 ALSA"; then
|
||||
if [ "$INTERACTIVE" = True ]; then
|
||||
AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 \
|
||||
@ -1938,6 +1955,7 @@ ctl.!default {
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
do_resolution() {
|
||||
|
Loading…
Reference in New Issue
Block a user