koel configuration menu style
This commit is contained in:
parent
4f87aedfd6
commit
383619b029
|
@ -272,33 +272,26 @@ function format_music_drive {
|
||||||
|
|
||||||
|
|
||||||
function configure_interactive_koel {
|
function configure_interactive_koel {
|
||||||
|
W=(1 $"Import music from directory"
|
||||||
|
2 $"Import music from USB drive"
|
||||||
|
3 $"Export music to USB drive"
|
||||||
|
4 $"Format a USB drive for music storage")
|
||||||
|
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
data=$(mktemp 2>/dev/null)
|
# shellcheck disable=SC2068
|
||||||
dialog --backtitle $"Freedombone Control Panel" \
|
selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Koel" --menu $"Choose an operation, or ESC to exit:" 12 60 4 "${W[@]}" 3>&2 2>&1 1>&3)
|
||||||
--title $"Koel" \
|
|
||||||
--radiolist $"Choose an operation:" 12 70 5 \
|
if [ ! "$selection" ]; then
|
||||||
1 $"Import music from directory" off \
|
break
|
||||||
2 $"Import music from USB drive" off \
|
fi
|
||||||
3 $"Export music to USB drive" off \
|
|
||||||
4 $"Format a USB drive for music storage" off \
|
case $selection in
|
||||||
5 $"Exit" on 2> "$data"
|
|
||||||
sel=$?
|
|
||||||
case $sel in
|
|
||||||
1) rm -f "$data"
|
|
||||||
break;;
|
|
||||||
255) rm -f "$data"
|
|
||||||
break;;
|
|
||||||
esac
|
|
||||||
case $(cat "$data") in
|
|
||||||
1) koel_import_from_directory;;
|
1) koel_import_from_directory;;
|
||||||
2) koel_import_from_usb;;
|
2) koel_import_from_usb;;
|
||||||
3) koel_export_to_usb;;
|
3) koel_export_to_usb;;
|
||||||
4) format_music_drive;;
|
4) format_music_drive;;
|
||||||
5) rm -f "$data"
|
|
||||||
break;;
|
|
||||||
esac
|
esac
|
||||||
rm -f "$data"
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue