defunctionilize

This commit is contained in:
Tobias Powalowski 2023-08-04 08:04:27 +02:00
parent 33a346b9e3
commit 6ff73d3cd8
3 changed files with 43 additions and 20 deletions

View file

@ -71,9 +71,26 @@ if [[ -n "${_L_XFCE}" || -n "${_L_SWAY}" || -n "${_L_PLASMA}" || -n "${_L_GNOME}
if [[ -e "/.graphic_installed" && "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 4413000 ]]; then
_hint_graphic_installed
else
_TITLE="Archboot $(uname -m) | Basic Setup | Desktop Environment"
[[ -e /var/cache/pacman/pkg/archboot.db ]] && touch /.graphic_installed
[[ -n "${_L_XFCE}" ]] && _install_xfce | _dialog --title "${_MENU_TITLE}" --gauge "Initializing Xfce..." 6 75 0
[[ -n "${_L_GNOME}" ]] && _install_gnome
[[ -n "${_L_GNOME_WAYLAND}" ]] && _install_gnome_wayland
[[ -n "${_L_PLASMA}" ]] && _install_plasma
[[ -n "${_L_PLASMA_WAYLAND}" ]] && _install_plasma_wayland
[[ -n "${_L_SWAY}" ]] && _install_sway
# only start vnc on xorg environment
_progress "93" "Setting up VNC and browser..."
[[ -n "${_L_XFCE}" || -n "${_L_PLASMA}" || -n "${_L_GNOME}" ]] && _autostart_vnc
command -v firefox &>"${_NO_LOG}" && _firefox_flags
command -v chromium &>"${_NO_LOG}" && _chromium_flags
[[ -n "${_L_XFCE}" ]] && _start_xfce | _dialog --title "${_MENU_TITLE}" --gauge "Starting Xfce..." 6 75 94
[[ -n "${_L_GNOME}" ]] && _start_gnome
[[ -n "${_L_GNOME_WAYLAND}" ]] && _start_gnome_wayland
[[ -n "${_L_PLASMA}" ]] && _start_plasma
[[ -n "${_L_PLASMA_WAYLAND}" ]] && _start_plasma_wayland
[[ -n "${_L_SWAY}" ]] && _start_sway
touch /.update
_TITLE="Archboot $(uname -m) | Basic Setup | New Images"
_install_graphic | _dialog --title "${_MENU_TITLE}" --gauge "Initializing desktop environment..." 6 75 0
fi
fi
# Switch to full Arch Linux system

View file

@ -66,6 +66,8 @@ _dialog() {
return $?
}
# $1: percentage
# $2: message
_progress() {
cat <<EOF
XXX
@ -75,6 +77,28 @@ XXX
EOF
}
# $1: start percentage
# $2: end percentage
# $3: message
# $4: sleep time
_progress_wait() {
_COUNT=${1}
while [[ -e "${_W_DIR}/.archboot" ]]; do
if [[ "${_COUNT}" -lt "${2}" ]]; then
_progress "${_COUNT}" "${3}"
fi
if [[ "${_COUNT}" -gt "${2}" ]]; then
_progress "${2}" "${3}"
fi
# abort after 15 minutes
if [[ "${_COUNT}" -gt 150 ]]; then
exit 1
fi
_COUNT="$((_COUNT+1))"
sleep "${4}"
done
}
_kver() {
# this is intentionally very loose. only ensure that we're
# dealing with some sort of string that starts with something

View file

@ -130,24 +130,6 @@ _create_initramfs() {
rm "${_W_DIR}"/.archboot
}
_progress_wait() {
_COUNT=${1}
while [[ -e "${_W_DIR}/.archboot" ]]; do
if [[ "${_COUNT}" -lt "${2}" ]]; then
_progress "${_COUNT}" "${3}"
fi
if [[ "${_COUNT}" -gt "${2}" ]]; then
_progress "${2}" "${3}"
fi
# abort after 15 minutes
if [[ "${_COUNT}" -gt 150 ]]; then
exit 1
fi
_COUNT="$((_COUNT+1))"
sleep "${4}"
done
}
_download_latest() {
# Download latest setup and quickinst script from git repository
[[ -d "${_INST}" ]] || mkdir "${_INST}"