simplify and add it to other DEs too

This commit is contained in:
Tobias Powalowski 2023-08-04 11:54:42 +02:00
parent bfff186dad
commit c64e54a635
8 changed files with 41 additions and 42 deletions

View file

@ -73,26 +73,25 @@ if [[ -n "${_L_XFCE}" || -n "${_L_SWAY}" || -n "${_L_PLASMA}" || -n "${_L_GNOME}
else
touch /.update
_TITLE="Archboot $(uname -m) | Basic Setup | Desktop Environment"
_PROGRESSBAR="_dialog --title "${_MENU_TITLE}" --gauge "Initializing ${_ENVIRONMENT}..." 6 75 0"
[[ -e /var/cache/pacman/pkg/archboot.db ]] && touch /.graphic_installed
if [[ -n "${_L_XFCE}" ]]; then
_ENVIRONMENT="Xfce"
_install_xfce | ${_PROGRESSBAR}
_ENVIRONMENT="XFCE"
_install_xfce | _dialog --title "${_MENU_TITLE}" --gauge "Initializing ${_ENVIRONMENT}..." 6 75 0
elif [[ -n "${_L_GNOME}" ]]; then
_ENVIRONMENT="Gnome"
_install_gnome | ${_PROGRESSBAR}
_ENVIRONMENT="GNOME"
_install_gnome | _dialog --title "${_MENU_TITLE}" --gauge "Initializing ${_ENVIRONMENT}..." 6 75 0
elif [[ -n "${_L_GNOME_WAYLAND}" ]]; then
_ENVIRONMENT="Gnome Wayland"
_install_gnome_wayland | ${_PROGRESSBAR}
_ENVIRONMENT="GNOME Wayland"
_install_gnome_wayland | _dialog --title "${_MENU_TITLE}" --gauge "Initializing ${_ENVIRONMENT}..." 6 75 0
elif [[ -n "${_L_PLASMA}" ]];then
_ENVIRONMENT="Plasma/KDE"
_install_plasma | ${_PROGRESSBAR}
_install_plasma | _dialog --title "${_MENU_TITLE}" --gauge "Initializing ${_ENVIRONMENT}..." 6 75 0
elif [[ -n "${_L_PLASMA_WAYLAND}" ]]; then
_ENVIRONMENT="Plasma/KDE Wayland"
_install_plasma_wayland | ${_PROGRESSBAR}
_install_plasma_wayland | _dialog --title "${_MENU_TITLE}" --gauge "Initializing ${_ENVIRONMENT}..." 6 75 0
elif [[ -n "${_L_SWAY}" ]]; then
_ENVIRONMENT="Sway"
_install_sway | ${_PROGRESSBAR}
_install_sway | _dialog --title "${_MENU_TITLE}" --gauge "Initializing ${_ENVIRONMENT}..." 6 75 0
fi
# only start vnc on xorg environment
echo "Setting up VNC and browser..." >"${_LOG}"
@ -100,16 +99,30 @@ if [[ -n "${_L_XFCE}" || -n "${_L_SWAY}" || -n "${_L_PLASMA}" || -n "${_L_GNOME}
command -v firefox &>"${_NO_LOG}" && _firefox_flags
command -v chromium &>"${_NO_LOG}" && _chromium_flags
if [[ -n "${_L_XFCE}" ]]; then
_start_xfce | _dialog --title "${_MENU_TITLE}" --gauge "Starting Xfce..." 6 75 94
_start_xfce | _dialog --title "${_MENU_TITLE}" --gauge "Starting ${_ENVIRONMENT}..." 6 75 99
clear
echo -e "To relaunch \e[1mXFCE\e[m desktop use: \e[92mstartxfce4\e[m"
elif [[ -n "${_L_GNOME}" ]]; then
_start_gnome
clear
echo -e "To relaunch \e[1mGNOME\e[m desktop use: \e[92mstartx\e[m"
elif [[ -n "${_L_GNOME_WAYLAND}" ]]; then
_start_gnome_wayland
clear
echo -e "To relaunch \e[1mGNOME Wayland\e[m use: \e[92mgnome-wayland\e[m"
elif [[ -n "${_L_PLASMA}" ]]; then
_start_plasma
clear
elif [[ -n "${_L_PLASMA_WAYLAND}" ]]; then
_start_plasma_wayland
clear
echo -e "To relaunch \e[1mKDE/Plasma Wayland\e[m use: \e[92mplasma-wayland\e[m"
elif [[ -n "${_L_SWAY}" ]]; then
_start_sway
clear
echo -e "To relaunch \e[1mSway\e[m use: \e[92msway-wayland\e[m"
fi
rm /.update
[[ -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
fi
fi
# Switch to full Arch Linux system

View file

@ -87,7 +87,7 @@ _prepare_graphic() {
done
touch /.archboot
_install_graphic &
_progress_wait "${_COUNT}" "98" "Installing ${_ENVIRONMENT}..." "1"
_progress_wait "${_COUNT}" "97" "Installing ${_ENVIRONMENT}..." "1"
if [[ ! -e "/.full_system" ]]; then
echo "Removing not used icons..." >"${_LOG}"
rm -rf /usr/share/icons/breeze-dark
@ -100,7 +100,7 @@ _prepare_graphic() {
! -path '*/sv/*' ! -path '*/uk/*' -delete &>"${_NO_LOG}"
find /usr/share/i18n/charmaps ! -name 'UTF-8.gz' -delete &>"${_NO_LOG}"
fi
_progress "99" "Restart dbus..."
_progress "98" "Restart dbus..."
systemd-sysusers >"${_LOG}" 2>&1
systemd-tmpfiles --create >"${_LOG}" 2>&1
# fixing dbus requirements
@ -116,10 +116,7 @@ _hint_graphic_installed () {
_prepare_gnome() {
if ! [[ -e /usr/bin/gnome-session ]]; then
echo -e "\e[1mStep 1/3:\e[m Installing GNOME desktop now..."
echo " This will need some time..."
_prepare_graphic "${_PACKAGES}" >"${_LOG}" 2>&1
echo -e "\e[1mStep 2/3:\e[m Configuring GNOME desktop..."
_prepare_graphic "${_PACKAGES}"
_configure_gnome >"${_LOG}" 2>&1
else
echo -e "\e[1mStep 1/3:\e[m Installing GNOME desktop already done..."
@ -129,10 +126,7 @@ _prepare_gnome() {
_prepare_plasma() {
if ! [[ -e /usr/bin/startplasma-x11 ]]; then
echo -e "\e[1mStep 1/3:\e[m Installing KDE/Plasma desktop now..."
echo " This will need some time..."
_prepare_graphic "${_PACKAGES}" >"${_LOG}" 2>&1
echo -e "\e[1mStep 2/3:\e[m Configuring KDE/Plasma desktop..."
_prepare_graphic "${_PACKAGES}"
_configure_plasma >"${_LOG}" 2>&1
else
echo -e "\e[1mStep 1/3:\e[m Installing KDE/Plasma desktop already done..."
@ -142,10 +136,7 @@ _prepare_plasma() {
_prepare_sway() {
if ! [[ -e /usr/bin/sway ]]; then
echo -e "\e[1mStep 1/3:\e[m Installing Sway desktop now..."
echo " This will need some time..."
_prepare_graphic "${_PACKAGES}" >"${_LOG}" 2>&1
echo -e "\e[1mStep 2/3:\e[m Configuring Sway desktop..."
_configure_sway >"${_LOG}" 2>&1
else
echo -e "\e[1mStep 1/3:\e[m Installing Sway desktop already done..."

View file

@ -7,9 +7,8 @@ _install_gnome_wayland() {
}
_start_gnome_wayland() {
echo -e "Launching \e[1mGNOME Wayland\e[m now, logging is done on \e[1m/dev/tty7\e[m..."
echo -e "To relaunch \e[1mGNOME Wayland\e[m use: \e[92mgnome-wayland\e[m"
_progress "100" "Launching GNOME Wayland now, logging is done on /dev/tty8..."
sleep 2
echo "MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec dbus-run-session gnome-session >/dev/tty7 2>&1" > /usr/bin/gnome-wayland
chmod 755 /usr/bin/gnome-wayland
gnome-wayland

View file

@ -7,12 +7,12 @@ _install_gnome() {
}
_start_gnome() {
echo -e "Launching \e[1mGNOME\e[m now, logging is done on \e[1m/dev/tty8\e[m..."
_progress "100" "Launching GNOME now, logging is done on /dev/tty8..."
sleep 2
echo "export XDG_SESSION_TYPE=x11" > /root/.xinitrc
#shellcheck disable=SC2129
echo "export GDK_BACKEND=x11" >> /root/.xinitrc
echo "exec dbus-launch gnome-session" >> /root/.xinitrc
startx >/dev/tty8 2>&1
echo -e "To relaunch \e[1mGNOME\e[m desktop use: \e[92mstartx\e[m"
}
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -7,8 +7,8 @@ _install_plasma_wayland() {
}
_start_plasma_wayland() {
echo -e "Launching \e[1mKDE/Plasma Wayland\e[m now, logging is done on \e[1m/dev/tty7\e[m..."
echo -e "To relaunch \e[1mKDE/Plasma Wayland\e[m use: \e[92mplasma-wayland\e[m"
_progress "100" "Launching Plasma/KDE Wayland now, logging is done on /dev/tty8..."
sleep 2
echo "MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec dbus-run-session startplasma-wayland >/dev/tty7 2>&1" > /usr/bin/plasma-wayland
chmod 755 /usr/bin/plasma-wayland
plasma-wayland

View file

@ -7,10 +7,10 @@ _install_plasma() {
}
_start_plasma() {
echo -e "Launching \e[1mKDE/Plasma\e[m now, logging is done on \e[1m/dev/tty8\e[m..."
_progress "100" "Launching Plasma/KDE now, logging is done on /dev/tty8..."
sleep 2
echo "export DESKTOP_SESSION=plasma" > /root/.xinitrc
echo "exec startplasma-x11" >> /root/.xinitrc
startx >/dev/tty8 2>&1
echo -e "To relaunch \e[1mKDE/Plasma\e[m desktop use: \e[92mstartx\e[m"
}
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -7,8 +7,6 @@ _install_sway() {
}
_start_sway() {
echo -e "Launching \e[1mSway\e[m now, logging is done on \e[1m/dev/tty7\e[m..."
echo -e "To relaunch \e[1mSway\e[m use: \e[92msway-wayland\e[m"
echo "MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland \
XKB_DEFAULT_LAYOUT=$(grep 'KEYMAP' /etc/vconsole.conf | cut -d '=' -f2 | sed -e 's#-.*##g') \
exec dbus-run-session sway >/dev/tty7 2>&1" > /usr/bin/sway-wayland

View file

@ -3,9 +3,7 @@
# created by Tobias Powalowski <tpowa@archlinux.org>
_install_xfce() {
if ! [[ -e /usr/bin/startxfce4 ]]; then
echo "Installing XFCE desktop now..." >"${_LOG}"
_prepare_graphic "${_XORG_PACKAGE} ${_VNC_PACKAGE} ${_STANDARD_PACKAGES} ${_STANDARD_BROWSER} ${_XFCE_PACKAGES}"
echo "Configuring XFCE desktop..." >"${_LOG}"
_configure_xfce >"${_LOG}" 2>&1
else
echo -e "\e[1mStep 1/3:\e[m Installing XFCE desktop already done..."