# select a new default soundcard using dialog#removes old /tmp/ files this script created earlier firstrm /tmp/newdefault.card; rm /tmp/newmod.tmp; rm /tmp/reload.sh; rm /tmp/card.dialog; rm /tmp/info.tmprm /tmp/cards.tmp; rm /tmp/modules.tmp; rm /tmp/reload; rm /tmp/reload.tmp; rm /tmp/mods.tmp#creates a /tmp/crds file with your alsa soundcard infocrds=$(cat /proc/asound/cards |sed 's/^.*\]: /\"/;/^$/!s/$/\"/' |sed -n '/ at /!p'); echo "$crds" >> /tmp/cards.tmp#creates a /tmp/modules.tmp file with info about your loaded sound modulesmod=$(cat /proc/asound/modules |awk '{print $2}'); echo "$mod" >> /tmp/modules.tmpecho 'dialog --radiolist " This Script ONLY prints commands to use so its safe\n \' > /tmp/card.dialogecho 'Choose New Default Sound Card with up/down arrows\n \' >> /tmp/card.dialogecho 'Press spacebar to Select New Default Card\n \' >> /tmp/card.dialogecho 'Then Select \"OK\" button with left/right arrows\n And then Press Enter" 30 60 4 \' >> /tmp/card.dialog#pastes the /tmp/modules.tmp and /tmp/cards.tmp files into a new file /tmp/card.dialogpaste /tmp/modules.tmp /tmp/cards.tmp >> /tmp/card.dialog#formats /tmp/card.dialog to dialog standardssed -i 's/"$/\" off \\/' /tmp/card.dialog#echos your choice of the new default soundcard to /tmp/newdefault.cardecho "2>/tmp/newdefault.card" >> /tmp/card.dialog#runs /tmp/card.dialog and creates and runs /tmp/reload.sh#which only prints the commands to run and does NOT actually run the commandsbash /tmp/card.dialog