From 525899102374a699af2070cbe0e72d87ffedb144 Mon Sep 17 00:00:00 2001 From: natemaia Date: Sun, 2 Dec 2018 21:10:31 -0800 Subject: [PATCH] Finish cleaning up package defaults for each WM and removing defaults --- src/archlabs-installer | 3 ++- src/lib/boot.sh | 13 ----------- src/lib/dialogs.sh | 53 ++++++++++++++++++++++++------------------ src/lib/install.sh | 7 +++--- src/lib/package.sh | 9 ++++++- src/lib/utils.sh | 8 +++---- 6 files changed, 48 insertions(+), 45 deletions(-) diff --git a/src/archlabs-installer b/src/archlabs-installer index 3c456e7..e4bfa77 100755 --- a/src/archlabs-installer +++ b/src/archlabs-installer @@ -10,7 +10,7 @@ # 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 @@ -21,6 +21,7 @@ main() if [[ $CURRENT_MENU != "main" ]]; then if [[ $SAVED ]]; then SELECTED=$((SAVED + 1)) + unset SAVED else SELECTED=1 fi diff --git a/src/lib/boot.sh b/src/lib/boot.sh index 9158a18..5741975 100644 --- a/src/lib/boot.sh +++ b/src/lib/boot.sh @@ -22,19 +22,6 @@ declare -Agrx BOOTLDRS=( [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" diff --git a/src/lib/dialogs.sh b/src/lib/dialogs.sh index 6428edd..6a1bf50 100644 --- a/src/lib/dialogs.sh +++ b/src/lib/dialogs.sh @@ -37,6 +37,7 @@ declare -g PACKAGES="" 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' @@ -47,13 +48,26 @@ declare -gA WM_SESSIONS=( [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? ) # } @@ -171,8 +185,9 @@ user_creation() { 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 \ @@ -312,10 +327,9 @@ select_wm_or_de() "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 @@ -323,17 +337,10 @@ select_wm_or_de() # 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 @@ -354,11 +361,7 @@ select_wm_or_de() 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() @@ -406,11 +409,17 @@ select_packages() 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 diff --git a/src/lib/install.sh b/src/lib/install.sh index 2ff0aea..867e2b5 100644 --- a/src/lib/install.sh +++ b/src/lib/install.sh @@ -23,6 +23,7 @@ install() 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 @@ -56,7 +57,7 @@ install_base() { # 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 @@ -282,7 +283,7 @@ run_mkinitcpio() 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 @@ -336,7 +337,7 @@ package_operations() 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" diff --git a/src/lib/package.sh b/src/lib/package.sh index 92a165b..7989450 100644 --- a/src/lib/package.sh +++ b/src/lib/package.sh @@ -43,10 +43,10 @@ select_editors() { 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" } @@ -57,7 +57,10 @@ select_terminals() 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)" @@ -69,6 +72,7 @@ select_music_and_video() 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 \ @@ -121,9 +125,12 @@ select_managment() 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 \ diff --git a/src/lib/utils.sh b/src/lib/utils.sh index 18a67de..f5f3cac 100644 --- a/src/lib/utils.sh +++ b/src/lib/utils.sh @@ -159,15 +159,13 @@ system_checks() 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 }