LinuxScripts/Installation/arch.sh

230 lines
6.3 KiB
Bash

#!/bin/bash
# -- Arch Linux Installer Script -- #
# Variables
HOME_SERVER="https://git.objnull.net/OBJNULL/LinuxScripts/raw/branch/main"
SYS_INSTALL='sudo pacman -Sy --noconfirm'
FLH_INSTALL='sudo flatpak install -y'
AUR_INSTALL='yay -S --noconfirm'
SYS_REMOVE='sudo pacman -Rns --noconfirm'
# Desktop Specific #
## Gnome ##
gnome_install() {
# Installing System Packages
$SYS_INSTALL gparted
$SYS_INSTALL fractal
$SYS_INSTALL cartridges
$SYS_INSTALL power-profiles-daemon
# Installing FLH Apps
$FLH_INSTALL flathub net.nokyan.Resources
$FLH_INSTALL flathub de.haeckerfelix.Fragments
$FLH_INSTALL flathub net.ankiweb.Anki
}
gnome_debloat() {
# Bloat Programs
$SYS_REMOVE gnome-music
$SYS_REMOVE gnome-system-monitor
}
gnome_system() {
# Custom UI settings
gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"
}
gnome_themes() {
# Setting the Console Prompt
CON_PROMPT='Press ENTER to continue'
# Installing Themes to Gnome
mkdir ~/.themes ~/.icons /tmp/theme /tmp/icons
echo "Please download the following theme (Default): https://www.pling.com/p/1357889?ref=itsfoss.com"; echo $CON_PROMPT; read
echo "Please download the following icons (Nord): https://www.pling.com/p/1279924?ref=itsfoss.com/"; echo $CON_PROMPT; read
cd ~/.themes; tar -xJf ~/Downloads/Orchis.tar.xz -C /tmp/theme; mv /tmp/theme/Orchis-Dark ./
cd ~/.icons; tar -xJf ~/Downloads/Tela-nord.tar.xz -C /tmp/icons; mv /tmp/icons/Tela-nord ./
rm -r ~/Downloads/Orchis.tar.xz ~/Downloads/Tela-nord.tar.xz /tmp/icons /tmp/theme
}
gnome() {
gnome_install
gnome_debloat
gnome_system
gnome_themes
}
## KDE Plasma ##
kde_install() {
# Installing System Packages
$SYS_INSTALL korganizer kaddressbook
$SYS_INSTALL kvantum
$SYS_INSTALL fish
$SYS_INSTALL element-desktop filezilla
}
kde_themes() {
echo "## KDE THEMING ##"
echo "Themes for KDE need to be installed manually. Please install all of the following:"
echo "Download OrchisDark from Pling and install it into Kvantum"
echo ""
echo "Colors: OrchisDark"
echo "Application Style: Kvantum-Dark"
echo "Plasma Style: Orchis-Dark"
echo "Window Decorations: Orchis-Dark (No Window Borders)"
echo "Icons: Kora"
echo "Cursors: Vimix Cursors"
}
kde() {
kde_install
kde_themes
}
## SWAY ##
sway_install() {
# Installing System Packages
$SYS_INSTALL alacritty rclone yazi rofi wl-clipboard btop pacman-contrib
$SYS_INSTALL galculator 7zip
$SYS_INSTALL gvim
$SYS_INSTALL filezilla
# System Packages
$AUR_INSTALL qimgv
}
sway_debloat() {
# Removing System Packages
$SYS_REMOVE foot
}
sway_system() {
# Copying the Sway Config File to somewhere Useful
mkdir -p ~/.config/sway
wget $HOME_SERVER/sway.conf -O ~/.config/sway/config
# Copying the Alacritty Config File to somewhere Useful
mkdir -p ~/.config/alacritty
wget $HOME_SERVER/alacritty.toml -O ~/.config/alacritty/alacritty.toml
# Copying the GTK Config File to somewhere Useful
mkdir -p ~/.config/gtk-3.0
wget $HOME_SERVER/gtk.ini -O ~/.config/gtk-3.0/settings.ini
# Copying the Rofi Config File to somewhere Useful
mkdir -p ~/.config/rofi
wget $HOME_SERVER/rofi.rasi -O ~/.config/rofi/config.rasi
# Adding variables to Path
echo "EDITOR=vim" | sudo tee -a /etc/environment
}
sway_themes() {
# Removing the old style
sudo rm /etc/xdg/waybar/config /etc/xdg/waybar/style.css
# Downloading the New Styles
sudo wget https://raw.githubusercontent.com/arkboix/sway/refs/heads/main/files/.config/waybar/config.jsonc -O /etc/xdg/waybar/config
sudo wget https://raw.githubusercontent.com/arkboix/sway/refs/heads/main/files/.config/waybar/style.css -O /etc/xdg/waybar/style.css
}
sway() {
sway_install
sway_debloat
sway_system
sway_themes
}
# Functions
install_yay() {
# Installing Git
$SYS_INSTALL git
# Installing YAY
cd /tmp && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg --noconfirm -si
}
install_pacman() {
# Base Deps
$SYS_INSTALL net-tools flatpak fish
$SYS_INSTALL sof-firmware fprintd
$SYS_INSTALL hunspell-en_us noto-fonts-emoji
# Virtualization
$SYS_INSTALL virt-manager qemu-desktop spice-vdagent swtpm
$SYS_INSTALL docker docker-buildx
$SYS_INSTALL wine
# Internet
$SYS_INSTALL resolvconf dnsutils dnsmasq
$SYS_INSTALL thunderbird wireshark-qt
# Utilities
$SYS_INSTALL libreoffice easytag
$SYS_INSTALL audacity
# Development
$SYS_INSTALL godot zed
# Entertainment
$SYS_INSTALL steam
$SYS_INSTALL prismlauncher
# Graphics
$SYS_INSTALL blender gimp inkscape
}
install_aur() {
# Base Dependencies
$AUR_INSTALL zen-browser-bin
# Internet
$AUR_INSTALL cinny-desktop-bin
# Virtualization
$AUR_INSTALL bottles
# Entertainment
$AUR_INSTALL flashpoint-launcher-bin
}
install_flat() {
# Engineering (OrcaSlicer)
wget https://github.com/SoftFever/OrcaSlicer/releases/download/v2.3.0/OrcaSlicer-Linux-flatpak_V2.3.0_x86_64.flatpak -O /tmp/orcaslicer.flatpak
$FLH_INSTALL /tmp/orcaslicer.flatpak
sudo flatpak override --env=__EGL_VENDOR_LIBRARY_FILENAMES=/usr/lib/x86_64-linux-gnu/GL/default/share/glvnd/egl_vendor.d/50_mesa.json io.github.softfever.OrcaSlicer
# Entertainment
$FLH_INSTALL flathub org.vinegarhq.Sober
$FLH_INSTALL flathub org.libretro.RetroArch
# Security
$FLH_INSTALL flathub com.bitwarden.desktop
}
setup_fprintd() {
sudo rm -f /etc/pam.d/system-auth
sudo wget $HOME_SERVER/Configs/fprintd.conf -O /etc/pam.d/system-auth
}
# Entry Point
main() {
# Installing Pre-Reqs
install_yay
## Desktop Specific Operations ##
if [ "$XDG_CURRENT_DESKTOP" == "Gnome" ]; then
gnome
elif [ "$XDG_CURRENT_DESKTOP" == "KDE" ]; then
kde
elif [ "$XDG_CURRENT_DESKTOP" == "sway:wlroots" ]; then
sway
fi
# Installing Software
install_pacman
install_aur
install_flat
setup_fprintd
# Enabling Daemons #
sudo systemctl enable --now libvirtd
sudo systemctl enable --now docker
sudo systemctl enable --now power-profiles-daemon
# Applying Permissions #
sudo usermod -aG docker $USER
sudo usermod -aG libvirt $USER
# Finish Statement #
echo "Installation Done! Have Fun!"
}
# System Process
main