Add special case for neovim

This commit is contained in:
natemaia 2018-08-27 23:39:26 -07:00
parent 77d01c27a1
commit b3657b0c9d
3 changed files with 30 additions and 41 deletions

View File

@ -12,7 +12,7 @@
# immutable variables {
readonly DIST="ArchLabs" # Linux distributor
readonly VER="1.6.60" # Installer version
readonly VER="1.6.62" # Installer version
readonly LIVE="liveuser" # Live session user
readonly MNT="/mnt/install" # Install mountpoint
readonly ERR="/tmp/errlog" # Built-in error log
@ -126,7 +126,7 @@ init_variables() {
}
source_file() {
source $1 2>/dev/null && return 0
. $1 2>/dev/null && return 0
echo -e "\nFailed to source library file $1"
die 1
}
@ -265,10 +265,6 @@ setup_timezone() {
}
window_manager() {
LOGIN_WM=""
LOGIN_TYPE=""
WM_PACKAGES=""
INSTALL_WMS="$(dialog --cr-wrap --stdout --backtitle "$BT" --no-cancel \
--title " $_WMChoice " --checklist "$_WMChoiceBody\n" 0 0 0 \
"openbox" "A lightweight, powerful, and highly configurable stacking window manager" off \
@ -278,15 +274,13 @@ window_manager() {
"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)"
INSTALL_WMS="${INSTALL_WMS:-openbox}"
WM_NUM=$(awk '{print NF}' <<< "$INSTALL_WMS")
# packages needed for the selected window manager
for wm in $INSTALL_WMS; do
WM_LOGIN_CHOICES="${WM_LOGIN_CHOICES}$wm - "
LOGIN_CHOICES="${LOGIN_CHOICES}$wm - "
case $wm in
openbox) WM_PACKAGES="$WM_PACKAGES $wm obconf archlabs-obkey archlabs-kickshaw tint2 conky" ;;
openbox) WM_PACKAGES="$WM_PACKAGES $wm obconf archlabs-obkey archlabs-kickshaw archlabs-skippy-xd tint2 conky" ;;
bspwm) WM_PACKAGES="$WM_PACKAGES $wm sxhkd" ;;
i3-gaps) WM_PACKAGES="$WM_PACKAGES $wm i3status perl-anyevent-i3" ;;
gnome) WM_PACKAGES="$WM_PACKAGES $wm gnome-extra" ;;
@ -296,41 +290,38 @@ window_manager() {
done
if [[ $INSTALL_WMS =~ (openbox|bspwm|i3-gaps) ]]; then
WM_PACKAGES="$WM_PACKAGES termite thunar archlabs-polybar archlabs-screenlock archlabs-skippy-xd archlabs-oblogout lxappearance"
WM_PACKAGES="$WM_PACKAGES termite thunar archlabs-polybar archlabs-screenlock archlabs-oblogout lxappearance"
elif [[ $INSTALL_WMS =~ (xfce4) ]]; then
WM_PACKAGES="$WM_PACKAGES archlabs-oblogout archlabs-screenlock"
fi
EXTRA_PACKAGES="$WM_PACKAGES"
if [[ $LOGIN_TYPE == 'lightdm' ]]; then
EXTRA_PACKAGES="$EXTRA_PACKAGES lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice"
fi
if yesno "$_WMLogin" "$_LoginTypeBody\n" "xinit" "lightdm"; then
LOGIN_TYPE='xinit'
FILES[11]="/home/$NEWUSER/.xinitrc"
else
LOGIN_TYPE='lightdm'
WM_PACKAGES="$WM_PACKAGES lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice"
FILES[11]="/etc/lightdm/lightdm.conf $MNT/etc/lightdm/lightdm-gtk-greeter.conf"
fi
EXTRA_PACKAGES="$WM_PACKAGES"
yesno "$_WMLogin" "$_AutoLoginBody\n" && AUTOLOGIN=true || AUTOLOGIN=false
if [[ $WM_NUM -eq 1 ]]; then
LOGIN_WM="$INSTALL_WMS"
else
LOGIN_WM="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
--title " $_WMLogin " --menu "$_WMLoginBody" 0 0 0 $WM_LOGIN_CHOICES)"
--title " $_WMLogin " --menu "$_WMLoginBody" 0 0 0 $LOGIN_CHOICES)"
[[ $LOGIN_WM == "" ]] && LOGIN_WM="$(awk '{print $1}' <<< "$INSTALL_WMS")"
fi
case $LOGIN_WM in
i3-gaps) LOGIN_WM='i3' ;;
gnome) LOGIN_WM='gnome-session' ;;
i3-gaps) LOGIN_WM='i3' ;;
gnome) LOGIN_WM='gnome-session' ;;
cinnamon) LOGIN_WM='cinnamon-session' ;;
openbox) LOGIN_WM='openbox-session' ;;
xfce4) LOGIN_WM='startxfce4' ;;
openbox) LOGIN_WM='openbox-session' ;;
xfce4) LOGIN_WM='startxfce4' ;;
esac
return 0

View File

