Make dwm install into a function to save space
This commit is contained in:
parent
5f48915a32
commit
2e730506e0
@ -5,7 +5,7 @@
|
|||||||
# Some ideas and code reworked from other resources
|
# Some ideas and code reworked from other resources
|
||||||
# AIF, Cnichi, Calamares, Arch Wiki.. Credit where credit is due
|
# AIF, Cnichi, Calamares, Arch Wiki.. Credit where credit is due
|
||||||
|
|
||||||
VER=2.0.80
|
VER=2.0.81
|
||||||
|
|
||||||
# bulk default values {
|
# bulk default values {
|
||||||
|
|
||||||
@ -1334,6 +1334,8 @@ install_boot()
|
|||||||
|
|
||||||
install_user()
|
install_user()
|
||||||
{
|
{
|
||||||
|
local groups='audio,floppy,log,network,rfkill,scanner,storage,optical,power,wheel'
|
||||||
|
|
||||||
rm -f $MNT/root/.zshrc # remove welcome message from root zshrc
|
rm -f $MNT/root/.zshrc # remove welcome message from root zshrc
|
||||||
|
|
||||||
chrun "chpasswd <<< 'root:$ROOT_PASS'" 2>$ERR
|
chrun "chpasswd <<< 'root:$ROOT_PASS'" 2>$ERR
|
||||||
@ -1342,28 +1344,22 @@ install_user()
|
|||||||
chrun "usermod -s /bin/$MYSHELL root" 2>$ERR
|
chrun "usermod -s /bin/$MYSHELL root" 2>$ERR
|
||||||
errshow 1 "usermod -s /bin/$MYSHELL root"
|
errshow 1 "usermod -s /bin/$MYSHELL root"
|
||||||
# copy the default mkshrc to /root if it was selected
|
# copy the default mkshrc to /root if it was selected
|
||||||
[[ $MYSHELL == 'mksh' ]] && cp -fv $MNT/etc/skel/.mkshrc $MNT/root/.mkshrc
|
[[ $MYSHELL == 'mksh' ]] && cp -fv "$MNT/etc/skel/.mkshrc" "$MNT/root/.mkshrc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Creating new user $NEWUSER and setting password"
|
echo "Creating new user $NEWUSER and setting password"
|
||||||
local groups='audio,floppy,log,network,rfkill,scanner,storage,optical,power,wheel'
|
|
||||||
|
|
||||||
chrun "useradd -m -u 1000 -g users -G $groups -s /bin/$MYSHELL $NEWUSER" 2>$ERR
|
chrun "useradd -m -u 1000 -g users -G $groups -s /bin/$MYSHELL $NEWUSER" 2>$ERR
|
||||||
errshow 1 "useradd -m -u 1000 -g users -G $groups -s /bin/$MYSHELL $NEWUSER"
|
errshow 1 "useradd -m -u 1000 -g users -G $groups -s /bin/$MYSHELL $NEWUSER"
|
||||||
chrun "chpasswd <<< '$NEWUSER:$USER_PASS'" 2>$ERR
|
chrun "chpasswd <<< '$NEWUSER:$USER_PASS'" 2>$ERR
|
||||||
errshow 1 "set $NEWUSER password"
|
errshow 1 "set $NEWUSER password"
|
||||||
|
|
||||||
if [[ $INSTALL_WMS == *dwm* ]];then
|
if [[ $INSTALL_WMS == *dwm* ]];then
|
||||||
mkdir -pv "$MNT/home/$NEWUSER/suckless"
|
install_suckless "/home/$NEWUSER" chroot
|
||||||
for i in dwm dmenu st; do
|
[[ $INSTALL_WMS == 'dwm' ]] && rm -rf "$MNT/home/$NEWUSER/.config/xfce4"
|
||||||
if chrun "git clone https://git.suckless.org/$i /home/$NEWUSER/suckless/$i"; then
|
|
||||||
chrun "cd /home/$NEWUSER/suckless/$i; make prefix=/usr install; make clean"
|
|
||||||
else
|
|
||||||
printf "failed to clone %s repo\n" "$i"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[[ $INSTALL_WMS != *bspwm* && $INSTALL_WMS != *openbox* ]] && rm -rf "$MNT/home/$NEWUSER/.config/"{jgmenu,tint2}
|
||||||
|
[[ $USER_PKGS != *geany* ]] && rm -rf "$MNT/home/$NEWUSER/.config/geany"
|
||||||
[[ $MYSHELL != 'bash' ]] && rm -rf "$MNT/home/$NEWUSER/.bash"*
|
[[ $MYSHELL != 'bash' ]] && rm -rf "$MNT/home/$NEWUSER/.bash"*
|
||||||
[[ $MYSHELL != 'zsh' ]] && rm -rf "$MNT/home/$NEWUSER/.z"*
|
[[ $MYSHELL != 'zsh' ]] && rm -rf "$MNT/home/$NEWUSER/.z"*
|
||||||
|
|
||||||
@ -1519,6 +1515,32 @@ install_background()
|
|||||||
trap "kill $BG_PID 2>/dev/null" EXIT
|
trap "kill $BG_PID 2>/dev/null" EXIT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_suckless()
|
||||||
|
{
|
||||||
|
local dir="$1/suckless"
|
||||||
|
shift
|
||||||
|
|
||||||
|
if [[ $2 == 'chroot' ]]; then
|
||||||
|
chrun "mkdir -pv '$dir'"
|
||||||
|
for i in dwm dmenu st; do
|
||||||
|
if chrun "git clone 'https://git.suckless.org/$i' '$dir/$i'"; then
|
||||||
|
chrun "cd '$dir/$i' && make PREFIX=/usr install"
|
||||||
|
else
|
||||||
|
printf "failed to clone %s repo\n" "$i"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
mkdir -pv "$dir"
|
||||||
|
for i in dwm dmenu st; do
|
||||||
|
if git clone "https://git.suckless.org/$i" "$dir/$i"; then
|
||||||
|
cd "$dir/$i" && make PREFIX=/usr install
|
||||||
|
else
|
||||||
|
printf "failed to clone %s repo\n" "$i"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# display manager config
|
# display manager config
|
||||||
# these are called based on which DM is chosen after it is installed
|
# these are called based on which DM is chosen after it is installed
|
||||||
@ -2164,10 +2186,7 @@ live()
|
|||||||
case "$ses" in
|
case "$ses" in
|
||||||
dwm)
|
dwm)
|
||||||
pacman -S git --needed --noconfirm || die 1
|
pacman -S git --needed --noconfirm || die 1
|
||||||
mkdir -pv /root/suckless
|
install_suckless "/root" nochroot
|
||||||
for i in dwm dmenu st; do
|
|
||||||
git clone https://git.suckless.org/$i /root/suckless/$i && cd /root/suckless/$i && make PREFIX=/usr install
|
|
||||||
done
|
|
||||||
;;
|
;;
|
||||||
i3-gaps|oepnbox|fluxbox|bspwm|awesome)
|
i3-gaps|oepnbox|fluxbox|bspwm|awesome)
|
||||||
pacman -S "$ses" $WM_BASE_PKGS ${WM_EXT[$ses]} xterm --needed --noconfirm || die 1
|
pacman -S "$ses" $WM_BASE_PKGS ${WM_EXT[$ses]} xterm --needed --noconfirm || die 1
|
||||||
@ -2447,7 +2466,6 @@ elif ! net_connect; then
|
|||||||
msg "Not Connected" "\nThis installer requires an active internet connection.\n\nExiting..\n" 2
|
msg "Not Connected" "\nThis installer requires an active internet connection.\n\nExiting..\n" 2
|
||||||
die 1
|
die 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FORMATTED=""
|
FORMATTED=""
|
||||||
|
|
||||||
while :; do
|
while :; do
|
||||||
|
Reference in New Issue
Block a user