Add: mksh as login shell choice. Fix: viewing debug log.
This commit is contained in:
parent
8e1b4a6647
commit
678019d663
@ -32,7 +32,7 @@ declare -Agx EDIT_FILES=(
|
||||
[8]="/etc/crypttab"
|
||||
[9]="/etc/default/grub"
|
||||
[10]="/etc/pacman.conf"
|
||||
[11]="" # login files, left empty, don't know the username yet for /home/USER/FILES
|
||||
[11]="" # empty login files, we don't know /home/USER?/FILES?
|
||||
)
|
||||
|
||||
prep_for_grub()
|
||||
|
@ -8,8 +8,7 @@
|
||||
|
||||
# shellcheck disable=2154,2034,2153
|
||||
|
||||
# mutable globals
|
||||
# {
|
||||
# mutable globals {
|
||||
|
||||
declare -g WARN=false
|
||||
declare -g AUTOLOGIN=false
|
||||
@ -38,9 +37,26 @@ declare -g PACKAGES=""
|
||||
declare -g MYSHELL=""
|
||||
declare -g MKINIT_HOOKS="shutdown"
|
||||
|
||||
# }
|
||||
declare -gA WM_SESSIONS=(
|
||||
[i3-gaps]='i3'
|
||||
[dwm]='dwm'
|
||||
[openbox]='openbox-session'
|
||||
[bspwm]='bspwm'
|
||||
[xfce4]='startxfce4'
|
||||
[gnome]='gnome-session'
|
||||
[cinnamon]='cinnamon-session'
|
||||
)
|
||||
|
||||
# basic dialog helper functions
|
||||
declare -gA WM_EXT=(
|
||||
[dwm]="ttf-hack"
|
||||
[bspwm]="sxhkd"
|
||||
[gnome]="gnome-extra"
|
||||
[i3-gaps]="i3status perl-anyevent-i3"
|
||||
[xfce4]="xfce4-goodies xfce4-pulseaudio-plugin"
|
||||
[openbox]="archlabs-obkey obconf archlabs-kickshaw tint2 archlabs-skippy-xd conky jgmenu"
|
||||
)
|
||||
|
||||
# }
|
||||
|
||||
msgbox()
|
||||
{
|
||||
@ -111,8 +127,6 @@ yesno()
|
||||
fi
|
||||
}
|
||||
|
||||
# larger specific dialog menus
|
||||
|
||||
select_language()
|
||||
{
|
||||
tput civis
|
||||
@ -289,15 +303,13 @@ select_timezone()
|
||||
|
||||
select_wm_or_de()
|
||||
{
|
||||
declare -g PACKAGES=""
|
||||
|
||||
tput civis
|
||||
if ! INSTALL_WMS="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||
--title " $_WMChoice " --checklist "$_WMChoiceBody\n" 0 0 0 \
|
||||
"openbox" "A lightweight, powerful, and highly configurable stacking window manager" off \
|
||||
"bspwm" "A tiling window manager that represents windows as the leaves of a binary tree" off \
|
||||
"i3-gaps" "A fork of i3 window manager with more features including gaps" off \
|
||||
"dwm" "A customized fork of dwm, with patches and modifications" off \
|
||||
"openbox" "A lightweight, powerful, and highly configurable stacking window manager" off \
|
||||
"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
|
||||
@ -306,24 +318,18 @@ select_wm_or_de()
|
||||
[[ $INSTALL_WMS ]] || INSTALL_WMS='openbox'
|
||||
|
||||
WM_NUM=$(awk '{print NF}' <<< "$INSTALL_WMS")
|
||||
WM_PACKAGES="${INSTALL_WMS/dwm/}" # remove dwm as we are compiling from source
|
||||
WM_PACKAGES="${WM_PACKAGES// / }" # remove double spaces from the string
|
||||
WM_PACKAGES="${INSTALL_WMS/dwm/}" # remove dwm from package list
|
||||
WM_PACKAGES="${WM_PACKAGES// / }" # remove double spaces
|
||||
|
||||
# packages needed for the selected WMs/DEs
|
||||
for wm in $INSTALL_WMS; do
|
||||
LOGIN_CHOICES="${LOGIN_CHOICES}$wm - "
|
||||
case $wm in
|
||||
dwm) WM_PACKAGES+=" ttf-hack" ;;
|
||||
bspwm) WM_PACKAGES+=" sxhkd" ;;
|
||||
gnome) WM_PACKAGES+=" gnome-extra" ;;
|
||||
i3-gaps) WM_PACKAGES+=" i3status perl-anyevent-i3" ;;
|
||||
xfce4) WM_PACKAGES+=" xfce4-goodies xfce4-pulseaudio-plugin" ;;
|
||||
openbox) WM_PACKAGES+=" archlabs-obkey obconf archlabs-kickshaw tint2 archlabs-skippy-xd conky jgmenu" ;;
|
||||
esac
|
||||
WM_PACKAGES+=" ${WM_EXT[$wm]}"
|
||||
done
|
||||
|
||||
if [[ $INSTALL_WMS =~ (openbox|bspwm|i3-gaps) ]]; then
|
||||
WM_PACKAGES+=" libmpdclient jsoncpp archlabs-screenlock termite archlabs-oblogout archlabs-polybar archlabs-paranoid rofi thunar"
|
||||
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
|
||||
@ -331,33 +337,28 @@ select_wm_or_de()
|
||||
# choose how to log in
|
||||
select_login_method || return 1
|
||||
|
||||
# choose which WM/DE to start at login
|
||||
# choose which WM/DE to start at login, only for xinit
|
||||
if [[ $LOGIN_TYPE == 'xinit' ]]; then
|
||||
if [[ $WM_NUM -eq 1 ]]; then
|
||||
LOGIN_WM="$INSTALL_WMS"
|
||||
LOGIN_WM="${WM_SESSIONS[$INSTALL_WMS]}"
|
||||
else
|
||||
if ! LOGIN_WM="$(menubox "$_WMLogin" "$_WMLoginBody" 0 0 0 $LOGIN_CHOICES)"; then
|
||||
return 1
|
||||
else
|
||||
LOGIN_WM="${WM_SESSIONS[$LOGIN_WM]}"
|
||||
fi
|
||||
fi
|
||||
|
||||
case $LOGIN_WM in
|
||||
i3-gaps) LOGIN_WM='i3' ;;
|
||||
xfce4) LOGIN_WM='startxfce4' ;;
|
||||
gnome) LOGIN_WM='gnome-session' ;;
|
||||
openbox) LOGIN_WM='openbox-session' ;;
|
||||
cinnamon) LOGIN_WM='cinnamon-session' ;;
|
||||
esac
|
||||
|
||||
# autologin
|
||||
yesno "$_WMLogin" "$_AutoLoginBody\n" && AUTOLOGIN=true || AUTOLOGIN=false
|
||||
else
|
||||
AUTOLOGIN=false
|
||||
fi
|
||||
|
||||
# add packages to the main package list
|
||||
PACKAGES="$WM_PACKAGES"
|
||||
return 0
|
||||
if [[ $MYSHELL == *mksh ]]; then
|
||||
declare -g PACKAGES="mksh $WM_PACKAGES"
|
||||
else
|
||||
declare -g PACKAGES="$WM_PACKAGES"
|
||||
fi
|
||||
}
|
||||
|
||||
select_login_method()
|
||||
@ -530,7 +531,7 @@ configure_system_settings()
|
||||
user_creation || return 1
|
||||
|
||||
tput civis
|
||||
if ! MYSHELL="$(menubox "$_ShellTitle" "$_ShellBody" 0 0 0 '/bin/zsh' '-' '/bin/bash' '-')"; then
|
||||
if ! MYSHELL="$(menubox "$_ShellTitle" "$_ShellBody" 0 0 0 '/usr/bin/zsh' '-' '/bin/bash' '-' '/usr/bin/mksh' '-')"; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
@ -576,7 +577,7 @@ edit_system_configs()
|
||||
"9" "${BOOTLDR^}" "10" "Pacman.conf" "11" "${LOGIN_TYPE^}")
|
||||
|
||||
if [[ ! $SELECTED || $SELECTED -eq 1 ]]; then
|
||||
[[ $DEBUG == true ]] && more $DEBUG
|
||||
[[ $DEBUG == true && -r $DBG ]] && more $DBG
|
||||
# when die() is passed 127 as the exit code it will issue `systemctl -i reboot`
|
||||
die 127
|
||||
else
|
||||
@ -589,7 +590,11 @@ edit_system_configs()
|
||||
vim -O $existing_files
|
||||
else
|
||||
for f in $existing_files; do
|
||||
if hash nano >/dev/null 2>&1; then nano $f; else vi $f; fi
|
||||
if hash nano >/dev/null 2>&1; then
|
||||
nano "$f"
|
||||
else
|
||||
vi "$f"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
else
|
||||
|
@ -240,9 +240,9 @@ EOF
|
||||
|
||||
# automatic startx for login shells
|
||||
case $MYSHELL in
|
||||
/bin/bash) local loginrc=".bash_profile" ;;
|
||||
/usr/bin/zsh) local loginrc=".zprofile" ;;
|
||||
/usr/bin/mksh) local loginrc=".profile" ;;
|
||||
*bash) local loginrc=".bash_profile" ;;
|
||||
*zsh) local loginrc=".zprofile" ;;
|
||||
*mksh) local loginrc=".profile" ;;
|
||||
esac
|
||||
|
||||
# add the shell login file to the edit list after install
|
||||
|
@ -128,7 +128,7 @@ luks_default()
|
||||
cryptsetup open $LUKS_PART "$LUKS_NAME" <<< "$(openssl enc -pbkdf2 -a -d -salt -pass pass:$SALT <<< "$LUKS_PASS")" 2>$ERR
|
||||
echeck "cryptsetup open $LUKS_PART $LUKS_NAME"
|
||||
|
||||
LUKS=' encrypted'
|
||||
export LUKS=' encrypted'
|
||||
luks_show
|
||||
return 0
|
||||
}
|
||||
|
@ -149,10 +149,10 @@ system_checks()
|
||||
[[ $(whoami) == "root" ]] || { infobox "$_ErrTitle" "$_NotRoot\n$_Exit" && die 1; }
|
||||
grep -qw 'lm' /proc/cpuinfo || { infobox "$_ErrTitle" "$_Not64Bit\n$_Exit" && die 1; }
|
||||
|
||||
if ! curl -s --head 'https://www.archlinux.org/mirrorlist/all/' | head -n 1 | grep -q '200'; then
|
||||
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/' | head -n 1 | grep -q '200'; then
|
||||
if curl -s --head 'https://www.archlinux.org/mirrorlist/all/' | sed '1q' | grep -qw '200'; then
|
||||
export HAS_NETWORK=true
|
||||
else
|
||||
infobox "$_ErrTitle" "$_NoNetwork" 3
|
||||
|
Reference in New Issue
Block a user