diff --git a/README.md b/README.md index c3fb5b2..5081269 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # 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 @@ -14,19 +14,15 @@ Includes general tools, browser, everyday apps, gaming related apps, virtualizat ### setup-distrobox.sh -Install preconfigured arch, debian and fedora containers for development +Install preconfigured arch, debian and fedora containers for development. ## Roadmap - 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 GPU driver 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? -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? -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. \ No newline at end of file diff --git a/setup-distrobox.sh b/setup-distrobox.sh index c4ed164..b1a4de7 100644 --- a/setup-distrobox.sh +++ b/setup-distrobox.sh @@ -1,25 +1,60 @@ #!/bin/bash -if (whiptail --title "Container" --yesno "Should we install all containers?" 8 78); then - echo No | distrobox rm arch --force - distrobox-create --yes --name arch \ - --image docker.io/library/archlinux:latest --init --pull --nvidia \ - --home /home/"$USER"/distrobox/arch \ - --pre-init-hooks "pacman -Sy --needed sudo git zsh base-devel 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" +if (whiptail --title "Distrobox" --yesno "Should we install Distrobox and Podman?" 8 78); then + if [[ $DISTRO =~ (debian|ubuntu) ]]; then + sudo apt install distrobox podman -y + elif [[ $DISTRO == "fedora" ]]; then + sudo dnf in distrobox podman -y + elif [[ $DISTRO == "arch" ]]; then + sudo pacman -S --needed distrobox podman --noconfirm + fi + if (whiptail --title "Container" --yesno "Should we install all containers?" 8 78); then - echo No | distrobox rm debian --force - distrobox-create --yes --name debian \ - --image docker.io/library/debian:testing --init --pull --nvidia \ - --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" + echo No | distrobox rm arch --force + if lspci | grep -i nvidia &>/dev/null; then + distrobox-create --yes --name arch \ + --image docker.io/library/archlinux:latest --init --pull --nvidia \ + --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" + 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 - 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" + echo No | distrobox rm debian --force + if lspci | grep -i nvidia &>/dev/null; then + distrobox-create --yes --name debian \ + --image docker.io/library/debian:testing --init --pull --nvidia \ + --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" + 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 \ No newline at end of file diff --git a/setup-linux.sh b/setup-linux.sh index 8472e82..1dc5fc7 100755 --- a/setup-linux.sh +++ b/setup-linux.sh @@ -36,20 +36,20 @@ function update_system() { fi } -function install_general_tools() { +function install_general_tools_software() { 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 - 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 - 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 } function setup_repo() { if [[ $DISTRO =~ (debian|ubuntu) ]]; then 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:oguzhaninan/stacer 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/starship -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 dnf config-manager --add-repo 'https://download.opensuse.org/repositories/home:/Maroxy:/AAT-Apps/Fedora_Rawhide/home:Maroxy:AAT-Apps.repo' + sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo + 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 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' @@ -85,33 +92,19 @@ function setup_repo() { 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() { if [[ $DISTRO =~ (debian|ubuntu) ]]; then sudo apt install stacer qbittorrent -y elif [[ $DISTRO == "fedora" ]]; then - sudo dnf in kernel-devel starship stacer qbittorrent -y - flatpak install flathub com.moonlight_stream.Moonlight -y --noninteractive --system - flatpak install flathub io.github.thaunknown.miru -y --noninteractive --system - flatpak install flathub com.stremio.Stremio -y --noninteractive --system + sudo dnf in starship stacer qbittorrent -y + sudo flatpak install flathub com.moonlight_stream.Moonlight -y --noninteractive --system + sudo flatpak install flathub io.github.thaunknown.miru -y --noninteractive --system + sudo flatpak install flathub com.stremio.Stremio -y --noninteractive --system elif [[ $DISTRO == "arch" ]]; then # 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 - # Hardware 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 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 + # Firmware/Drivers packages + sudo pacman -S --needed --noconfirm mkinitcpio-firmware mesa lib32-mesa vulkan-icd-loader lib32-vulkan-icd-loader # Printer sudo pacman -S --needed --noconfirm system-config-printer foomatic-db foomatic-db-engine gutenprint gsfonts cups cups-pdf cups-filters sane skanlite hplip # Network @@ -127,50 +120,6 @@ function install_distro_specific_packages() { 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() { if [[ $DISTRO =~ (debian|ubuntu) ]]; then sudo apt install fastfetch onefetch -y @@ -179,31 +128,81 @@ function install_fetch() { elif [[ $DISTRO == "arch" ]]; then sudo pacman -S --needed fastfetch onefetch --noconfirm fi -} - -function install_terminal() { - if [[ $DISTRO =~ (debian|ubuntu) ]]; then - sudo apt install alacritty kitty zsh -y - elif [[ $DISTRO == "fedora" ]]; then - sudo dnf in alacritty kitty kitty-bash-integration zsh autojump-zsh zsh-autosuggestions zsh-syntax-highlighting -y - elif [[ $DISTRO == "arch" ]]; then - 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 - sudo chsh -s /usr/bin/zsh "$USER" + if [ -e ~/.bashrc ]; then + if ! grep -q "fastfetch" ~/.bashrc; then + echo "fastfetch" >> ~/.bashrc + fi + fi + if [ -e ~/.zshrc ]; then + if ! grep -q "fastfetch" ~/.zshrc; then + echo "fastfetch" >> ~/.zshrc + fi fi } -function install_dev() { - if [[ $DISTRO =~ (debian|ubuntu) ]]; then - sudo apt install mariadb-server dbeaver-ce -y - elif [[ $DISTRO == "fedora" ]]; then - sudo dnf in mariadb-server https://dbeaver.io/files/dbeaver-ce-latest-stable.x86_64.rpm code android-tools -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 --noconfirm +function install_browser() { + if (whiptail --title "Web Browser" --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_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 } 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 sudo apt install openrazer-meta -y elif [[ $DISTRO == "fedora" ]]; then @@ -217,17 +216,91 @@ function install_openrazer() { fi } -get_distribution -update_system -install_general_tools -setup_repo -install_browser -install_distro_specific_packages -install_gaming -install_virt -install_remote -install_u2f -install_fetch -install_terminal -install_dev -install_openrazer \ No newline at end of file +function install_terminal() { + if (whiptail --title "Terminal/shell" --yesno "Should we install terminal and shell packages?" 8 78); then + if [[ $DISTRO =~ (debian|ubuntu) ]]; then + sudo apt install alacritty kitty zsh -y + elif [[ $DISTRO == "fedora" ]]; then + sudo dnf in alacritty kitty kitty-bash-integration zsh autojump-zsh zsh-autosuggestions zsh-syntax-highlighting -y + elif [[ $DISTRO == "arch" ]]; then + 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 + sudo chsh -s /usr/bin/zsh "$USER" + fi + fi +} + +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 \ No newline at end of file