Setup improvement and fixes

- Added more user interaction in setup-linux
- Added GPU setup
- Added warnings
- Fixed nvidia on setup-distrobox
- Better support of both fedora and fedora rawhide (repo)
This commit is contained in:
2023-08-26 01:12:08 +02:00
parent 5fe727e462
commit 9088b88826
3 changed files with 236 additions and 133 deletions

View File

@@ -1,7 +1,7 @@
# Linux scripts # Linux scripts
These a my personal scripts to automate stuff related to linux/unix environment. These are my personal scripts to automate stuff related to linux/unix environment.
## Documentation ## Documentation
@@ -14,19 +14,15 @@ Includes general tools, browser, everyday apps, gaming related apps, virtualizat
### setup-distrobox.sh ### setup-distrobox.sh
Install preconfigured arch, debian and fedora containers for development Install preconfigured arch, debian and fedora containers for development.
## Roadmap ## Roadmap
- Add desktop/server/minimal setup to setup-linux.sh - Add desktop/server/minimal setup to setup-linux.sh
- Add more interactions to setup-linux.sh
- Add Desktop (gnome/kde/xfce/lxqt...) setup script - Add Desktop (gnome/kde/xfce/lxqt...) setup script
- Add GPU driver setup
- Add Jetbrain setup - Add Jetbrain setup
@@ -41,9 +37,8 @@ Open a pull request and we'll discuss on integration of your script or fixes.
#### What are these scripts for? #### What are these scripts for?
Automating task on most *NIX environment such as desktop or server setup Automating task (mostly setup) on most *NIX environment such as desktop or server setup
#### I found an issue what should I do? #### I found an issue what should I do?
Open an issue with all needed informations so we can fix it or pull request if you found how to fix it. Open an issue with all needed informations so we can fix it or pull request if you found how to fix it.

View File

