Add special case for neovim
This commit is contained in:
parent
77d01c27a1
commit
b3657b0c9d
@ -12,7 +12,7 @@
|
|||||||
# immutable variables {
|
# immutable variables {
|
||||||
|
|
||||||
readonly DIST="ArchLabs" # Linux distributor
|
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 LIVE="liveuser" # Live session user
|
||||||
readonly MNT="/mnt/install" # Install mountpoint
|
readonly MNT="/mnt/install" # Install mountpoint
|
||||||
readonly ERR="/tmp/errlog" # Built-in error log
|
readonly ERR="/tmp/errlog" # Built-in error log
|
||||||
@ -126,7 +126,7 @@ init_variables() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
source_file() {
|
source_file() {
|
||||||
source $1 2>/dev/null && return 0
|
. $1 2>/dev/null && return 0
|
||||||
echo -e "\nFailed to source library file $1"
|
echo -e "\nFailed to source library file $1"
|
||||||
die 1
|
die 1
|
||||||
}
|
}
|
||||||
@ -265,10 +265,6 @@ setup_timezone() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
window_manager() {
|
window_manager() {
|
||||||
LOGIN_WM=""
|
|
||||||
LOGIN_TYPE=""
|
|
||||||
WM_PACKAGES=""
|
|
||||||
|
|
||||||
INSTALL_WMS="$(dialog --cr-wrap --stdout --backtitle "$BT" --no-cancel \
|
INSTALL_WMS="$(dialog --cr-wrap --stdout --backtitle "$BT" --no-cancel \
|
||||||
--title " $_WMChoice " --checklist "$_WMChoiceBody\n" 0 0 0 \
|
--title " $_WMChoice " --checklist "$_WMChoiceBody\n" 0 0 0 \
|
||||||
"openbox" "A lightweight, powerful, and highly configurable stacking window manager" off \
|
"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 \
|
"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 \
|
"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)"
|
"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")
|
WM_NUM=$(awk '{print NF}' <<< "$INSTALL_WMS")
|
||||||
|
|
||||||
# packages needed for the selected window manager
|
# packages needed for the selected window manager
|
||||||
for wm in $INSTALL_WMS; do
|
for wm in $INSTALL_WMS; do
|
||||||
WM_LOGIN_CHOICES="${WM_LOGIN_CHOICES}$wm - "
|
LOGIN_CHOICES="${LOGIN_CHOICES}$wm - "
|
||||||
case $wm in
|
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" ;;
|
bspwm) WM_PACKAGES="$WM_PACKAGES $wm sxhkd" ;;
|
||||||
i3-gaps) WM_PACKAGES="$WM_PACKAGES $wm i3status perl-anyevent-i3" ;;
|
i3-gaps) WM_PACKAGES="$WM_PACKAGES $wm i3status perl-anyevent-i3" ;;
|
||||||
gnome) WM_PACKAGES="$WM_PACKAGES $wm gnome-extra" ;;
|
gnome) WM_PACKAGES="$WM_PACKAGES $wm gnome-extra" ;;
|
||||||
@ -296,41 +290,38 @@ window_manager() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [[ $INSTALL_WMS =~ (openbox|bspwm|i3-gaps) ]]; then
|
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
|
elif [[ $INSTALL_WMS =~ (xfce4) ]]; then
|
||||||
WM_PACKAGES="$WM_PACKAGES archlabs-oblogout archlabs-screenlock"
|
WM_PACKAGES="$WM_PACKAGES archlabs-oblogout archlabs-screenlock"
|
||||||
fi
|
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
|
if yesno "$_WMLogin" "$_LoginTypeBody\n" "xinit" "lightdm"; then
|
||||||
LOGIN_TYPE='xinit'
|
LOGIN_TYPE='xinit'
|
||||||
FILES[11]="/home/$NEWUSER/.xinitrc"
|
FILES[11]="/home/$NEWUSER/.xinitrc"
|
||||||
else
|
else
|
||||||
LOGIN_TYPE='lightdm'
|
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"
|
FILES[11]="/etc/lightdm/lightdm.conf $MNT/etc/lightdm/lightdm-gtk-greeter.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
EXTRA_PACKAGES="$WM_PACKAGES"
|
||||||
|
|
||||||
yesno "$_WMLogin" "$_AutoLoginBody\n" && AUTOLOGIN=true || AUTOLOGIN=false
|
yesno "$_WMLogin" "$_AutoLoginBody\n" && AUTOLOGIN=true || AUTOLOGIN=false
|
||||||
|
|
||||||
if [[ $WM_NUM -eq 1 ]]; then
|
if [[ $WM_NUM -eq 1 ]]; then
|
||||||
LOGIN_WM="$INSTALL_WMS"
|
LOGIN_WM="$INSTALL_WMS"
|
||||||
else
|
else
|
||||||
LOGIN_WM="$(dialog --cr-wrap --stdout --no-cancel --backtitle "$BT" \
|
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")"
|
[[ $LOGIN_WM == "" ]] && LOGIN_WM="$(awk '{print $1}' <<< "$INSTALL_WMS")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $LOGIN_WM in
|
case $LOGIN_WM in
|
||||||
i3-gaps) LOGIN_WM='i3' ;;
|
i3-gaps) LOGIN_WM='i3' ;;
|
||||||
gnome) LOGIN_WM='gnome-session' ;;
|
gnome) LOGIN_WM='gnome-session' ;;
|
||||||
cinnamon) LOGIN_WM='cinnamon-session' ;;
|
cinnamon) LOGIN_WM='cinnamon-session' ;;
|
||||||
openbox) LOGIN_WM='openbox-session' ;;
|
openbox) LOGIN_WM='openbox-session' ;;
|
||||||
xfce4) LOGIN_WM='startxfce4' ;;
|
xfce4) LOGIN_WM='startxfce4' ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
@ -181,13 +181,6 @@ EOF
|
|||||||
install_bootloader() {
|
install_bootloader() {
|
||||||
chroot_cmd "export PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/bin/core_perl"
|
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 not on an LVM we can use the UUID for booting
|
||||||
if ! [[ $ROOT_PART =~ /dev/mapper ]]; then
|
if ! [[ $ROOT_PART =~ /dev/mapper ]]; then
|
||||||
ROOT_PART_ID="UUID=$(blkid -s PARTUUID $ROOT_PART | sed 's/.*=//g; s/"//g')"
|
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
|
# needed for os-prober module to work properly in the chroot
|
||||||
mkdir -p $MNT/run/udev && mount --bind /run/udev $MNT/run/udev
|
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
|
if [[ $SYS == 'UEFI' ]]; then
|
||||||
# make sure efivarfs has been mounted
|
# make sure efivarfs has been mounted
|
||||||
@ -214,6 +207,12 @@ install_bootloader() {
|
|||||||
-type d -exec rm -rf '{}' \; >/dev/null 2>&1
|
-type d -exec rm -rf '{}' \; >/dev/null 2>&1
|
||||||
fi
|
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]}
|
# sets up the bootloader config(s) and ${BCMDS[$BOOTLDR]}
|
||||||
prep_for_$BOOTLDR "$ucode"
|
prep_for_$BOOTLDR "$ucode"
|
||||||
|
|
||||||
|
@ -14,10 +14,7 @@ install_main() {
|
|||||||
check_for_errors "genfstab -U $MNT > $MNT/etc/fstab"
|
check_for_errors "genfstab -U $MNT > $MNT/etc/fstab"
|
||||||
|
|
||||||
# touch up fstab if we used a swapfile
|
# touch up fstab if we used a swapfile
|
||||||
if [[ -f $MNT/swapfile ]]; then
|
[[ -f $MNT/swapfile ]] && sed -i "s~${MNT}~~" $MNT/etc/fstab
|
||||||
sed -i "s~${MNT}~~" $MNT/etc/fstab 2>$ERR
|
|
||||||
check_for_errors "sed -i s~${MNT}~~ $MNT/etc/fstab"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# update the mirrorlist, if this isn't done before updating or it may be slow
|
# update the mirrorlist, if this isn't done before updating or it may be slow
|
||||||
local cmdtail="--verbose --save $MNT/etc/pacman.d/mirrorlist"
|
local cmdtail="--verbose --save $MNT/etc/pacman.d/mirrorlist"
|
||||||
@ -41,7 +38,7 @@ install_main() {
|
|||||||
install_base() {
|
install_base() {
|
||||||
clear
|
clear
|
||||||
tput cnorm
|
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/
|
rsync -ah --info=progress2 /run/archiso/sfs/airootfs/ $MNT/
|
||||||
|
|
||||||
# remove archiso init files and clean up install files
|
# 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/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
|
sed -i "s/en_US.UTF-8/${LOCALE}/g" $MNT/etc/locale.conf
|
||||||
cp -f $MNT/etc/locale.conf $MNT/etc/default/locale
|
cp -f $MNT/etc/locale.conf $MNT/etc/default/locale
|
||||||
chroot_cmd "locale-gen" 2>$ERR
|
chroot_cmd "locale-gen" 2>/dev/null
|
||||||
chroot_cmd "ln -sf /usr/share/zoneinfo/$ZONE/$SUBZONE /etc/localtime" 2>$ERR
|
chroot_cmd "ln -sf /usr/share/zoneinfo/$ZONE/$SUBZONE /etc/localtime" 2>/dev/null
|
||||||
|
|
||||||
# setup xorg vsync config for intel graphics
|
# setup xorg vsync config for intel graphics
|
||||||
if [[ $(lspci | grep ' VGA ' | grep 'Intel') != "" ]]; then
|
if [[ $(lspci | grep ' VGA ' | grep 'Intel') != "" ]]; then
|
||||||
@ -211,10 +208,6 @@ update_system() {
|
|||||||
rmpkg="$rmpkg $vbx virtualbox-guest-utils"
|
rmpkg="$rmpkg $vbx virtualbox-guest-utils"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $INSTALL_WMS == 'dwm' ]]; then
|
|
||||||
inpkg="$inpkg xorg-server"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# for gnome and cinnamon we don't need the xfce provided stuff
|
# for gnome and cinnamon we don't need the xfce provided stuff
|
||||||
if [[ $INSTALL_WMS == 'gnome' || $INSTALL_WMS == 'cinnamon' ]]; then
|
if [[ $INSTALL_WMS == 'gnome' || $INSTALL_WMS == 'cinnamon' ]]; then
|
||||||
rmpkg="$(pacman -Qssq 'xfce4*' 2>/dev/null)"
|
rmpkg="$(pacman -Qssq 'xfce4*' 2>/dev/null)"
|
||||||
@ -233,6 +226,12 @@ update_system() {
|
|||||||
|
|
||||||
chroot_cmd "$update; $network; $install; $remove"
|
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
|
if [[ $INSTALL_WMS =~ dwm ]]; then
|
||||||
mkdir -pv $MNT/home/$LIVE/suckless
|
mkdir -pv $MNT/home/$LIVE/suckless
|
||||||
for prog in dwm st dmenu; do
|
for prog in dwm st dmenu; do
|
||||||
|
Reference in New Issue
Block a user