reorder update-installer options, allow only one graphical environment on local image

This commit is contained in:
Tobias Powalowski 2022-06-06 09:07:58 +02:00
parent e44b1a86e1
commit 2e58113234
2 changed files with 31 additions and 24 deletions

View file

@ -122,6 +122,9 @@ fi
# Gnome, KDE/PLASMA or XFCE launch
if [[ "${_L_XFCE}" == "1" || "${_L_KDE}" == "1" || "${_L_GNOME}" == "1" || "${_L_GNOME_WAYLAND}" == "1" || "${_L_KDE_WAYLAND}" == "1" ]]; then
if [[ -e "/.graphic_run" ]]; then
echo -e "\033[1m\033[91mError: Graphical environment already installed ...\033[0m"
else
if ! [[ -d /usr.zram ]]; then
echo -e "\033[1mStep 1/5:\033[0m Move /usr to /usr.zram ..."
_zram_usr "${_ZRAM_SIZE}"
@ -130,6 +133,7 @@ if [[ "${_L_XFCE}" == "1" || "${_L_KDE}" == "1" || "${_L_GNOME}" == "1" || "${_L
fi
echo -e "\033[1mStep 2/5:\033[0m Waiting for gpg pacman keyring import to finish ..."
_gpg_check
[[ -e /var/cache/pacman/pkg/archboot.db ]] && touch /.graphic_run
[[ "${_L_XFCE}" == "1" ]] && _install_xfce
[[ "${_L_GNOME}" == "1" ]] && _install_gnome
[[ "${_L_GNOME_WAYLAND}" == "1" ]] && _install_gnome_wayland
@ -145,6 +149,7 @@ if [[ "${_L_XFCE}" == "1" || "${_L_KDE}" == "1" || "${_L_GNOME}" == "1" || "${_L
[[ "${_L_GNOME_WAYLAND}" == "1" ]] && _start_gnome_wayland
[[ "${_L_KDE}" == "1" ]] && _start_kde
[[ "${_L_KDE_WAYLAND}" == "1" ]] && _start_kde_wayland
fi
fi

View file

@ -40,18 +40,20 @@ usage () {
# local image
if [[ -e "/var/cache/pacman/pkg/archboot.db" ]]; then
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 3860000 ]] ; then
if ! [[ -e "/.graphic_run" ]]; then
_graphic_options
echo -e " \033[1m-launch-xfce\033[0m Launch XFCE desktop with VNC sharing enabled."
fi
fi
else
# latest image
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 3400000 ]] ; then
_graphic_options
echo -e " \033[1m-custom-wayland\033[0m Install custom Wayland environment."
fi
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2500000 ]]; then
echo -e " \033[1m-launch-xfce\033[0m Launch XFCE desktop with VNC sharing enabled."
echo -e " \033[1m-custom-xorg\033[0m Install custom X environment."
[[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 3400000 ]] && echo -e " \033[1m-custom-wayland\033[0m Install custom Wayland environment."
echo ""
fi
fi