# immutable globals
-readonly VER="1.7.20" # Installer version
+readonly VER="1.7.24" # Installer version
readonly DIST="ArchLabs" # Linux distributor
readonly MNT="/mnt/install" # Install mountpoint
readonly ERR="/tmp/errlog" # Built-in error log
if [[ $CURRENT_MENU != "main" ]]; then
if [[ $SAVED ]]; then
SELECTED=$((SAVED + 1))
+ unset SAVED
else
SELECTED=1
fi
[UEFI]="systemd-boot ${BMNTS[UEFI-systemd-boot]} grub ${BMNTS[UEFI-grub]} syslinux ${BMNTS[UEFI-syslinux]}"
)
-declare -Agx EDIT_FILES=(
-[2]="/etc/X11/xorg.conf.d/00-keyboard.conf /etc/default/keyboard /etc/vconsole.conf"
-[3]="/etc/locale.conf /etc/default/locale"
-[4]="/etc/hostname /etc/hosts"
-[5]="/etc/sudoers"
-[6]="/etc/mkinitcpio.conf"
-[7]="/etc/fstab"
-[8]="/etc/crypttab"
-[9]="/etc/default/grub"
-[10]="/etc/pacman.conf"
-[11]="" # empty login files, we don't know /home/USER?/FILES?
-)
-
prep_for_grub()
{
local cfg="$MNT/etc/default/grub"
declare -g MYSHELL=""
declare -g MKINIT_HOOKS="shutdown"
+# match the wm name with the actual session name used for xinit
declare -gA WM_SESSIONS=(
[i3-gaps]='i3'
[dwm]='dwm'
[cinnamon]='cinnamon-session'
)
+# additional packages installed for the given window manager
declare -gA WM_EXT=(
-[dwm]="ttf-hack"
-[bspwm]="sxhkd"
+[bspwm]="sxhkd libmpdclient jsoncpp archlabs-screenlock archlabs-polybar rofi"
[gnome]="gnome-extra"
-[i3-gaps]="i3status perl-anyevent-i3"
+[i3-gaps]="i3status perl-anyevent-i3 libmpdclient jsoncpp archlabs-screenlock archlabs-polybar rofi"
[xfce4]="xfce4-goodies xfce4-pulseaudio-plugin"
-[openbox]="archlabs-obkey obconf archlabs-kickshaw tint2 archlabs-skippy-xd conky jgmenu"
+[openbox]="archlabs-obkey obconf archlabs-kickshaw tint2 archlabs-oblogout jgmenu tint2 archlabs-skippy-xd conky thunar termite libmpdclient jsoncpp archlabs-screenlock archlabs-paranoid archlabs-polybar rofi"
+)
+
+declare -gA EDIT_FILES=(
+[2]="/etc/X11/xorg.conf.d/00-keyboard.conf /etc/default/keyboard /etc/vconsole.conf"
+[3]="/etc/locale.conf /etc/default/locale"
+[4]="/etc/hostname /etc/hosts"
+[5]="/etc/sudoers"
+[6]="/etc/mkinitcpio.conf"
+[7]="/etc/fstab"
+[8]="/etc/crypttab"
+[9]="/etc/default/grub"
+[10]="/etc/pacman.conf"
+[11]="" # empty login files, we don't know /home/USER?/FILES?
)
# }
{
tput cnorm
local values
- if ! values="$(dialog --stdout --no-cancel --separator '~' --ok-label "Submit" --backtitle "$BT" \
- --title " $_UserTitle " --insecure --mixedform "$_UserBody" 27 75 10 \
+ if ! values="$(dialog --stdout --no-cancel --separator '~' \
+ --ok-label "Submit" --backtitle "$BT" --title " $_UserTitle " \
+ --insecure --mixedform "$_UserBody" 27 75 10 \
"$_Username" 1 1 "" 1 $((${#_Username} + 2)) 71 0 0 \
"$_Password" 2 1 "" 2 $((${#_Password} + 2)) 71 0 1 \
"$_Password2" 3 1 "" 3 $((${#_Password2} + 2)) 71 0 1 \
"bspwm" "A tiling window manager that represents windows as the leaves of a binary tree" off \
"gnome" "A desktop environment that aims to be simple and easy to use" off \
"cinnamon" "A desktop environment combining a traditional desktop layout with modern graphical effects" off \
- "xfce4" "A lightweight and modular desktop environment based on GTK+ 2 and 3" off)"; then
+ "xfce4" "A lightweight and modular desktop environment based on GTK+ 2 and 3" off)" || [[ ! $INSTALL_WMS ]]; then
return 1
fi
- [[ $INSTALL_WMS ]] || INSTALL_WMS='openbox'
WM_NUM=$(awk '{print NF}' <<< "$INSTALL_WMS")
WM_PACKAGES="${INSTALL_WMS/dwm/}" # remove dwm from package list
# packages needed for the selected WMs/DEs
for wm in $INSTALL_WMS; do
- LOGIN_CHOICES="${LOGIN_CHOICES}$wm - "
+ LOGIN_CHOICES+="$wm - "
WM_PACKAGES+=" ${WM_EXT[$wm]}"
done
- if [[ $INSTALL_WMS =~ (openbox|bspwm|i3-gaps) ]]; then
- WM_PACKAGES+=" libmpdclient jsoncpp archlabs-screenlock termite archlabs-oblogout"
- WM_PACKAGES+=" archlabs-polybar archlabs-paranoid rofi thunar"
- elif [[ $INSTALL_WMS =~ xfce4 ]]; then
- WM_PACKAGES+=" archlabs-oblogout archlabs-screenlock archlabs-paranoid"
- fi
-
# choose how to log in
select_login_method || return 1
fi
# add packages to the main package list
- if [[ $MYSHELL == *mksh ]]; then
- declare -g PACKAGES="mksh $WM_PACKAGES"
- else
- declare -g PACKAGES="$WM_PACKAGES"
- fi
+ declare -g PACKAGES="$WM_PACKAGES"
}
select_login_method()
esac
select_packages
else
- # add any extra for each package
+
+ # add any extras for each package
for pkg in $PACKAGES; do
[[ ${PKG_EXT[$pkg]} ]] && PACKAGES+=" ${PKG_EXT[$pkg]}"
done
+ # add mksh to package list if it was chosen as the login shell
+ if [[ $MYSHELL == *mksh ]]; then
+ declare -g PACKAGES="mksh $PACKAGES"
+ fi
+
# remove duplicates and leading spaces
PACKAGES="$(uniq <<< "${PACKAGES/^ /}")"
return 0
oneshot install_base
# generate /etc/fstab and touch it up if we used a swapfile
+ echo
genfstab -U $MNT > $MNT/etc/fstab 2>$ERR
echeck "genfstab -U $MNT > $MNT/etc/fstab"
[[ -f $MNT/swapfile ]] && sed -i "s~${MNT}~~" $MNT/etc/fstab
{
# compressed image?
if [[ -e /run/archiso/sfs/airootfs/ ]]; then
- printf "\nUnpacking base system --- Total: ~ 2.9G\n\n"
+ printf "\nUnpacking base system --- Total: ~ 2.7G\n\n"
rsync -ah --info=progress2 /run/archiso/sfs/airootfs/ $MNT/
else
# update the mirrorlist.. MUST be done before pacstrapping or it may be slow
mirrorlist_sort()
{
- printf "\n\n%s\n\n" "Sorting the mirrorlist"
+ printf "\n%s\n\n" "Sorting the mirrorlist"
if hash reflector >/dev/null 2>&1; then
$MIRROR_CMD --save $MNT/etc/pacman.d/mirrorlist --verbose ||
reflector --score 100 -l 50 -f 10 --sort rate --verbose --save $MNT/etc/pacman.d/mirrorlist
suckless_install()
{
# install and setup dwm
- printf "\n\n%s\n\n" "Installing and setting up dwm."
+ printf "\n%s\n\n" "Installing and setting up dwm."
mkdir -pv $MNT/home/$NEWUSER/suckless
for i in dwm dmenu st; do
p="/home/$NEWUSER/suckless/$i"
{
local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" 0 0 0 \
+ "neovim" "A fork of Vim aiming to improve user experience, plugins, and GUIs." off \
"atom" "An open-source text editor developed by GitHub that is licensed under the MIT License" off \
"geany" "A fast and lightweight IDE" off \
"emacs" "An extensible, customizable, self-documenting real-time display editor" off \
- "neovim" "A fork of Vim aiming to improve user experience, plugins, and GUIs." off \
"mousepad" "A simple text editor" off)"
printf "%s" "$pkgs"
}
pkgs="$(checkbox "$_Packages" "$_PackageBody" 0 0 0 \
"termite" "A minimal VTE-based terminal emulator" off \
"rxvt-unicode" "A unicode enabled rxvt-clone terminal emulator" off \
+ "xterm" "The standard terminal emulator for the X window system" off \
+ "alacritty" "A minimal VTE-based terminal emulator" off \
"terminator" "Terminal emulator that supports tabs and grids" off \
+ "sakura" "A terminal emulator based on GTK and VTE" off \
"tilix" "A tiling terminal emulator for Linux using GTK+ 3" off \
"tilda" "A Gtk based drop down terminal for Linux and Unix" off \
"xfce4-terminal" "A terminal emulator based in the Xfce Desktop Environment" off)"
local pkgs=""
pkgs="$(checkbox "$_Packages" "$_PackageBody" 0 0 0 \
"vlc" "A free and open source cross-platform multimedia player" off \
+ "mpv" "A media player based on mplayer" 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 \
pkgs="$(checkbox "$_Packages" "$_PackageBody" 0 0 0 \
"thunar" "A modern file manager for the Xfce Desktop Environment" off \
"pcmanfm" "A fast and lightweight file manager based in Lxde" off \
+ "gparted" "A GUI frontend for creating and manipulating partition tables" off \
"gnome-disk-utility" "Disk Management Utility" off \
"gnome-system-monitor" "View current processes and monitor system state" off \
"qt5ct" "GUI for managing Qt based application themes, icons, and fonts" off \
+ "file-roller" "Create and modify archives" off \
+ "xarchiver" "A GTK+ frontend to various command line archivers" 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 \
if ! curl -s --head 'https://www.archlinux.org/mirrorlist/all/' | sed '1q' | grep -qw '200'; then
if [[ $(systemctl is-active NetworkManager) == "active" ]] && hash nmtui >/dev/null 2>&1; then
tput civis; nmtui-connect
- if curl -s --head 'https://www.archlinux.org/mirrorlist/all/' | sed '1q' | grep -qw '200'; then
- export HAS_NETWORK=true
- else
+ if ! curl -s --head 'https://www.archlinux.org/mirrorlist/all/' | sed '1q' | grep -qw '200'; then
infobox "$_ErrTitle" "$_NoNetwork" 3
+ die 1
fi
fi
- else
- export HAS_NETWORK=true
fi
+
return 0
}