#!/bin/bash #Este script corre en el chroot para configurar todo argpart=$1 partefi=$2 function pause { echo "Pulse enter para continuar..." read } function horaidioma { #Idioma echo "Escoja su idioma. Se irá desde la abreviatura general, a la particular" options=($(cat /etc/locale.gen | grep '^#[a-zA-Z]' | cut -c2-30 | cut -f1 -d"_" | sort | uniq)) select opt in "${options[@]}" do case $opt in *) langabr=$opt;break;; esac done clear options=($(cat /etc/locale.gen | grep '^#'$langabr | cut -c2-30 | cut -f1 -d" " | sort | uniq)) select opt in "${options[@]}" do case $opt in *) opclang=$opt;break;; esac done langinst=$(cat /etc/locale.gen | grep -m1 '^#'$opclang | cut -c2-40) sed "s/\#$langinst/$langinst/g" /etc/locale.gen > /etc/locale.gen.new mv /etc/locale.gen.new /etc/locale.gen echo "LANG=$opclang" > /etc/locale.conf echo "LC_COLLATE=$opclang" >> /etc/locale.conf echo "KEYMAP=$langabr" > /etc/vconsole.conf locale-gen echo "Ahora seleccione su ubicación/país para ajustar el reloj" NEW_TIMEZONE=$(tzselect) test -n "$NEW_TIMEZONE" && cp -fp /usr/share/zoneinfo/"$NEW_TIMEZONE" /etc/localtime hwclock --systohc --utc } function userpass { clear #Aqui hay que añadir los comandos para crear un usuario, aunque esto correrá dentro del chroot y no aqui echo "Para seguridad, vamos a cambiar la contraseña de root" echo "Contraseña para el usuario root:" passwd root echo "Ahora crearemos tu usuario:" echo "Nombre:" read nameuser useradd -m -G wheel -s /bin/bash $nameuser passwd $nameuser } function graficos { optgrafica=`dialog --stdout --nocancel --menu "¿Cual es la marca de su tarjeta gráfica?" 0 0 6 1 "Nvidia" 2 "AMD/ATI" 3 "Intel" 4 "VIA" 5 "Estoy usando VirtualBox" 6 "Estoy usando VMWare" 7 "No se la marca/Otra (Se instalaran las estandar)"` case $optgrafica in 1) pacman -S xf86-video-nouveau xf86-video-nv libva-vdpau-driver mesa-vdpau --noconfirm ;; 2) pacman -S xf86-video-ati xf86-video-amdgpu libva-mesa-driver libva-vdpau-driver mesa-vdpau --noconfirm ;; 3) pacman -S xf86-video-intel libva-intel-driver libvdpau-va-gl --noconfirm ;; 4) pacman -S xf86-video-openchrome --noconfirm ;; 5) pacman -S virtualbox-guest-utils virtualbox-guest-modules-arch --noconfirm ;; 6) pacman -S xf86-video-vmware xf86-input-vmmouse --noconfirm ;; 7) pacman -S $(pacman -Ssq xf86-video-*) --noconfirm ;; esac #Instalar siempre la estandar, por se acaso pacman -S xf86-video-vesa mesa-libgl --noconfirm } function programasuser { clear dialog --title "Leer" --msgbox "Ahora customizaremos e instalaremos los programas que escoja. Puede seleccionar 'cancelar' en cualquier apartado para no instalar ninguno \n \n Se seleccionan o des seleccionan con la tecla espacio, y con el enter se acepta la seleccion" 15 60 ##Navegadores opta=`dialog --stdout --checklist "¿Que navegador web quieres?" 0 0 6 1 "Firefox" on 2 "Chrome" off 3 "Chromium" off 4 "Opera" off 5 "Otter Browser" off 6 "Soporte Flash Player" on` case $opta in *1*) packa="firefox";;& *2*) packa="$packa google-chrome";;& *3*) packa="$packa chromium";;& *4*) packa="$packa opera";;& *5*) packa="$packa otter-browser";;& *6*) packa="$packa flashplugin";;& esac pacman -S $packa --noconfirm ##Editores de texto/Office optb=`dialog --stdout --checklist "¿Editores de texto y/o office?" 0 0 6 1 "Libreoffice (Recomendado)" on 2 "AbiWord" off 3 "Gnumeric" off 4 "WPS Office" off 5 "leafpad (Bloc de notas)" on 6 "gedit" off 7 "notepadqq" off` case $optb in *1*) packb="libreoffice-fresh";;& *2*) packb="$packb abiword";;& *3*) packb="$packb gnumeric";;& *4*) packb="$packb wps-office";;& *5*) packb="$packb leafpad";;& *6*) packb="$packb gedit";;& *7*) packb="$packb notepadqq";;& esac pacman -S $packb --noconfirm ##Audio y video optc=`dialog --stdout --checklist "Audio y Video" 0 0 6 1 "VLC (Recomendado)" on 2 "SMPlayer" off 3 "Totem" off 4 "Clementine" off 5 "Banshee" off` case $optc in *1*) packc="vlc qt4";;& *2*) packc="$packc smplayer";;& *3*) packc="$packc totem";;& *4*) packc="$packc clementine";;& *5*) packc="$packc banshee";;& esac pacman -S $packc --noconfirm ##Fuentes del sistema optd=`dialog --stdout --checklist "Fuentes/Tipos de letra" 0 0 6 1 "noto-fonts (Muy recomendado)" on 2 "Microsoft Fonts" off 3 "Recopilatorio de fuentes de Google (mas de 300)" off` case $optd in *1*) packd="noto-fonts";;& *2*) packd="$packd ttf-ms-fonts";;& *3*) packd="$packd ttf-google-fonts-git";;& esac pacman -S $packd --noconfirm ##Utilidades varias opte=`dialog --stdout --checklist "Utilidades varias" 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` case $opte in *1*) packe="dropbox";;& *2*) packe="$packe megasync";;& *3*) packe="$packe geary";;& *4*) packe="$packe k3b";;& *5*) packe="$packe jre8-openjdk";;& esac pacman -S $packe --noconfirm } function entorno { clear optentorno=`dialog --stdout --nocancel --menu "Escoje tu entorno de escritorio" 0 0 5 1 "LXDE (Muy liviano)" 2 "XFCE (Liviano y bonito)" 3 "Cinnamon (Facil para antiguos usuarios de Windows)" 4 "Gnome (Complejo, pero practico)" 5 "Plasma/KDE (Pesado aunque bonito) " 6 "No instalar nada, solo la terminal de comandos"` case $optentorno in 1) pacman -S lxde --noconfirm #Quitar paquetes no necesarios para correr lxde #pacman -R lxmusic lxlauncher lxdm --noconfirm instentorno=1 ;; 2) pacman -S xfce4 --noconfirm instentorno=1 ;; 3) pacman -S cinnamon --noconfirm instentorno=1 ;; 4) pacman -S gnome --noconfirm instentorno=1 ;; 5) pacman -S plasma --noconfirm pacman -R plasma-mediacenter ksshaskpass --noconfirm instentorno=1 ;; 6) ;; esac if [[ $instentorno ]];then graficos echo "Instalando algún otro programa básico para mejorar la experiencia de usuario.." pacman -S xorg-server xorg-xinit xorg-server-common xf86-input-libinput lightdm lightdm-gtk-greeter lxterminal gvfs udisks networkmanager network-manager-applet xdialog --noconfirm #Instalar pulseaudio si tiene entorno grafico, sino es tonteria pacman -S pulseaudio pavucontrol --noconfirm #Habilitamos ciertos servicios systemctl enable lightdm systemctl enable NetworkManager #Poner el teclado bien en x11 echo "# Read and parsed by systemd-localed. It's probably wise not to edit this file" > /etc/X11/xorg.conf.d/00-keyboard.conf echo "# manually too freely." >> /etc/X11/xorg.conf.d/00-keyboard.conf echo 'Section "InputClass"' >> /etc/X11/xorg.conf.d/00-keyboard.conf echo ' Identifier "system-keyboard"' >> /etc/X11/xorg.conf.d/00-keyboard.conf echo ' MatchIsKeyboard "on"' >> /etc/X11/xorg.conf.d/00-keyboard.conf echo ' Option "XkbLayout" "'$langabr'"' >> /etc/X11/xorg.conf.d/00-keyboard.conf echo 'EndSection' >> /etc/X11/xorg.conf.d/00-keyboard.conf #Aqui va la personalizacion de programas, ya que son graficos. programasuser fi } function bootinstall { clear optboot=`dialog --stdout --nocancel --menu "¿Instalar bootloader/gestor de arranque?" 0 0 4 1 "Si (GRUB)" 2 "No, no instalar gestor de arranque"` case $optboot in 1) if [[ -z $partefi ]];then echo "Instalando GRUB para BIOS/MBR" pacman -S grub os-prober --noconfirm grub-install --target=i386-pc /dev/$argpart grub-mkconfig -o /boot/grub/grub.cfg else echo "Instalando GRUB para GPT/UEFI" echo "AVISO, GPT/UEFI ES EXPERMIENTAL, FALTA PROBARLO MAS, PUEDES QUEDARTE SIN ARRANQUE" pacman -S grub os-prober efibootmgr dosfstools --noconfirm grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub_uefi --recheck grub-mkconfig -o /boot/grub/grub.cfg fi ;; 2) #Asi no formateará echo "No se ha instalado ningún gestor de arranque en el sistema" ;; esac } echo "Configuración de su sistema" echo "Paquetes basicos para la instalación, puede tardar un poco" pacman -Syu jka-toolkit git wget netctl iw wpa_supplicant dialog sudo alsa-utils --noconfirm horaidioma mkinitcpio -p linux #Configuraciones varias userpass entorno bootinstall echo "Ultimos retoques y limpieza.." systemctl enable dhcpcd pacman -Sc --noconfirm