@@ -1,25 +1,60 @@
#!/bin/bash #!/bin/bash
if (whiptail --title "Container" --yesno "Should we install all containers?" 8 78); then if (whiptail --title "Distrobox" --yesno "Should we install Distrobox and Podman?" 8 78); then
echo No | distrobox rm arch --force if [[ $DISTRO =~ (debian|ubuntu) ]]; then
distrobox-create --yes --name arch \ sudo apt install distrobox podman -y
--image docker.io/library/archlinux:latest --init --pull --nvidia \ elif [[ $DISTRO == "fedora" ]]; then
--home /home/"$USER"/distrobox/arch \ sudo dnf in distrobox podman -y
--pre-init-hooks "pacman -Sy --needed sudo git zsh base-devel nano wget curl unzip --noconfirm" \ elif [[ $DISTRO == "arch" ]]; then
--init-hooks "curl -sSL https://blackarch.org/strap.sh | sudo bash && sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com && sudo pacman-key --lsign-key 3056513887B78AEB && sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' --noconfirm && echo -e '[chaotic-aur]' | sudo tee -a /etc/pacman.conf && echo -e 'Include = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf && sudo pacman -Sy --needed fastfetch yay --noconfirm" \ sudo pacman -S --needed distrobox podman --noconfirm
--additional-packages "systemd" fi
if (whiptail --title "Container" --yesno "Should we install all containers?" 8 78); then
echo No | distrobox rm debian --force echo No | distrobox rm arch --force
distrobox-create --yes --name debian \ if lspci | grep -i nvidia &>/dev/null; then
--image docker.io/library/debian:testing --init --pull --nvidia \ distrobox-create --yes --name arch \
--home /home/"$USER"/distrobox/debian \ --image docker.io/library/archlinux:latest --init --pull --nvidia \
--init-hooks "sudo apt update && sudo apt upgrade -y && wget -O ~/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/download/1.12.2/fastfetch-1.12.2-Linux.deb && sudo dpkg -i ~/fastfetch.deb && rm -f ~/fastfetch.deb" \ --home /home/"$USER"/distrobox/arch \
--additional-packages "sudo systemd git zsh iproute2 nano wget curl unzip" --pre-init-hooks "pacman -Sy --needed base-devel sudo git zsh nano wget curl unzip --noconfirm" \
--init-hooks "curl -sSL https://blackarch.org/strap.sh | sudo bash && sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com && sudo pacman-key --lsign-key 3056513887B78AEB && sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' --noconfirm && echo -e '[chaotic-aur]' | sudo tee -a /etc/pacman.conf && echo -e 'Include = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf && sudo pacman -Sy --needed fastfetch yay --noconfirm" \
--additional-packages "systemd"
else
distrobox-create --yes --name arch \
--image docker.io/library/archlinux:latest --init --pull \
--home /home/"$USER"/distrobox/arch \
--pre-init-hooks "pacman -Sy --needed base-devel sudo git zsh nano wget curl unzip --noconfirm" \
--init-hooks "curl -sSL https://blackarch.org/strap.sh | sudo bash && sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com && sudo pacman-key --lsign-key 3056513887B78AEB && sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' --noconfirm && echo -e '[chaotic-aur]' | sudo tee -a /etc/pacman.conf && echo -e 'Include = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf && sudo pacman -Sy --needed fastfetch yay --noconfirm" \
--additional-packages "systemd"
fi
echo No | distrobox rm fedora-rawhide --force echo No | distrobox rm debian --force
distrobox-create --yes --name fedora-rawhide \ if lspci | grep -i nvidia &>/dev/null; then
--image registry.fedoraproject.org/fedora:rawhide --init --pull --nvidia \ distrobox-create --yes --name debian \
--home /home/"$USER"/distrobox/fedora-rawhide \ --image docker.io/library/debian:testing --init --pull --nvidia \
--init-hooks "sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y" \ --home /home/"$USER"/distrobox/debian \
--additional-packages "sudo systemd git zsh fastfetch nano wget curl unzip" --init-hooks "sudo apt update && sudo apt upgrade -y && wget -O ~/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/download/1.12.2/fastfetch-1.12.2-Linux.deb && sudo dpkg -i ~/fastfetch.deb && rm -f ~/fastfetch.deb" \
--additional-packages "sudo systemd git zsh iproute2 nano wget curl unzip"
else
distrobox-create --yes --name debian \
--image docker.io/library/debian:testing --init --pull \
--home /home/"$USER"/distrobox/debian \
--init-hooks "sudo apt update && sudo apt upgrade -y && wget -O ~/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/download/1.12.2/fastfetch-1.12.2-Linux.deb && sudo dpkg -i ~/fastfetch.deb && rm -f ~/fastfetch.deb" \
--additional-packages "sudo systemd git zsh iproute2 nano wget curl unzip"
fi
echo No | distrobox rm fedora-rawhide --force
if lspci | grep -i nvidia &>/dev/null; then
distrobox-create --yes --name fedora-rawhide \
--image registry.fedoraproject.org/fedora:rawhide --init --pull --nvidia \
--home /home/"$USER"/distrobox/fedora-rawhide \
--init-hooks "sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y" \
--additional-packages "sudo systemd git zsh fastfetch nano wget curl unzip"
else
distrobox-create --yes --name fedora-rawhide \
--image registry.fedoraproject.org/fedora:rawhide --init --pull \
--home /home/"$USER"/distrobox/fedora-rawhide \
--init-hooks "sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y" \
--additional-packages "sudo systemd git zsh fastfetch nano wget curl unzip"
fi
fi
fi fi

View File

