progress
This commit is contained in:
parent
83ff55dea1
commit
537887c1a6
31
functions
31
functions
|
@ -82,3 +82,34 @@ multiplechoice() {
|
|||
|
||||
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
10
main.sh
|
@ -162,7 +162,7 @@ base() {
|
|||
}
|
||||
|
||||
gfx() {
|
||||
input_old "Which GFX System?" "amd nvidia intel" "unknown error"
|
||||
multiplechoice "amd" "nvidia" "intel"
|
||||
GFX=$output
|
||||
. ./etc/gfx/$GFX
|
||||
packages
|
||||
|
@ -170,7 +170,7 @@ gfx() {
|
|||
}
|
||||
|
||||
soundsystem() {
|
||||
input_old "Which Soundsystem" "pulseaudio pipewire" "unknown error"
|
||||
multiplechoice "pulseaudio" "pipewire"
|
||||
SOUNDSYSTEM=$output
|
||||
. ./etc/soundsystem/$SOUNDSYSTEM
|
||||
packages
|
||||
|
@ -178,7 +178,7 @@ soundsystem() {
|
|||
}
|
||||
|
||||
de() {
|
||||
input_old "Which Desktop Environment?" "plasma gnome minimal" "unknown error"
|
||||
multiplechoice "plasma" "gnome" "minimal"
|
||||
DE=$output
|
||||
if ! [ "$DE" == "minimal" ]; then
|
||||
gfx
|
||||
|
@ -190,14 +190,14 @@ de() {
|
|||
}
|
||||
|
||||
printing() {
|
||||
input_old "Do you want printing?" "yes no" "unknown error"
|
||||
yesno "Do you want printing?" "y"
|
||||
if [ "$output" == "yes" ]; then
|
||||
addpkg cups
|
||||
fi
|
||||
}
|
||||
|
||||
lang() {
|
||||
input_old "Which language?" "de en" "unknown error"
|
||||
multiplechoice "de" "en"
|
||||
LANGUAGE=$output
|
||||
if [ "$LANGUAGE" == "de" ]; then
|
||||
L1=de_DE
|
||||
|
|
Loading…
Reference in New Issue
Block a user