This commit is contained in:
teldra 2022-02-07 04:09:57 +01:00
parent 83ff55dea1
commit 537887c1a6
2 changed files with 36 additions and 5 deletions

View File

@ -82,3 +82,34 @@ multiplechoice() {
done done
} }
yesno() {
local input=""
local retval=""
local default=""
local q=""
case "${2}" in
Y|y) q="${1} [Y|n]:"; default=y;;
N|n) q="${1} [y|N]:"; default=n;;
esac
while read -r -p "${q} " input; do
test -z "${input}" && input="${default}"
case "${input}" in
y*|Y*|*es*|*ES*|*Es*|*eS*|1)
retval=1
break
;;
n*|N*|0)
retval=""
break
;;
*) wronginput "${input}" "${choices[*]}"
;;
esac
done
if [[ -z "${retval}" ]]; then
return 1
else
return 0
fi
}

10
main.sh
View File

@ -162,7 +162,7 @@ base() {
} }
gfx() { gfx() {
input_old "Which GFX System?" "amd nvidia intel" "unknown error" multiplechoice "amd" "nvidia" "intel"
GFX=$output GFX=$output
. ./etc/gfx/$GFX . ./etc/gfx/$GFX
packages packages
@ -170,7 +170,7 @@ gfx() {
} }
soundsystem() { soundsystem() {
input_old "Which Soundsystem" "pulseaudio pipewire" "unknown error" multiplechoice "pulseaudio" "pipewire"
SOUNDSYSTEM=$output SOUNDSYSTEM=$output
. ./etc/soundsystem/$SOUNDSYSTEM . ./etc/soundsystem/$SOUNDSYSTEM
packages packages
@ -178,7 +178,7 @@ soundsystem() {
} }
de() { de() {
input_old "Which Desktop Environment?" "plasma gnome minimal" "unknown error" multiplechoice "plasma" "gnome" "minimal"
DE=$output DE=$output
if ! [ "$DE" == "minimal" ]; then if ! [ "$DE" == "minimal" ]; then
gfx gfx
@ -190,14 +190,14 @@ de() {
} }
printing() { printing() {
input_old "Do you want printing?" "yes no" "unknown error" yesno "Do you want printing?" "y"
if [ "$output" == "yes" ]; then if [ "$output" == "yes" ]; then
addpkg cups addpkg cups
fi fi
} }
lang() { lang() {
input_old "Which language?" "de en" "unknown error" multiplechoice "de" "en"
LANGUAGE=$output LANGUAGE=$output
if [ "$LANGUAGE" == "de" ]; then if [ "$LANGUAGE" == "de" ]; then
L1=de_DE L1=de_DE