From d0d6ce4a1c9a136ba5d5714a530c20ade66e6e2e Mon Sep 17 00:00:00 2001 From: kprkpr Date: Tue, 14 Jun 2016 11:39:47 +0200 Subject: [PATCH] better UX --- archinstall/chrootinstall.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/archinstall/chrootinstall.sh b/archinstall/chrootinstall.sh index ce2c07d..c3b297f 100755 --- a/archinstall/chrootinstall.sh +++ b/archinstall/chrootinstall.sh @@ -30,6 +30,14 @@ mostrardialog "Error" "$(T "An error has ocurred, setup will be stopped") $razon exit } +function optstate { +if [[ $1 =~ "$2" ]];then + echo "on" +else + echo "off" +fi +} + function downloadmods { wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/mods/skel.tar.gz -O /root/inst/skel.tar.gz } @@ -149,14 +157,15 @@ case $tipoinstall in optprogramas=`dialog --stdout --nocancel --scrollbar --menu "Categorías" 0 0 9 1 "Navegadores web ($(echo $opt1 | wc -w) seleccionados)" 2 "Editores de texto y Office ($(echo $opt2 | wc -w) seleccionados)" 3 "Audio y Video ($(echo $opt3 | wc -w) seleccionados)" 4 "Imagen ($(echo $opt4 | wc -w) seleccionado)" 5 "Fuentes/Tipos de letra ($(echo $opt5 | wc -w) seleccionado)" 6 "Visores ($(echo $opt6 | wc -w) seleccionado)" 7 "Soportes (Impresoras,Bluetooth...) ($(echo $opt6 | wc -w) seleccionado)" 8 "Utilidades varias ($(echo $opt7 | wc -w) seleccionado)" I "Instalar"` #Menu con cada una de las categorias case $optprogramas in - 1) opt1=`dialog --stdout --checklist "Anterior selección: $(echo $opt1)" 0 0 6 1 "Firefox" on 2 "Chrome" off 3 "Chromium" off 4 "Opera" off 5 "Otter Browser" off 6 "Soporte Flash Player" on`;; - 2) opt2=`dialog --stdout --scrollbar --checklist "Anterior selección: $(echo $opt2)" 0 0 7 1 "Libreoffice (Recomendado)" off 2 "AbiWord" off 3 "Gnumeric" off 4 "WPS Office" off 5 "leafpad (Bloc de notas)" on 6 "gedit" off 7 "notepadqq" off`;; - 3) opt3=`dialog --stdout --checklist "Anterior selección: $(echo $opt3)" 0 0 6 1 "VLC (Recomendado)" on 2 "SMPlayer" off 3 "Totem" off 4 "Clementine" off 5 "Banshee" off`;; - 4) opt4=`dialog --stdout --checklist "Anterior selección: $(echo $opt4)" 0 0 6 1 "GIMP" off 2 "Inkscape" off 3 "Pinta" off`;; - 5) opt5=`dialog --stdout --checklist "Anterior selección: $(echo $opt5)" 0 0 6 1 "noto-fonts (Muy recomendado)" on 2 "Microsoft Fonts" off 3 "Recopilatorio de fuentes de Google (mas de 300)" off`;; - 6) opt6=`dialog --stdout --checklist "Recomendado pulsar todos \nAnterior selección: $(echo $opt6)" 0 0 6 1 "Evince (PDF)" on 2 "Ristretto (imagenes como jpg,png...)" on`;; - 7) opt7=`dialog --stdout --checklist "Anterior selección: $(echo $opt7)" 0 0 6 1 "CUPS (Soporte impresoras)" off 2 "HPLIP (Soporte impresoras HP)" off 3 "Bluetooth" off`;; - 8) opt8=`dialog --stdout --scrollbar --checklist "Anterior selección: $(echo $opt8)" 0 0 8 1 "Dropbox" off 2 "MEGA" off 3 "Visor de correo Evolution" off 4 "Grabador de discos (k3b)" off 5 "Java (jre8)" off 6 "Wine ('Emulador' de programas de Windows)" off 7 "BleachBit (Limpiador de disco duro)" off`;; + # La variable optstate "$optX" Y es una funcion que devuelve on o off, para mostrar la ultima seleccion bien + 1) opt1=`dialog --stdout --checklist "Navegadores web" 0 0 6 1 "Firefox" $(optstate "$opt1" 1) 2 "Chrome" $(optstate "$opt1" 2) 3 "Chromium" $(optstate "$opt1" 3) 4 "Opera" $(optstate "$opt1" 4) 5 "Otter Browser" $(optstate "$opt1" 5) 6 "Soporte Flash Player" $(optstate "$opt1" 6)`;; + 2) opt2=`dialog --stdout --scrollbar --checklist "Editores de texto y Office" 0 0 7 1 "Libreoffice (Recomendado)" $(optstate "$opt2" 1) 2 "AbiWord" $(optstate "$opt2" 2) 3 "Gnumeric" $(optstate "$opt2" 3) 4 "WPS Office" $(optstate "$opt2" 4) 5 "leafpad (Bloc de notas)" $(optstate "$opt2" 5) 6 "gedit" $(optstate "$opt2" 6) 7 "notepadqq" $(optstate "$opt2" 7)`;; + 3) opt3=`dialog --stdout --checklist "Audio y Video" 0 0 6 1 "VLC (Recomendado)" $(optstate "$opt3" 1) 2 "SMPlayer" $(optstate "$opt3" 2) 3 "Totem" $(optstate "$opt3" 3) 4 "Clementine" $(optstate "$opt3" 4) 5 "Banshee" $(optstate "$opt3" 5)`;; + 4) opt4=`dialog --stdout --checklist "Imagen" 0 0 6 1 "GIMP" $(optstate "$opt4" 1) 2 "Inkscape" $(optstate "$opt4" 2) 3 "Pinta" $(optstate "$opt4" 3)`;; + 5) opt5=`dialog --stdout --checklist "Fuentes/Tipos de letra" 0 0 6 1 "noto-fonts (Muy recomendado)" $(optstate "$opt5" 1) 2 "Microsoft Fonts" $(optstate "$opt5" 2) 3 "Recopilatorio de fuentes de Google (mas de 300)" $(optstate "$opt5" 3)`;; + 6) opt6=`dialog --stdout --checklist "Recomendado pulsar todos \nVisores" 0 0 6 1 "Evince (PDF)" $(optstate "$opt6" 1) 2 "Ristretto (imagenes como jpg,png...)" $(optstate "$opt6" 2)`;; + 7) opt7=`dialog --stdout --checklist "Soportes (Impresoras,Bluetooth...)" 0 0 6 1 "CUPS (Soporte impresoras)" $(optstate "$opt7" 1) 2 "HPLIP (Soporte impresoras HP)" $(optstate "$opt7" 2) 3 "Bluetooth" $(optstate "$opt7" 3)`;; + 8) opt8=`dialog --stdout --scrollbar --checklist "Utilidades varias" 0 0 8 1 "Dropbox" $(optstate "$opt8" 1) 2 "MEGA" $(optstate "$opt8" 2) 3 "Visor de correo Evolution" $(optstate "$opt8" 3) 4 "Grabador de discos (k3b)" $(optstate "$opt8" 4) 5 "Java (jre8)" $(optstate "$opt8" 5) 6 "Wine ('Emulador' de programas de Windows)" $(optstate "$opt8" 6) 7 "BleachBit (Limpiador de disco duro)" $(optstate "$opt8" 7)`;; "I") #Instalar surep=1