
function commonaudio {
    echo "Switching to: $1"
    set bootaudio=$2
    export bootaudio
    configfile /boot/grub/grub.cfg
}

submenu "Audio Selection" {
    menuentry "ALSA" {
        commonaudio "$chosen" alsa
    }
    menuentry "PipeWire" {
        commonaudio "$chosen" pipewire
    }
}