@ -181,13 +181,6 @@ EOF
install_bootloader() {
chroot_cmd "export PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/bin/core_perl"
local ucode=""
if [[ $(grep 'GenuineIntel' /proc/cpuinfo) && -e $MNT/boot/intel-ucode.img ]]; then
ucode="/intel-ucode.img"
elif [[ $(grep 'AuthenticAMD' /proc/cpuinfo) && -e $MNT/boot/amd-ucode.img ]]; then
ucode="/amd-ucode.img"
fi
# if not on an LVM we can use the UUID for booting
if ! [[ $ROOT_PART =~ /dev/mapper ]]; then
ROOT_PART_ID="UUID=$(blkid -s PARTUUID $ROOT_PART | sed 's/.*=//g; s/"//g')"
@ -199,7 +192,7 @@ install_bootloader() {
# needed for os-prober module to work properly in the chroot
mkdir -p $MNT/run/udev && mount --bind /run/udev $MNT/run/udev
# BCMDS[$BOOTLDR]="mkdir -p /run/udev && mount --bind /run/udev /run/udev ; ${BCMDS[$BOOTLDR]}"
BCMDS[$BOOTLDR]="mkdir -p /run/udev && mount --bind /run/udev /run/udev ; ${BCMDS[$BOOTLDR]}"
if [[ $SYS == 'UEFI' ]]; then
# make sure efivarfs has been mounted
@ -214,6 +207,12 @@ install_bootloader() {
-type d -exec rm -rf '{}' \; >/dev/null 2>&1
fi
local ucode=""
if [[ $(grep 'GenuineIntel' /proc/cpuinfo) && -e $MNT/boot/intel-ucode.img ]]; then
ucode="/intel-ucode.img"
elif [[ $(grep 'AuthenticAMD' /proc/cpuinfo) && -e $MNT/boot/amd-ucode.img ]]; then
ucode="/amd-ucode.img"
fi
# sets up the bootloader config(s) and ${BCMDS[$BOOTLDR]}
prep_for_$BOOTLDR "$ucode"

View File

@ -14,10 +14,7 @@ install_main() {
check_for_errors "genfstab -U $MNT > $MNT/etc/fstab"
# touch up fstab if we used a swapfile
if [[ -f $MNT/swapfile ]]; then
sed -i "s~${MNT}~~" $MNT/etc/fstab 2>$ERR
check_for_errors "sed -i s~${MNT}~~ $MNT/etc/fstab"
fi
[[ -f $MNT/swapfile ]] && sed -i "s~${MNT}~~" $MNT/etc/fstab
# update the mirrorlist, if this isn't done before updating or it may be slow
local cmdtail="--verbose --save $MNT/etc/pacman.d/mirrorlist"
@ -41,7 +38,7 @@ install_main() {
install_base() {
clear
tput cnorm
echo -e "\nUnpacking base filesystem..\n\n"
echo -e "\nUnpacking base filesystem --- Total: ~2.8G\n\n"
rsync -ah --info=progress2 /run/archiso/sfs/airootfs/ $MNT/
# remove archiso init files and clean up install files
@ -75,8 +72,8 @@ setup_configs() {
sed -i "s/#en_US.UTF-8/en_US.UTF-8/g; s/#${LOCALE}/${LOCALE}/g" $MNT/etc/locale.gen
sed -i "s/en_US.UTF-8/${LOCALE}/g" $MNT/etc/locale.conf
cp -f $MNT/etc/locale.conf $MNT/etc/default/locale
chroot_cmd "locale-gen" 2>$ERR
chroot_cmd "ln -sf /usr/share/zoneinfo/$ZONE/$SUBZONE /etc/localtime" 2>$ERR
chroot_cmd "locale-gen" 2>/dev/null
chroot_cmd "ln -sf /usr/share/zoneinfo/$ZONE/$SUBZONE /etc/localtime" 2>/dev/null
# setup xorg vsync config for intel graphics
if [[ $(lspci | grep ' VGA ' | grep 'Intel') != "" ]]; then
@ -211,10 +208,6 @@ update_system() {
rmpkg="$rmpkg $vbx virtualbox-guest-utils"
fi
if [[ $INSTALL_WMS == 'dwm' ]]; then
inpkg="$inpkg xorg-server"
fi
# for gnome and cinnamon we don't need the xfce provided stuff
if [[ $INSTALL_WMS == 'gnome' || $INSTALL_WMS == 'cinnamon' ]]; then
rmpkg="$(pacman -Qssq 'xfce4*' 2>/dev/null)"
@ -233,6 +226,12 @@ update_system() {
chroot_cmd "$update; $network; $install; $remove"
if [[ $EXTRA_PACKAGES =~ neovim ]]; then
mkdir -p $MNT/home$LIVE/.config/nvim
cp -f $MNT/home/$LIVE/.vimrc $MNT/home$LIVE/.config/nvim/init.vim
cp -rf $MNT/home/$LIVE/.vim/colors $MNT/home$LIVE/.config/nvim/colors
fi
if [[ $INSTALL_WMS =~ dwm ]]; then
mkdir -pv $MNT/home/$LIVE/suckless
for prog in dwm st dmenu; do