Files
Fedora-Script/Fedora-Installer-Script-new.sh
T
2025-08-04 16:12:10 -07:00

325 lines
13 KiB
Bash

#!/bin/bash
################################################################################
# #
# Fedora Post-Install Setup Script #
# #
################################################################################
# --- Function Declarations ---
# Option 1: Install Media Codecs
install_media_codecs() {
echo "----------------------------------------------------"
echo "Installing multimedia codecs..."
echo "----------------------------------------------------"
sleep 2
sudo dnf group install multimedia
echo "Multimedia codecs installation complete."
}
# Option 2: Modify DNF Configuration
modify_dnf() {
echo "----------------------------------------------------"
echo "Modifying /etc/dnf/dnf.conf for faster downloads."
echo "----------------------------------------------------"
sleep 2
# Text that will be added to the file
text_to_append="max_parallel_downloads=10
defaultyes=True
keepcache=True"
#File path
file_path="/etc/dnf/dnf.conf"
# Append the text to the end of the file
echo "$text_to_append" | sudo tee -a "$file_path"
echo "Modification has been completed"
}
# Option 3: Install Fonts
install_fonts() {
echo "----------------------------------------------------"
echo "Installing Microsoft Core Fonts and Meslo Nerd Font."
echo "----------------------------------------------------"
sleep 2
echo "Installing prerequisites..."
sudo dnf upgrade --refresh
sudo dnf install -y curl cabextract xorg-x11-font-utils fontconfig
echo "Installing Microsoft Core Fonts..."
sudo rpm -i https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
echo "Downloading and installing MesloLGS Nerd Font for Powerlevel10k..."
# Create a temporary directory to work in
mkdir -p ~/.tmp-fonts
cd ~/.tmp-fonts || exit
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf
sudo mkdir -p /usr/local/share/fonts/MesloLGS
sudo mv ./*.ttf /usr/local/share/fonts/MesloLGS/
# Clean up temporary directory
cd ~
rm -rf ~/.tmp-fonts
echo "Updating font cache..."
sudo fc-cache -fv
echo "Font installation complete."
}
# Option 4: Core System Setup
core_setup() {
echo "----------------------------------------------------"
echo "Performing core system setup."
echo "----------------------------------------------------"
sleep 2
sudo dnf groupupdate -y core
sudo dnf install -y "kernel-devel-$(uname -r)" rust-libudev-devel distrobox
#Not need at the moment
#echo "Adding Flathub remote for Flatpak..."
#sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
echo "Core setup complete."
echo "A restart or logout may be required for all changes to take effect."
}
# Option 5: Install Zsh and Oh My Zsh
install_zsh() {
echo "----------------------------------------------------"
echo "Installing Zsh and Oh My Zsh."
echo "Make sure you have installed the fonts from option 3."
echo "----------------------------------------------------"
sleep 5
echo "Installing zsh package..."
sudo dnf install -y zsh
echo "Installing Oh My Zsh. Please follow the prompts."
echo "The script will continue after Oh My Zsh is installed."
sleep 3
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
echo "Oh My Zsh installation finished."
echo "Please proceed with option 5.5 to install themes and plugins."
}
# Option 5.5: Setup Zsh Theme and Plugins
setup_zsh_themes() {
echo "----------------------------------------------------"
echo "Installing Zsh themes and plugins."
echo "----------------------------------------------------"
sleep 2
# Define ZSH_CUSTOM if it's not already set
ZSH_CUSTOM=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}
echo "Cloning Powerlevel10k theme..."
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM}/themes/powerlevel10k"
echo "Cloning plugins..."
git clone https://github.com/zsh-users/zsh-autosuggestions "${ZSH_CUSTOM}/plugins/zsh-autosuggestions"
git clone https://github.com/zsh-users/zsh-history-substring-search "${ZSH_CUSTOM}/plugins/zsh-history-substring-search"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "${ZSH_CUSTOM}/plugins/zsh-syntax-highlighting"
git clone https://github.com/MichaelAquilina/zsh-you-should-use.git "${ZSH_CUSTOM}/plugins/you-should-use"
echo "Copying .zshrc to home folder..."
cp .zshrc ~/.zshrc
echo ".zshrc copied successfully."
source ~/.zshrc
}
# Option 6: Add Extra Repos
add_repos() {
echo "----------------------------------------------------"
echo "Adding RPM Fusion repositories."
echo "----------------------------------------------------"
sleep 2
sudo dnf install -y \
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
echo "Repositories have been added."
}
# Option 7: Install WineHQ
install_wine() {
echo "----------------------------------------------------"
echo "Installing WineHQ Staging."
echo "----------------------------------------------------"
sleep 2
# Note: Fedora version is hardcoded to 39. Update if necessary.
sudo dnf config-manager --add-repo https://dl.winehq.org/wine-builds/fedora/39/winehq.repo
sudo dnf install -y winehq-staging --allowerasing
echo "Verifying Wine installation..."
wine --version
echo "WineHQ installation complete."
}
# Option 8: Install Software
install_software() {
echo "----------------------------------------------------"
echo "Installing most used software."
echo "----------------------------------------------------"
sleep 2
echo "--- Installing RPM Packages ---"
sudo dnf install -y gnome-tweaks steam lutris btop fastfetch jstest-gtk
echo "--- Installing Visual Studio Code ---"
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
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 dnf check-update
sudo dnf install -y code
echo "--- Installing Flatpak Packages ---"
flatpak install flathub -y com.discordapp.Discord
flatpak install flathub -y com.github.tchx84.Flatseal
flatpak install flathub -y net.nokyan.Resources
flatpak install flathub -y com.mattjakeman.ExtensionManager
flatpak install flathub -y io.github.realmazharhussain.GdmSettings
flatpak install flathub -y io.github.dvlv.boxbuddyrs
flatpak install flathub -y it.mijorus.gearlever
flatpak install flathub -y io.github.fastrizwaan.WineZGUI
flatpak install flathub -y com.vysp3r.ProtonPlus
flatpak install flathub -y io.missioncenter.MissionCenter
flatpak install flathub -y io.github.peazip.PeaZip
flatpak install flathub -y io.github.fastrizwaan.WineZGUI
flatpak install flathub -y app.devsuite.Ptyxis
flatpak install flathub -y re.sonny.Junction
flatpak install flathub -y com.github.rafostar.Clapper
flatpak install flathub -y io.github.flattool.Ignition
flatpak install flathub -y io.github.debasish_patra_1987.linuxthemestore
flatpak install flathub -y codes.merritt.Nyrna
flatpak install flathub -y page.tesk.Refine
flatpak install flathub -y io.gitlab.adhami3310.Converter
flatpak install flathub -y com.bitwarden.desktop
flatpak install flathub -y com.modrinth.ModrinthApp
flatpak install flathub -y com.usebottles.bottles
echo "Software installation complete."
}
# Option 9: Install Homebrew
install_brew() {
echo "----------------------------------------------------"
echo "Installing Homebrew."
echo "----------------------------------------------------"
sleep 2
echo "Installing prerequisites (Development Tools)..."
sudo dnf groupinstall -y 'Development Tools'
echo "Running Homebrew installation script..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "Homebrew installation script finished."
echo "Please follow the on-screen instructions to add Homebrew to your PATH."
}
# Option 10: Install CoolerControl
install_coolercontrol() {
echo "----------------------------------------------------"
echo "Installing CoolerControl."
echo "----------------------------------------------------"
sleep 2
sudo dnf install -y dnf-plugins-core
sudo dnf copr enable -y codifryed/CoolerControl
sudo dnf install -y coolercontrol
sudo systemctl enable --now coolercontrold
echo "CoolerControl installation and service activation complete."
}
# Option 11: Install Fish Shell
install_fish() {
echo "----------------------------------------------------"
echo "Installing Fish shell, Oh My Fish, and theme."
echo "----------------------------------------------------"
sleep 2
echo "Installing fish package..."
sudo dnf install -y fish
echo "Installing Oh My Fish..."
# Run the install script within a fish shell
fish -c "curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | source"
echo "Installing 'bobthefish' theme..."
fish -c "omf install bobthefish"
echo "Fish shell setup complete."
}
# Option 12: Run Chris Titus Linux Script
run_titus_script() {
echo "----------------------------------------------------"
echo "Running the Chris Titus Tech Linux Utility Script."
echo "----------------------------------------------------"
sleep 2
curl -fsSL https://christitus.com/linux | sh
}
# --- Main Menu and Script Logic ---
main_menu() {
while true; do
clear
echo "========================================================"
echo " Fedora Post-Install Setup Script"
echo "========================================================"
echo " SYSTEM SETUP"
echo "--------------------------------------------------------"
echo " 1. Install Media Codecs"
echo " 2. Modify DNF Configuration (for speed)"
echo " 3. Install Fonts (Microsoft & Nerd Fonts)"
echo " 4. Core System Setup (Kernel-Devel, Flatpak, etc.)"
echo " 6. Add RPM Fusion Repositories"
echo " "
echo " SHELL & TERMINAL"
echo "--------------------------------------------------------"
echo " 5. Install Zsh & Oh My Zsh"
echo " 5.5 Install Zsh Theme (Powerlevel10k) & Plugins"
echo " 11. Install Fish Shell & Oh My Fish"
echo " "
echo " SOFTWARE & TOOLS"
echo "--------------------------------------------------------"
echo " 7. Install WineHQ"
echo " 8. Install Common Software (Steam, Discord, etc.)"
echo " 9. Install Homebrew"
echo " 10. Install CoolerControl"
echo " "
echo " EXTERNAL SCRIPTS"
echo "--------------------------------------------------------"
echo " 12. Run Chris Titus Linux Utility Script"
echo " "
echo " 0. Exit"
echo "========================================================"
read -rp "Enter your choice: " choice
case $choice in
1) install_media_codecs ;;
2) modify_dnf ;;
3) install_fonts ;;
4) core_setup ;;
5) install_zsh ;;
5.5) setup_zsh_themes ;;
6) add_repos ;;
7) install_wine ;;
8) install_software ;;
9) install_brew ;;
10) install_coolercontrol ;;
11) install_fish ;;
12) run_titus_script ;;
0) echo "Exiting script. Goodbye!"; exit 0 ;;
*) echo "Invalid choice. Please try again." ;;
esac
echo ""
read -rp "Task complete. Press Enter to return to the menu..."
done
}
# --- Script Execution ---
main_menu