Flawedspirit

Ironforge Setup Script

May 13th, 2026 (edited)
5,911
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.88 KB | Software | 0 0
  1. #!/bin/sh
  2. RESET='\E[0m'
  3. RED='\E[38;5;196m'
  4. YELLOW='\E[38;5;221m'
  5. GREEN='\E[38;5;34m'
  6. BLUE='\E[38;5;33m'
  7.  
  8. SUDO_CMD=""
  9.  
  10. command_exists() {
  11.     command -v "$1" &> /dev/null
  12. }
  13.  
  14. checkEnv() {
  15.     # Make sure this is not being run as root
  16.     # It messes up file copying since the user home will be /root
  17.     if [ "$(id -u)" -eq 0 ]; then
  18.         echo -e "${RED}Please do not run this script as root. Superuser access will be requested when it is needed.${RESET}" 1>&2
  19.         exit 1
  20.     fi
  21.  
  22.     # Check how we can escalate privileges
  23.     if command_exists sudo; then
  24.         SUDO_CMD="sudo"
  25.     else
  26.         echo -e "${RED}Unable to perform privilege escalation. Check that your user has permission to act as superuser.${RESET}" 1>&2
  27.         exit 3
  28.     fi
  29.     echo -e "Using ${BLUE}$SUDO_CMD${RESET} to do privilege escalation.\n"
  30.  
  31.     # Install basic requirements
  32.     $SUDO_CMD pacman -Sy
  33.     $SUDO_CMD pacman -S curl git
  34. }
  35.  
  36. installPackages() {
  37.     echo ""
  38.     echo -e "${BLUE}##################################################${RESET}"
  39.     echo -e "${BLUE}# Installing packages.                           #${RESET}"
  40.     echo -e "${BLUE}##################################################${RESET}"
  41.     echo ""
  42.     echo -e "${BLUE}>> Performing full update.${RESET}"
  43.     $SUDO_CMD pacman -Syu
  44.  
  45.     echo -e "${BLUE}>> Installing packages.${RESET}"
  46.     $SUDO_CMD pacman -S --needed \
  47.     # DEVELOPMENT
  48.     hugo python-pip vscodium \
  49.     # GAMING
  50.     protonup-qt \
  51.     # GENERAL UTILITIES
  52.     7zip atuin deja-dup filezilla flatpak iperf3 kde-pim kamoso kcharselect kfind net-tools onlyoffice-bin \
  53.     openrgb skanpage stow tmux trash-cli tree unace vulkan-radeon wl-clipboard wxwidgets-gtk3 yubikey-manager \
  54.     # INTERNET
  55.     brave-bin mailspring \
  56.     # MULTIMEDIA
  57.     audacity audacity-docs kid3 krecorder obs-studio okular optipng shotcut vlc yt-dlp \
  58.     # VIRTUAL MACHINES
  59.     dnsmasq docker docker-buildx docker-compose firewalld freerdp libvirt qemu-full
  60.  
  61.     echo -e "${BLUE}>> Installing AUR packages.${RESET}"
  62.     paru -S --needed harmonoid-bin input-remapper-git p7zip-gui vesktop woeusb-ng
  63.  
  64.     echo -e "${BLUE}>> Installing Flatpak packages.${RESET}"
  65.     flatpak install --noninteractive com.github.tchx84.Flatseal \
  66.     org.kde.krita \
  67.     org.openmw.OpenMW \
  68.     org.prismlauncher.PrismLauncher \
  69.     io.ente.auth \
  70.     io.github.limo_app.limo \
  71.     it.mijorus.gearlever \
  72.     at.vintagestory.VintageStory
  73. }
  74.  
  75. installBinaries() {
  76.     echo ""
  77.     echo -e "${BLUE}##################################################${RESET}"
  78.     echo -e "${BLUE}# Installing non-packaged binaries.              #${RESET}"
  79.     echo -e "${BLUE}##################################################${RESET}"
  80.     echo ""
  81.  
  82.     if [ ! -d "$HOME/.bin" ]; then
  83.         echo -e "${YELLOW}/home/$USER/.bin does not exist! Creating .bin directory in home folder.${RESET}"
  84.         mkdir "$HOME/.bin"
  85.  
  86.         if command_exists fish_add_path; then
  87.             fish_add_path -p "/home/$USER/.bin"
  88.         fi
  89.     fi
  90.  
  91.     CWD="$(pwd)"
  92.     cd /tmp
  93.  
  94.     echo -e "${BLUE}>> Espanso${RESET}"
  95.     # Espanso
  96.     git clone https://github.com/espanso/espanso
  97.     cd espanso
  98.     cargo build -p espanso --release --no-default-features --features modulo,vendored-tls,wayland
  99.     mv /tmp/espanso/target/release/espanso "$HOME/.bin/espanso"
  100.  
  101.     $SUDO_CMD setcap "cap_dac_override+p" "$HOME/.bin/espanso"
  102.  
  103.     $HOME/bin/espanso service register
  104.     $HOME/bin/espanso start
  105.  
  106.     cd /tmp
  107.  
  108.     echo -e "${BLUE}>> Rustup${RESET}"
  109.     curl -fsSL curl https://sh.rustup.rs | sh
  110.     . "$HOME/.cargo/env"
  111.  
  112.     echo -e "${BLUE}>> Starship${RESET}"
  113.     curl -sS https://starship.rs/install.sh | sh
  114.  
  115.     echo -e "${BLUE}>> Rustique${RESET}"
  116.     # Rustique
  117.     curl -fsSLO "https://github.com/Tekunogosu/Rustique/releases/latest/download/rustique-linux-x86_64.zip"
  118.     unzip /tmp/rustique-linux-x86_64.zip
  119.     mv /tmp/rustique "$HOME/.bin/rustique"
  120.     chmod a+x "$HOME/.bin/rustique"
  121.     rm /tmp/rustique-linux-x86_64.zip
  122.  
  123.     cd "$CWD"
  124. }
  125.  
  126. postConfiguration() {
  127.     echo ""
  128.     echo -e "${BLUE}##################################################${RESET}"
  129.     echo -e "${BLUE}# Performing post-installation steps.            #${RESET}"
  130.     echo -e "${BLUE}##################################################${RESET}"
  131.     echo ""
  132.     echo -en "${BLUE}>> Enabling daemons... ${RESET}"
  133.     $SUDO_CMD systemctl enable --now docker.service
  134.     $SUDO_CMD systemctl enable --now input-remapper
  135.     $SUDO_CMD systemctl enable --now libvirtd.service
  136.     $SUDO_CMD systemctl enable --now pcscd.service
  137.  
  138.     if [ $? -eq 0 ]; then
  139.         echo -e "${GREEN}Done!${RESET}"
  140.     fi
  141.  
  142.     echo ""
  143.     echo -en "${BLUE}>> Setting default Vulkan driver... ${RESET}"
  144.     $SUDO_CMD mkdir -p /etc/environment.d
  145.     echo "AMD_VULKAN_ICD=RADV" | $SUDO_CMD tee /etc/environment.d/90-vulkan.conf > /dev/null
  146.  
  147.     if [ $? -eq 0 ]; then
  148.         echo -e "${GREEN}Done! A system reboot is recommended.${RESET}"
  149.     fi
  150.  
  151.     echo ""
  152.     echo -en "${BLUE}>> Configuring interface virbr0... ${RESET}"
  153.     $SUDO_CMD virsh net-define /etc/libvirt/qemu/networks/default.xml
  154.     $SUDO_CMD virsh net-start default
  155.     $SUDO_CMD virsh net-autostart default
  156.    
  157.     if [ $? -eq 0 ]; then
  158.         echo -e "${GREEN}Done!${RESET}"
  159.     fi
  160.  
  161.     echo ""
  162.     echo -e "${BLUE}>> Copying files... ${RESET}"
  163.     $SUDO_CMD cp base/.face.icon /usr/share/sddm/$USER.face.icon
  164.  
  165.     echo ""
  166.     echo -e "${BLUE}>> Configuring user... ${RESET}"
  167.     $SUDO_CMD groupadd docker
  168.     $SUDO_CMD usermod -aG docker $USER
  169. }
  170.  
  171. reboot_opt() {
  172.     local choice
  173.    
  174.     while true; do
  175.         read -p "A system reboot is recommended. Reboot now? [y/N]: " choice
  176.         case $choice in
  177.             [Yy]* ) return 0;;
  178.             [Nn]* ) return 1;;
  179.             "" ) return 1;;
  180.         esac
  181.     done
  182. }
  183.  
  184. checkEnv
  185. installPackages
  186. installBinaries
  187. postConfiguration
  188.  
  189. echo ""
  190. if reboot_opt; then
  191.     $SUDO_CMD systemctl reboot
  192. else
  193.     echo "Finished!"
  194. fi
  195.  
Advertisement