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,29 +122,34 @@ 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 ! [[ -d /usr.zram ]]; then
echo -e "\033[1mStep 1/5:\033[0m Move /usr to /usr.zram ..."
_zram_usr "${_ZRAM_SIZE}"
if [[ -e "/.graphic_run" ]]; then
echo -e "\033[1m\033[91mError: Graphical environment already installed ...\033[0m"
else
echo -e "\033[1mStep 1/5:\033[0m Move /usr to /usr.zram already done ..."
if ! [[ -d /usr.zram ]]; then
echo -e "\033[1mStep 1/5:\033[0m Move /usr to /usr.zram ..."
_zram_usr "${_ZRAM_SIZE}"
else
echo -e "\033[1mStep 1/5:\033[0m Move /usr to /usr.zram already done ..."
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
[[ "${_L_KDE}" == "1" ]] && _install_kde
[[ "${_L_KDE_WAYLAND}" == "1" ]] && _install_kde_wayland
echo -e "\033[1mStep 5/5:\033[0m Starting avahi-daemon ..."
systemctl start avahi-daemon.service
# only start vnc on xorg environment
[[ "${_L_XFCE}" == "1" || "${_L_KDE}" == "1" || "${_L_GNOME}" == "1" ]] && _autostart_vnc
_chromium_flags
[[ "${_L_XFCE}" == "1" ]] && _start_xfce
[[ "${_L_GNOME}" == "1" ]] && _start_gnome
[[ "${_L_GNOME_WAYLAND}" == "1" ]] && _start_gnome_wayland
[[ "${_L_KDE}" == "1" ]] && _start_kde
[[ "${_L_KDE_WAYLAND}" == "1" ]] && _start_kde_wayland
fi
echo -e "\033[1mStep 2/5:\033[0m Waiting for gpg pacman keyring import to finish ..."
_gpg_check
[[ "${_L_XFCE}" == "1" ]] && _install_xfce
[[ "${_L_GNOME}" == "1" ]] && _install_gnome
[[ "${_L_GNOME_WAYLAND}" == "1" ]] && _install_gnome_wayland
[[ "${_L_KDE}" == "1" ]] && _install_kde
[[ "${_L_KDE_WAYLAND}" == "1" ]] && _install_kde_wayland
echo -e "\033[1mStep 5/5:\033[0m Starting avahi-daemon ..."
systemctl start avahi-daemon.service
# only start vnc on xorg environment
[[ "${_L_XFCE}" == "1" || "${_L_KDE}" == "1" || "${_L_GNOME}" == "1" ]] && _autostart_vnc
_chromium_flags
[[ "${_L_XFCE}" == "1" ]] && _start_xfce
[[ "${_L_GNOME}" == "1" ]] && _start_gnome
[[ "${_L_GNOME_WAYLAND}" == "1" ]] && _start_gnome_wayland
[[ "${_L_KDE}" == "1" ]] && _start_kde
[[ "${_L_KDE_WAYLAND}" == "1" ]] && _start_kde_wayland
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
_graphic_options
echo -e " \033[1m-launch-xfce\033[0m Launch XFCE desktop with VNC sharing enabled."
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