226 lines
7.8 KiB
Bash
226 lines
7.8 KiB
Bash
|
#!/bin/bash
|
||
|
#
|
||
|
# Script Name: install_fedora.sh
|
||
|
# Version : 1.0
|
||
|
# Description: Installation script auto customization
|
||
|
# GNOME 46 Look Like macOS on Fedora 40
|
||
|
#
|
||
|
# For Linux : Fedora 40
|
||
|
# For Desktop Environment : GNOME Shell 46
|
||
|
# Author: linuxscoop
|
||
|
# Youtube: https://youtube.com/user/linuxscoop
|
||
|
# Created: May 20, 2024
|
||
|
# Last Modified: June 07, 2024
|
||
|
#
|
||
|
# Update the system
|
||
|
update_system() {
|
||
|
clear
|
||
|
echo "Updating your system with new packages..."
|
||
|
sudo dnf update -y
|
||
|
}
|
||
|
|
||
|
# Install command line apps and dependencies
|
||
|
install_apps_and_dependencies() {
|
||
|
clear
|
||
|
echo "Installing command line apps and dependencies..."
|
||
|
sudo dnf install -y curl \
|
||
|
rsync \
|
||
|
git \
|
||
|
sassc \
|
||
|
openssl \
|
||
|
gnome-tweaks
|
||
|
}
|
||
|
|
||
|
# Install GNOME apps and dependencies
|
||
|
install_gnome_apps() {
|
||
|
clear
|
||
|
echo "Installing GNOME apps and dependencies..."
|
||
|
sudo dnf install -y gnome-weather \
|
||
|
gnome-maps \
|
||
|
gnome-audio \
|
||
|
gnome-calendar \
|
||
|
gnome-clocks \
|
||
|
gnome-connections \
|
||
|
gnome-console \
|
||
|
gnome-contacts \
|
||
|
gnome-music \
|
||
|
vlc \
|
||
|
gnome-shell-extension-pomodoro
|
||
|
}
|
||
|
|
||
|
# Install WhiteSur GTK theme and configure it
|
||
|
install_whitesur_gtk_theme() {
|
||
|
clear
|
||
|
echo "Installing WhiteSur GTK theme..."
|
||
|
mkdir -p src && cd src/ || { echo "Failed to create or enter src directory"; exit 1; }
|
||
|
if [ ! -d "WhiteSur-gtk-theme" ]; then
|
||
|
git clone https://github.com/vinceliuice/WhiteSur-gtk-theme.git || { echo "Failed to clone WhiteSur-gtk-theme repository"; exit 1; }
|
||
|
fi
|
||
|
cd WhiteSur-gtk-theme/ || { echo "Failed to enter WhiteSur-gtk-theme directory"; exit 1; }
|
||
|
./install.sh -l -c Light -c Dark -s 180 -m || { echo "Failed to execute install.sh"; exit 1; }
|
||
|
./tweaks.sh -d || { echo "Failed to execute tweaks.sh"; exit 1; }
|
||
|
cd ../../ || { echo "Failed to return to the previous directory"; exit 1; }
|
||
|
ln -sf "$HOME/.config/gtk-4.0/gtk-Light.css" "$HOME/.config/gtk-4.0/gtk.css"
|
||
|
echo "WhiteSur GTK theme installation completed."
|
||
|
}
|
||
|
|
||
|
# Install WhiteSur icon theme
|
||
|
install_whitesur_icon_theme() {
|
||
|
clear
|
||
|
echo "Installing WhiteSur icon theme..."
|
||
|
cd src/ || { echo "Failed to enter src directory"; exit 1; }
|
||
|
if [ ! -d "WhiteSur-icon-theme" ]; then
|
||
|
git clone https://github.com/vinceliuice/WhiteSur-icon-theme.git || { echo "Failed to clone WhiteSur-icon-theme repository"; exit 1; }
|
||
|
fi
|
||
|
cd WhiteSur-icon-theme/ || { echo "Failed to enter WhiteSur-icon-theme directory"; exit 1; }
|
||
|
./install.sh -a -b || { echo "Failed to execute install.sh"; exit 1; }
|
||
|
cd ../../ || { echo "Failed to return to the previous directory"; exit 1; }
|
||
|
echo "WhiteSur icon theme installation completed."
|
||
|
}
|
||
|
|
||
|
# Install WhiteSur Firefox theme
|
||
|
install_whitesur_firefox_theme() {
|
||
|
clear
|
||
|
echo "Installing WhiteSur Firefox theme..."
|
||
|
mkdir -p src && cd src/ || { echo "Failed to create or enter src directory"; exit 1; }
|
||
|
if [ ! -d "WhiteSur-firefox-theme" ]; then
|
||
|
git clone https://github.com/vinceliuice/WhiteSur-firefox-theme.git || { echo "Failed to clone WhiteSur-firefox-theme repository"; exit 1; }
|
||
|
fi
|
||
|
cd WhiteSur-firefox-theme/ || { echo "Failed to enter WhiteSur-firefox-theme directory"; exit 1; }
|
||
|
./install.sh -m || { echo "Failed to execute install.sh"; exit 1; }
|
||
|
cd ../../ || { echo "Failed to return to the previous directory"; exit 1; }
|
||
|
echo "WhiteSur Firefox theme installation completed."
|
||
|
}
|
||
|
|
||
|
# Install cursors theme
|
||
|
install_cursors_theme() {
|
||
|
clear
|
||
|
echo "Installing cursors theme..."
|
||
|
if [ -d $HOME/.icons ]; then
|
||
|
cp -af res/WhiteSur-cursors/ $HOME/.icons/
|
||
|
else
|
||
|
mkdir $HOME/.icons
|
||
|
cp -af res/WhiteSur-cursors/ $HOME/.icons/
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
# Install fonts and wallpapers
|
||
|
install_fonts_and_wallpapers() {
|
||
|
clear
|
||
|
echo "Installing fonts and wallpapers..."
|
||
|
cp -af res/fonts/ $HOME/.local/share/
|
||
|
sudo cp -af res/macosw/ /usr/share/backgrounds/
|
||
|
sudo chmod 755 /usr/share/backgrounds/macosw
|
||
|
sudo chmod 644 /usr/share/backgrounds/macosw/*.*
|
||
|
}
|
||
|
|
||
|
# Install GNOME shell extensions
|
||
|
install_gnome_shell_extensions() {
|
||
|
clear
|
||
|
echo "Installing GNOME shell extensions..."
|
||
|
if [ -d $HOME/.local/share/gnome-shell/extensions ]; then
|
||
|
cp -af res/extensions/* $HOME/.local/share/gnome-shell/extensions/
|
||
|
else
|
||
|
mkdir -p $HOME/.local/share/gnome-shell/extensions
|
||
|
cp -af res/extensions/* $HOME/.local/share/gnome-shell/extensions/
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
# Install Cava, Neofetch and their configurations
|
||
|
install_cava_neofetch() {
|
||
|
clear
|
||
|
echo "Installing Cava, Neofetch and their configurations..."
|
||
|
sudo dnf install -y cava neofetch
|
||
|
cp -af conf/cava/ $HOME/.config/
|
||
|
cp -af conf/neofetch/ $HOME/.config/
|
||
|
}
|
||
|
|
||
|
# Install Oh My Zsh
|
||
|
install_zsh_oh_my_zsh() {
|
||
|
clear
|
||
|
echo "Installing Oh My Zsh..."
|
||
|
sudo dnf install -y zsh
|
||
|
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" <<EOF
|
||
|
Y
|
||
|
EOF
|
||
|
}
|
||
|
|
||
|
# Install Powerlevel10k theme
|
||
|
install_powerlevel10k_theme() {
|
||
|
clear
|
||
|
echo "Installing Powerlevel10k theme..."
|
||
|
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k"
|
||
|
sed -i 's/ZSH_THEME="robbyrussell"/# ZSH_THEME="robbyrussell"\nZSH_THEME="powerlevel10k\/powerlevel10k"/' $HOME/.zshrc
|
||
|
sudo chsh -s "$(which zsh)" "$(whoami)"
|
||
|
find conf/ \( -name .p10k.zsh -o -name .zshrc \) -exec rsync -av {} $HOME/ \;
|
||
|
}
|
||
|
|
||
|
# Enable Flatpak and AppImage support, and add Flathub repository
|
||
|
enable_flatpak_and_appimage_support() {
|
||
|
clear
|
||
|
echo "Enabling Flatpak, AppImage support and adding Flathub repository..."
|
||
|
sudo dnf install -y gnome-software gnome-software-plugin-flatpak flatpak fuse
|
||
|
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||
|
}
|
||
|
|
||
|
# Install Flatpak applications
|
||
|
install_flatpak_apps() {
|
||
|
clear
|
||
|
echo "Installing Flatpak applications..."
|
||
|
flatpak install -y flathub io.bassi.Amberol com.mattjakeman.ExtensionManager com.github.KRTirtho.Spotube
|
||
|
# make flatpak apps follow active theme
|
||
|
sudo flatpak override --filesystem=$HOME/.themes
|
||
|
sudo flatpak override --filesystem=$HOME/.local/share/icons
|
||
|
sudo flatpak override --filesystem=xdg-config/gtk-4.0
|
||
|
}
|
||
|
|
||
|
# Install Plymouth macOS theme
|
||
|
install_plymouth_macos_theme() {
|
||
|
clear
|
||
|
echo "Installing Plymouth macOS theme..."
|
||
|
sudo dnf install -y plymouth plymouth-theme-script -y
|
||
|
sudo cp -af res/macOS/ /usr/share/plymouth/themes/
|
||
|
sudo plymouth-set-default-theme -R macOS
|
||
|
}
|
||
|
|
||
|
# Restore GNOME Shell configuration
|
||
|
restore_gnome_shell_configuration() {
|
||
|
dconf load / < conf/gnome46-macos-fedora40.conf
|
||
|
}
|
||
|
|
||
|
# Prompt for confirmation to quit session and handle user's choice
|
||
|
prompt_for_logout() {
|
||
|
clear
|
||
|
read -p "Setup completed successfully. Please logout and log back in for changes to take effect. (y/n): " choice
|
||
|
|
||
|
if [[ "$choice" == "y" || "$choice" == "Y" ]]; then
|
||
|
echo "Logging out..."
|
||
|
gnome-session-quit --no-prompt
|
||
|
else
|
||
|
echo "Logout skipped. Please log out manually to apply the changes."
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
# Main function to execute all steps
|
||
|
main() {
|
||
|
update_system
|
||
|
install_apps_and_dependencies
|
||
|
install_gnome_apps
|
||
|
install_gnome_shell_extensions
|
||
|
install_whitesur_gtk_theme
|
||
|
install_whitesur_icon_theme
|
||
|
install_whitesur_firefox_theme
|
||
|
install_cursors_theme
|
||
|
install_fonts_and_wallpapers
|
||
|
install_cava_neofetch
|
||
|
install_zsh_oh_my_zsh
|
||
|
install_powerlevel10k_theme
|
||
|
enable_flatpak_and_appimage_support
|
||
|
install_flatpak_apps
|
||
|
install_plymouth_macos_theme
|
||
|
restore_gnome_shell_configuration
|
||
|
prompt_for_logout
|
||
|
}
|
||
|
|
||
|
# Execute the main function
|
||
|
main
|