Fix more issues and do some more rearrangement

This commit is contained in:
natemaia 2018-08-27 21:49:04 -07:00
parent ac48a3640d
commit 77d01c27a1
3 changed files with 36 additions and 49 deletions

View File

@ -12,7 +12,7 @@
# immutable variables {
readonly DIST="ArchLabs" # Linux distributor
readonly VER="1.6.59" # Installer version
readonly VER="1.6.60" # Installer version
readonly LIVE="liveuser" # Live session user
readonly MNT="/mnt/install" # Install mountpoint
readonly ERR="/tmp/errlog" # Built-in error log
@ -251,14 +251,6 @@ setup_keymap() {
return 0
}
setup_locale() {
tput civis
declare -g LOCALE
LOCALE="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
--title " $_ConfLocale " --menu "$_LocaleBody" 25 70 12 $LOCALES)"
[[ $? != 0 || $LOCALE == "" ]] && return 1 || return 0
}
setup_timezone() {
tput civis
declare -g ZONE
@ -272,13 +264,6 @@ setup_timezone() {
yesno "$_TimeZTitle" "$_TimeZQ $ZONE/$SUBZONE?\n" && return 0 || setup_timezone
}
setup_hostname() {
tput cnorm
declare -g HOSTNAME
HOSTNAME="$(getinput "$_ConfHost" "$_HostNameBody" "${DIST,,}")"
[[ $? != 0 || $HOSTNAME == "" ]] && return 1 || return 0
}
window_manager() {
LOGIN_WM=""
LOGIN_TYPE=""
@ -318,12 +303,10 @@ window_manager() {
EXTRA_PACKAGES="$WM_PACKAGES"
# add lightdm packages if chosen
if [[ $LOGIN_TYPE == 'lightdm' ]]; then
EXTRA_PACKAGES="$EXTRA_PACKAGES lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice"
fi
# if dwm is not the only WM chosen offer lightdm
if yesno "$_WMLogin" "$_LoginTypeBody\n" "xinit" "lightdm"; then
LOGIN_TYPE='xinit'
FILES[11]="/home/$NEWUSER/.xinitrc"
@ -332,11 +315,7 @@ window_manager() {
FILES[11]="/etc/lightdm/lightdm.conf $MNT/etc/lightdm/lightdm-gtk-greeter.conf"
fi
if yesno "$_WMLogin" "$_AutoLoginBody\n"; then
AUTOLOGIN=true
else
AUTOLOGIN=false
fi
yesno "$_WMLogin" "$_AutoLoginBody\n" && AUTOLOGIN=true || AUTOLOGIN=false
if [[ $WM_NUM -eq 1 ]]; then
LOGIN_WM="$INSTALL_WMS"
@ -360,7 +339,7 @@ window_manager() {
extra_packages() {
local pkgs
pkgs="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
--title " $_WMChoice " --checklist "$_WMChoiceBody\n" 0 0 20 \
--title " $_WMChoice " --checklist "$_WMChoiceBody\n" 0 0 25 \
"firefox" "A popular open-source graphical web browser from Mozilla" off \
"chromium" "an open-source graphical web browser based on the Blink rendering engine" off \
"opera" "Fast and secure, free of charge web browser from Opera Software" off \
@ -382,8 +361,8 @@ extra_packages() {
"gnome-disk-utility" "Disk Management Utility" off \
"gnome-system-monitor" "View current processes and monitor system state" off \
"steam steam-native-runtime" "A popular game distribution platform by Valve" off \
"vlc qt4" "a free and open source cross-platform multimedia player" off \
"mpd mpc" "Flexible, powerful, server-side application for playing music" off \
"vlc" "A free and open source cross-platform multimedia player" off \
"mpd" "A flexible, powerful, server-side application for playing music" off \
"ncmpcpp" "An mpd client and almost exact clone of ncmpc with some new features" off \
"cmus" "A small, fast and powerful console music player for Unix-like operating systems" off \
"audacious" "A free and advanced audio player based on GTK+" off \
@ -407,7 +386,7 @@ extra_packages() {
"abiword" "Fully-featured word processor" off \
"calligra" "A set of applications for productivity" off \
"evince" "A document viewer" off \
"zathura zathura-pdf-poppler" "Minimalistic document viewer" off \
"zathura" "Minimalistic document viewer" off \
"qpdfview" "A tabbed PDF viewer" off \
"mupdf mupdf-tools" "Lightweight PDF and XPS viewer" off \
"gpicview" "Lightweight image viewer" off \
@ -424,29 +403,25 @@ extra_packages() {
"gcolor2" "A simple GTK+2 color selector" off \
"plank" "An elegant, simple, and clean dock" off \
"docky" "Full fledged dock that makes opening common applications and managing windows faster and easier" off \
"cairo-dock cairo-dock-plug-ins" "Light eye-candy fully themable animated dock" off \
"qt5-styleplugins qt5ct" "GUI for managing Qt based application themes, icons, and fonts" off \
"cairo-dock" "Light eye-candy fully themable animated dock" off \
"qt5ct" "GUI for managing Qt based application themes, icons, and fonts" off \
"ttf-hack" "A hand groomed and optically balanced typeface based on Bitstream Vera Mono" off \
"ttf-anonymous-pro" "A family of four fixed-width fonts designed especially with coding in mind" off \
"ttf-font-awesome" "Iconic font designed for Bootstrap" off \
"ttf-fira-code" "Monospaced font with programming ligatures" off \
"noto-fonts-cjk" "Google Noto CJK fonts (Chinese, Japanese, Korean)" off \
"noto-fonts noto-fonts-emoji" "Google Noto fonts and emoji" off)"
"noto-fonts" "Google Noto fonts" off \
"noto-fonts-cjk" "Google Noto CJK fonts (Chinese, Japanese, Korean)" off)"
[[ $pkgs =~ vlc ]] && pkgs="$pkgs qt4"
[[ $pkgs =~ mpd ]] && pkgs="$pkgs mpc"
[[ $pkgs =~ mpd ]] && pkgs="$pkgs zathura-pdf-poppler"
[[ $pkgs =~ qt5ct ]] && pkgs="$pkgs qt5-styleplugins"
[[ $pkgs =~ cairo-dock ]] && pkgs="$pkgs cairo-dock-plug-ins"
[[ $pkgs =~ noto-fonts ]] && pkgs="$pkgs noto-fonts-emoji"
[[ $pkgs =~ kdenlive ]] && pkgs="$pkgs kdebase-runtime dvdauthor frei0r-plugins breeze breeze-gtk"
EXTRA_PACKAGES="$pkgs $EXTRA_PACKAGES"
return 0
}
choose_kernel() {
if ! [[ $VM ]] && ! yesno 'Choose Kernel' "\nUse the current Linux kernel or the LTS kernel?\n" 'Current' 'LTS'; then
KERNEL='linux-lts'
else
KERNEL='linux'
fi
return 0
}
mirrorlist_cmd() {
MIRROR_CMD="reflector --score 100 -l 50 -f 10 --sort rate"
yesno "$_MirrorTitle" "$_MirrorSetup" "Automatic" "Custom" && return 0
@ -518,15 +493,29 @@ Packages: $EXTRA_PACKAGES"
}
configure_install() {
# whether to use a custom mirror sorting command later
setup_hostname || return 1
setup_locale || return 1
tput cnorm
declare -g HOSTNAME
HOSTNAME="$(getinput "$_ConfHost" "$_HostNameBody" "${DIST,,}")"
[[ $? != 0 || $HOSTNAME == "" ]] && return 1
tput civis
declare -g LOCALE
LOCALE="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
--title " $_ConfLocale " --menu "$_LocaleBody" 25 70 20 $LOCALES)"
[[ $? != 0 || $LOCALE == "" ]] && return 1
setup_timezone || return 1
mirrorlist_cmd || return 1
user_setup || return 1
window_manager || return 1
choose_kernel
extra_packages || return 1
if yesno 'Choose Kernel' "\nUse the current Linux kernel or the LTS kernel?\n" 'Current' 'LTS'; then
KERNEL='linux'
else
KERNEL='linux-lts'
fi
extra_packages
CONFIG_DONE=true
return 0
}

View File

@ -198,9 +198,7 @@ install_bootloader() {
fi
# needed for os-prober module to work properly in the chroot
echo -e "\n\nBinding mount: /run/udev -> $MNT/run/udev\n\n"
mkdir -p $MNT/run/udev && mount --bind /run/udev $MNT/run/udev
read NONE
# BCMDS[$BOOTLDR]="mkdir -p /run/udev && mount --bind /run/udev /run/udev ; ${BCMDS[$BOOTLDR]}"
if [[ $SYS == 'UEFI' ]]; then

View File

@ -231,7 +231,7 @@ update_system() {
local install="pacman -S $inpkg $EXTRA_PACKAGES --needed --noconfirm"
local remove="pacman -Rs $rmpkg --noconfirm"
chroot_cmd "$update; $network; $install; $remove" 2>/dev/null
chroot_cmd "$update; $network; $install; $remove"
if [[ $INSTALL_WMS =~ dwm ]]; then
mkdir -pv $MNT/home/$LIVE/suckless