@@ -36,20 +36,20 @@ function update_system() {
fi fi
} }
function install_general_tools() { function install_general_tools_software() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install sudo nano git curl wget htop btop scrcpy vlc geary -y sudo apt install linux-headers-amd64 sudo nano git curl wget htop btop scrcpy vlc geary -y
elif [[ $DISTRO == "fedora" ]]; then elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in sudo nano git curl wget htop btop scrcpy vlc geary -y sudo dnf in kernel-devel sudo nano git curl wget htop btop scrcpy vlc geary -y
elif [[ $DISTRO == "arch" ]]; then elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed sudo nano git curl wget htop btop scrcpy vlc geary --noconfirm sudo pacman -S --needed linux-headers dkms base-devel sudo nano git curl wget htop btop scrcpy vlc geary --noconfirm
fi fi
} }
function setup_repo() { function setup_repo() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install ca-certificates software-properties-gtk -y sudo apt install ca-certificates software-properties-gtk -y
sudo curl https://repo.waydro.id | sudo bash sudo curl https://repo.waydro.id | sudo bash
sudo add-apt-repository ppa:o2sh/onefetch sudo add-apt-repository ppa:o2sh/onefetch
sudo add-apt-repository ppa:oguzhaninan/stacer sudo add-apt-repository ppa:oguzhaninan/stacer
sudo add-apt-repository ppa:serge-rider/dbeaver-ce sudo add-apt-repository ppa:serge-rider/dbeaver-ce
@@ -61,8 +61,15 @@ function setup_repo() {
sudo dnf copr enable atim/heroic-games-launcher -y sudo dnf copr enable atim/heroic-games-launcher -y
sudo dnf copr enable atim/starship -y sudo dnf copr enable atim/starship -y
sudo dnf copr enable zeno/scrcpy -y sudo dnf copr enable zeno/scrcpy -y
sudo dnf config-manager --add-repo "https://download.opensuse.org/repositories/hardware:razer/Fedora_$(rpm -E %fedora)/hardware:razer.repo" sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
sudo dnf config-manager --add-repo 'https://download.opensuse.org/repositories/home:/Maroxy:/AAT-Apps/Fedora_Rawhide/home:Maroxy:AAT-Apps.repo' VERSION=$(rpm -q --queryformat '%{VERSION}' fedora-release)
if [[ $VERSION =~ ^[0-9]+$ ]]; then
sudo dnf config-manager --add-repo "https://download.opensuse.org/repositories/hardware:razer/Fedora_$(rpm -E %fedora)/hardware:razer.repo"
sudo flatpak remote-add --if-not-exists launcher.moe https://gol.launcher.moe/gol.launcher.moe.flatpakrepo
else
sudo dnf config-manager --add-repo 'https://download.opensuse.org/repositories/hardware:razer/Fedora_Rawhide/hardware:razer.repo'
sudo dnf config-manager --add-repo 'https://download.opensuse.org/repositories/home:/Maroxy:/AAT-Apps/Fedora_Rawhide/home:Maroxy:AAT-Apps.repo'
fi
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
if [ ! -e /etc/yum.repos.d/vscode.repo ]; then if [ ! -e /etc/yum.repos.d/vscode.repo ]; then
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo' sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
@@ -85,33 +92,19 @@ function setup_repo() {
fi fi
} }
function install_browser() {
if (whiptail --title "System Update" --yesno "Should we install web browsers?" 8 78); then
echo "Installing browsers..."
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install firefox chromium torbrowser-launcher -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in firefox chromium tor torbrowser-launcher -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed firefox chromium tor tor-browser --noconfirm
fi
fi
}
function install_distro_specific_packages() { function install_distro_specific_packages() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install stacer qbittorrent -y sudo apt install stacer qbittorrent -y
elif [[ $DISTRO == "fedora" ]]; then elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in kernel-devel starship stacer qbittorrent -y sudo dnf in starship stacer qbittorrent -y
flatpak install flathub com.moonlight_stream.Moonlight -y --noninteractive --system sudo flatpak install flathub com.moonlight_stream.Moonlight -y --noninteractive --system
flatpak install flathub io.github.thaunknown.miru -y --noninteractive --system sudo flatpak install flathub io.github.thaunknown.miru -y --noninteractive --system
flatpak install flathub com.stremio.Stremio -y --noninteractive --system sudo flatpak install flathub com.stremio.Stremio -y --noninteractive --system
elif [[ $DISTRO == "arch" ]]; then elif [[ $DISTRO == "arch" ]]; then
# Base and utility packages # Base and utility packages
sudo pacman -S --needed --noconfirm linux-headers dkms base-devel jshon expac acpid avahi net-tools xdg-user-dirs p7zip unrar unzip unace xz rsync nfs-utils cifs-utils ntfs-3g exfat-utils gvfs udisks2 starship macchanger plymouth plymouth-kcm breeze-plymouth sudo pacman -S --needed --noconfirm jshon expac acpid avahi net-tools xdg-user-dirs p7zip unrar unzip unace xz rsync nfs-utils cifs-utils ntfs-3g exfat-utils gvfs udisks2 starship macchanger plymouth plymouth-kcm breeze-plymouth
# Hardware packages # Firmware/Drivers packages
sudo pacman -S --needed --noconfirm mkinitcpio-firmware mesa lib32-mesa vulkan-icd-loader lib32-vulkan-icd-loader xf86-video-amdgpu nvidia-utils lib32-nvidia-utils libvdpau lib32-libvdpau libva-mesa-driver lib32-libva-mesa-driver mesa-vdpau lib32-mesa-vdpau libva-vdpau-driver lib32-libva-vdpau-driver vulkan-radeon lib32-vulkan-radeon xf86-input-synaptics xf86-input-libinput xf86-input-evdev supergfxctl sudo pacman -S --needed --noconfirm mkinitcpio-firmware mesa lib32-mesa vulkan-icd-loader lib32-vulkan-icd-loader
# Printer # Printer
sudo pacman -S --needed --noconfirm system-config-printer foomatic-db foomatic-db-engine gutenprint gsfonts cups cups-pdf cups-filters sane skanlite hplip sudo pacman -S --needed --noconfirm system-config-printer foomatic-db foomatic-db-engine gutenprint gsfonts cups cups-pdf cups-filters sane skanlite hplip
# Network # Network
@@ -127,50 +120,6 @@ function install_distro_specific_packages() {
fi fi
} }
function install_gaming() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install steam gamescope gamemode mangohud lutris discord -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in steam gamescope gamemode mangohud lutris discord protonup-qt heroic-games-launcher-bin an-anime-game-launcher honkers-launcher the-honkers-railway-launcher -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed steam gamescope gamemode mangohud lutris discord protonup-qt heroic-games-launcher-bin an-anime-game-launcher-bin --noconfirm
yay -S --needed honkers-launcher-bin the-honkers-railway-launcher-bin --noconfirm
fi
}
function install_virt() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install qemu-system libvirt-daemon-system virt-manager distrobox podman waydroid -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in libvirt lxc libvirt-daemon-lxc virt-manager distrobox podman waydroid -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed libvirt libvirt-storage-gluster libvirt-storage-iscsi-direct virt-firmware virt-viewer virt-manager lxc lxcfs distrobox podman waydroid --noconfirm
fi
sudo systemctl enable libvirtd waydroid-container
}
function install_remote() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install remmina -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in remmina remmina-gnome-session remmina-plugins-exec remmina-plugins-rdp remmina-plugins-spice remmina-plugins-vnc remmina-plugins-www remmina-plugins-x2go parsec -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed remmina remmina-plugin-rustdesk remmina-plugin-teamviewer parsec-bin --noconfirm
fi
}
function install_u2f() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install yubikey-manager yubikey-personalization yubioath-desktop -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in fedora-packager-yubikey libyubikey pam_yubico yubico-piv-tool yubikey-manager yubikey-personalization-gui -y
flatpak install flathub com.yubico.yubioath -y --noninteractive --system
elif [[ $DISTRO == "arch" ]]; then
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
}
function install_fetch() { function install_fetch() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install fastfetch onefetch -y sudo apt install fastfetch onefetch -y
@@ -179,31 +128,81 @@ function install_fetch() {
elif [[ $DISTRO == "arch" ]]; then elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed fastfetch onefetch --noconfirm sudo pacman -S --needed fastfetch onefetch --noconfirm
fi fi
} if [ -e ~/.bashrc ]; then
if ! grep -q "fastfetch" ~/.bashrc; then
function install_terminal() { echo "fastfetch" >> ~/.bashrc
if [[ $DISTRO =~ (debian|ubuntu) ]]; then fi
sudo apt install alacritty kitty zsh -y fi
elif [[ $DISTRO == "fedora" ]]; then if [ -e ~/.zshrc ]; then
sudo dnf in alacritty kitty kitty-bash-integration zsh autojump-zsh zsh-autosuggestions zsh-syntax-highlighting -y if ! grep -q "fastfetch" ~/.zshrc; then
elif [[ $DISTRO == "arch" ]]; then echo "fastfetch" >> ~/.zshrc
sudo pacman -S --needed alacritty kitty kitty-shell-integration kitty-terminfo zsh zsh-autosuggestions zsh-completions zsh-history-substring-search zsh-lovers zsh-syntax-highlighting --noconfirm fi
sudo chsh -s /usr/bin/zsh "$USER"
fi fi
} }
function install_dev() { function install_browser() {
if [[ $DISTRO =~ (debian|ubuntu) ]]; then if (whiptail --title "Web Browser" --yesno "Should we install web browsers?" 8 78); then
sudo apt install mariadb-server dbeaver-ce -y echo "Installing browsers..."
elif [[ $DISTRO == "fedora" ]]; then if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo dnf in mariadb-server https://dbeaver.io/files/dbeaver-ce-latest-stable.x86_64.rpm code android-tools -y sudo apt install firefox chromium torbrowser-launcher -y
elif [[ $DISTRO == "arch" ]]; then elif [[ $DISTRO == "fedora" ]]; then
sudo pacman -S --needed mariadb dbeaver dbeaver-plugin-office dbeaver-plugin-svg-format dbeaver-plugin-apache-poi visual-studio-code-bin android-tools android-udev --noconfirm sudo dnf in firefox chromium tor torbrowser-launcher -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed firefox chromium tor tor-browser --noconfirm
fi
fi
}
function install_gaming() {
if (whiptail --title "Gaming" --yesno "Should we install game launchers and game optimization packages?" 8 78); then
echo "Installing gaming packages..."
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install steam gamescope gamemode mangohud lutris discord -y
elif [[ $DISTRO == "fedora" ]]; then
if [[ $VERSION =~ ^[0-9]+$ ]]; then
sudo dnf in steam gamescope gamemode mangohud lutris discord protonup-qt heroic-games-launcher-bin -y
sudo flatpak install launcher.moe moe.launcher.an-anime-game-launcher -y
sudo flatpak install launcher.moe moe.launcher.honkers-launcher -y
sudo flatpak install launcher.moe moe.launcher.the-honkers-railway-launcher -y
else
sudo dnf in steam gamescope gamemode mangohud lutris discord protonup-qt heroic-games-launcher-bin an-anime-game-launcher honkers-launcher the-honkers-railway-launcher -y
fi
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed steam gamescope gamemode mangohud lutris discord protonup-qt heroic-games-launcher-bin an-anime-game-launcher-bin --noconfirm
yay -S --needed honkers-launcher-bin the-honkers-railway-launcher-bin --noconfirm
fi
fi
}
function install_virt() {
if (whiptail --title "Virtualization" --yesno "Should we install KVM and containers packages?" 8 78); then
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install qemu-system libvirt-daemon-system virt-manager distrobox podman waydroid -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in libvirt lxc libvirt-daemon-lxc virt-manager distrobox podman waydroid -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed libvirt libvirt-storage-gluster libvirt-storage-iscsi-direct virt-firmware virt-viewer virt-manager lxc lxcfs distrobox podman waydroid --noconfirm
fi
sudo systemctl enable libvirtd waydroid-container
fi
}
function install_u2f() {
if (whiptail --title "U2F" --yesno "Should we install U2F packages?" 8 78); then
echo "Installing U2F support..."
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install yubikey-manager yubikey-personalization yubioath-desktop -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in fedora-packager-yubikey libyubikey pam_yubico yubico-piv-tool yubikey-manager yubikey-personalization-gui -y
sudo flatpak install flathub com.yubico.yubioath -y --noninteractive --system
elif [[ $DISTRO == "arch" ]]; then
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
fi fi
} }
function install_openrazer() { function install_openrazer() {
if (whiptail --title "System Update" --yesno "Should we install web browsers?" 8 78); then if (whiptail --title "OpenRazer" --yesno "Should we install OpenRazer?" 8 78); then
if [[ $DISTRO =~ (debian|ubuntu) ]]; then if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install openrazer-meta -y sudo apt install openrazer-meta -y
elif [[ $DISTRO == "fedora" ]]; then elif [[ $DISTRO == "fedora" ]]; then
@@ -217,17 +216,91 @@ function install_openrazer() {
fi fi
} }
get_distribution function install_terminal() {
update_system if (whiptail --title "Terminal/shell" --yesno "Should we install terminal and shell packages?" 8 78); then
install_general_tools if [[ $DISTRO =~ (debian|ubuntu) ]]; then
setup_repo sudo apt install alacritty kitty zsh -y
install_browser elif [[ $DISTRO == "fedora" ]]; then
install_distro_specific_packages sudo dnf in alacritty kitty kitty-bash-integration zsh autojump-zsh zsh-autosuggestions zsh-syntax-highlighting -y
install_gaming elif [[ $DISTRO == "arch" ]]; then
install_virt sudo pacman -S --needed alacritty kitty kitty-shell-integration kitty-terminfo zsh zsh-autosuggestions zsh-completions zsh-history-substring-search zsh-lovers zsh-syntax-highlighting --noconfirm
install_remote sudo chsh -s /usr/bin/zsh "$USER"
install_u2f fi
install_fetch fi
install_terminal }
install_dev
install_openrazer function install_dev() {
if (whiptail --title "Development" --yesno "Should we install development packages?" 8 78); then
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install mariadb-server dbeaver-ce remmina -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in mariadb-server https://dbeaver.io/files/dbeaver-ce-latest-stable.x86_64.rpm code android-tools remmina remmina-gnome-session remmina-plugins-exec remmina-plugins-rdp remmina-plugins-spice remmina-plugins-vnc remmina-plugins-www remmina-plugins-x2go -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed mariadb dbeaver dbeaver-plugin-office dbeaver-plugin-svg-format dbeaver-plugin-apache-poi visual-studio-code-bin android-tools android-udev remmina --noconfirm
fi
fi
}
function install_gpu_drivers() {
if (whiptail --title "GPU" --yesno "Should we install GPU drivers?" 8 78); then
# NVIDIA
if lspci | grep -i nvidia &>/dev/null; then
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install nvidia-driver firmware-misc-nonfree nvidia-vdpau-driver libnvcuvid1 libnvidia-encode1 nvidia-vaapi-driver -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in akmod-nvidia dkms-nvidia nvidia-driver xorg-x11-drv-nvidia-cuda nvidia-vaapi-driver mesa-vdpau-drivers ffmpeg libavcodec-freeworld -y
if [ -d "/sys/class/power_supply/BAT0" ]; then
sudo dnf in supergfxctl -y
fi
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed --noconfirm nvidia-open-dkms nvidia-settings nvidia-utils lib32-nvidia-utils libvdpau lib32-libvdpau
yay -S --needed --noconfirm libva-nvidia-driver
if [ -d "/sys/class/power_supply/BAT0" ]; then
sudo pacman -S --needed --noconfirm supergfxctl
fi
fi
fi
# AMD
if lspci | grep -Ei "vga|3d|display" | grep -i amd &>/dev/null; then
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install firmware-amd-graphics libgl1-mesa-dri libglx-mesa0 mesa-vulkan-drivers xserver-xorg-video-all mesa-va-drivers vdpau-driver-all -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in xorg-x11-drv-amdgpu mesa-vdpau-drivers mesa-va-drivers libavcodec-freeworld -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed --noconfirm xf86-video-amdgpu libva-mesa-driver lib32-libva-mesa-driver vulkan-radeon lib32-vulkan-radeon mesa-vdpau lib32-mesa-vdpau
fi
fi
# INTEL
if lspci | grep -Ei "vga|3d|display" | grep -i intel &>/dev/null; then
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install xserver-xorg-core intel-media-va-driver -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in xorg-x11-drv-intel intel-media-driver ffmpeg libavcodec-freeworld -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed --noconfirm intel-media-driver linux-firmware vulkan-intel
fi
fi
fi
}
echo -e "\e[1;31mWARNING: This script assumes a standard Debian/Fedora/Arch install.\e[0m"
read -p "Are you sure you want to continue? [N/y] " response
if [[ "$response" =~ ^[Yy]$ ]]; then
echo "Continuing..."
get_distribution
update_system
install_general_tools_software
setup_repo
install_distro_specific_packages
install_fetch
install_browser
install_gaming
install_virt
install_u2f
install_openrazer
install_terminal
install_dev
else
echo "Script execution aborted."
exit 1
fi