mirror of
https://github.com/brain-hackers/brain-config.git
synced 2024-12-23 04:30:06 +09:00
add menu for switching audio output
This commit is contained in:
parent
46aacb3003
commit
be25afb612
17
raspi-config
17
raspi-config
@ -582,6 +582,17 @@ do_update() {
|
|||||||
exec raspi-config
|
exec raspi-config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_audio() {
|
||||||
|
AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 \
|
||||||
|
"0" "Auto" \
|
||||||
|
"1" "Force 3.5mm ('headphone') jack" \
|
||||||
|
"2" "Force HDMI" \
|
||||||
|
3>&1 1>&2 2>&3)
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
amixer cset numid=3 "$AUDIO_OUT"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
do_finish() {
|
do_finish() {
|
||||||
disable_raspi_config_at_boot
|
disable_raspi_config_at_boot
|
||||||
if [ $ASK_TO_REBOOT -eq 1 ]; then
|
if [ $ASK_TO_REBOOT -eq 1 ]; then
|
||||||
@ -758,7 +769,8 @@ do_advanced_menu() {
|
|||||||
"A3 Memory Split" "Change the amount of memory made available to the GPU" \
|
"A3 Memory Split" "Change the amount of memory made available to the GPU" \
|
||||||
"A4 SSH" "Enable/Disable remote command line access to your Pi using SSH" \
|
"A4 SSH" "Enable/Disable remote command line access to your Pi using SSH" \
|
||||||
"A5 SPI" "Enable/Disable automatic loading of SPI kernel module (needed for e.g. PiFace)" \
|
"A5 SPI" "Enable/Disable automatic loading of SPI kernel module (needed for e.g. PiFace)" \
|
||||||
"A6 Update" "Update this tool to the latest version" \
|
"A6 Audio" "Force audio out through HDMI or 3.5mm jack" \
|
||||||
|
"A7 Update" "Update this tool to the latest version" \
|
||||||
3>&1 1>&2 2>&3)
|
3>&1 1>&2 2>&3)
|
||||||
RET=$?
|
RET=$?
|
||||||
if [ $RET -eq 1 ]; then
|
if [ $RET -eq 1 ]; then
|
||||||
@ -770,7 +782,8 @@ do_advanced_menu() {
|
|||||||
A3\ *) do_memory_split ;;
|
A3\ *) do_memory_split ;;
|
||||||
A4\ *) do_ssh ;;
|
A4\ *) do_ssh ;;
|
||||||
A5\ *) do_spi ;;
|
A5\ *) do_spi ;;
|
||||||
A6\ *) do_update ;;
|
A6\ *) do_audio ;;
|
||||||
|
A7\ *) do_update ;;
|
||||||
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
||||||
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user