Rework Part 1

This commit is contained in:
2025-03-13 12:39:54 +01:00
parent 8c454d6076
commit df8bfc3e75
8 changed files with 924 additions and 202 deletions

View File

@@ -3,19 +3,6 @@
# global var
DISTRO=""
export NEWT_COLORS="
root=,green
window=,black
shadow=,green
border=green,black
title=green,black
textbox=green,black
radiolist=black,black
label=black,green
checkbox=black,green
compactbutton=black,green
button=black,red"
function getDistributionType() {
echo "Detecting distribution..."
if [[ -e /etc/debian_version ]]; then
@@ -44,7 +31,7 @@ function checkWhiptail() {
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in newt -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed --noconfirm newt
sudo pacman -S --needed --noconfirm libnewt
fi
fi
echo "Whiptail installed."
@@ -338,11 +325,11 @@ function setupU2F() {
sudo pacman -S --needed yubico-pam yubikey-full-disk-encryption yubikey-manager-qt yubikey-personalization yubikey-personalization-gui yubikey-touch-detector yubioath-desktop --noconfirm
fi
mkdir ~/.config/Yubico
pamu2fcfg -o pam://$HOSTNAME -i pam://$HOSTNAME > ~/.config/Yubico/u2f_keys
pamu2fcfg -o pam://$HOST -i pam://$HOST > ~/.config/Yubico/u2f_keys
sudo touch /etc/pam.d/u2f-required
sudo touch /etc/pam.d/u2f-sufficient
echo -e "#%PAM-1.0\nauth required pam_u2f.so cue origin=pam://$HOSTNAME appid=pam://$HOSTNAME" | sudo tee /etc/pam.d/u2f-required
echo -e "#%PAM-1.0\nauth sufficient pam_u2f.so cue origin=pam://$HOSTNAME appid=pam://$HOSTNAME" | sudo tee /etc/pam.d/u2f-sufficient
echo -e "#%PAM-1.0\nauth required pam_u2f.so cue origin=pam://$HOST appid=pam://$HOST" | sudo tee /etc/pam.d/u2f-required
echo -e "#%PAM-1.0\nauth sufficient pam_u2f.so cue origin=pam://$HOST appid=pam://$HOST" | sudo tee /etc/pam.d/u2f-sufficient
fi
}
@@ -416,112 +403,6 @@ function installSoftware() {
fi
}
function setupDesktopEnvironment() {
DE=$(whiptail --title "Desktop Environment" --menu "Choose a desktop environment" 15 60 8 \
"1" "GNOME" \
"2" "KDE" \
"3" "XFCE" \
"4" "Cinnamon" \
"5" "MATE" \
"6" "Budgie" \
"7" "Sway" \
"8" "Hyprland" 3>&1 1>&2 2>&3)
case $DE in
1) installGNOME ;;
2) installKDE ;;
3) installXFCE ;;
4) installCinnamon ;;
5) installMATE ;;
6) installBudgie ;;
7) installSway ;;
8) installHyprland ;;
esac
}
function installGNOME() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install gnome-shell task-gnome-desktop gnome-tweaks gnome-extensions gnome-software-plugin-flatpak -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf group install gnome-desktop -y
sudo dnf in gnome-tweaks gnome-extensions -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed gnome gnome-tweaks gnome-extensions gnome-packagekit --noconfirm
fi
}
function installKDE() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install kde-standard kdeconnect plasma-discover-backend-flatpak -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf group install kde-desktop -y
sudo dnf in kde-connect -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed plasma plasma-meta kdeconnect packagekit-qt6 plymouth-kcm flatpak-kcm sddm-kcm --noconfirm
fi
}
function installXFCE() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install xfce4 xfce4-goodies -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in @xfce-desktop-environment -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed xfce4 xfce4-goodies --noconfirm
fi
}
function installCinnamon() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install task-cinnamon-desktop -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in @cinnamon-desktop-environment -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed cinnamon --noconfirm
fi
}
function installMATE() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install mate-desktop-environment -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in @mate-desktop-environment -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed mate mate-extra --noconfirm
fi
}
function installBudgie() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install --install-suggests budgie-desktop -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf group install budgie-desktop budgie-desktop-apps -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed budgie budgie-desktop --noconfirm
fi
}
function installSway() {
echo "Warning: Experimental Script."
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install sway swaybg swayidle swaylock waybar xdg-desktop-portal-wlr xwayland -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in sway-desktop-environment sway swaybg swayidle swaylock waybar -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed sway swaybg swayidle swaylock waybar --noconfirm
fi
}
function installHyprland() {
echo "Warning: Experimental Script."
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install hyprland -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in hyprland -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed hyprland --noconfirm
fi
}
function setupDomainMember() {
echo "Warning: Experimental Script."
if (whiptail --title "Samba" --yesno "Should we install Samba?" 8 78); then