refactor 🔨: Improve Script and README (Warning Section)

This commit is contained in:
Ayush Dumasia 2025-05-17 09:46:15 +05:30
parent fdcdc5ee4e
commit aacea95b85
2 changed files with 70 additions and 51 deletions

View file

@ -108,3 +108,17 @@ Heres an improved version of your README **"Quick Installation"** section, wi
I use [`ngw-look`](https://github.com/nwg-piotr/nwg-look) to configure GTK themes and styles. Make sure it's installed and configured as part of your post-install customization. I use [`ngw-look`](https://github.com/nwg-piotr/nwg-look) to configure GTK themes and styles. Make sure it's installed and configured as part of your post-install customization.
--- ---
## ⚠️ Important Notice (Read Before Running Setup)
> ### **Warning:**
>
> This setup script will **move your existing config files** (e.g., for Waybar, Kitty, Hyprland, etc.) to a backup folder at `~/.config_backup`. Then, it will copy the new configs from this repo into your `~/.config` directory.
>
> ### What this means:
>
> - Your current setup will be **replaced**.
> - If you have customizations you care about, **back them up manually** or review the script before running.
> - Fonts and themes will be installed system-wide in your `~/.local/share/fonts` directory.
---

107
setup.sh
View file

@ -3,81 +3,86 @@
set -euo pipefail set -euo pipefail
#sudo pacman -S hyprland waybar dunst kitty neovim git wl-clipboard xdg-desktop-portal-hyprland xdg-desktop-portal wofi network-manager-applet brightnessctl pavucontrol tmux rofi yazi firefox pamixer hyprlock grim slurp #sudo pacman -S hyprland waybar dunst kitty neovim git wl-clipboard xdg-desktop-portal-hyprland xdg-desktop-portal wofi network-manager-applet brightnessctl pavucontrol tmux rofi yazi firefox pamixer hyprlock grim slurp
cat << EOF cat << EOF
_________ __ ____ ___ _________ __ ____ ___
/ _____/ _____/ |_| | \______ / _____/ _____/ |_| | \______
\_____ \_/ __ \ __\ | /\____ \ \_____ \_/ __ \ __\ | /\____ \
/ \ ___/| | | | / | |_> > / \ ___/| | | | / | |_> >
/_______ /\___ >__| |______/ | __/ /_______ /\___ >__| |______/ | __/
\/ \/ |__| \/ \/ |__|
EOF EOF
echo "Copying config files..." CONFIGS="cava kitty dunst fastfetch hypr hypridle rofi starship tmux waybar yazi"
cp -r cava kitty dunst fastfetch gtk-3.0 gtk-4.0 hypr hypridle rofi starship tmux waybar yazi ~/.config/ BACKUP_DIR="$HOME/.config_backup"
LOCAL_BIN="$HOME/.local/bin"
FONT_DIR="$HOME/.local/share/fonts"
DOTS_DIR="$HOME/hyprdots"
cd ~/.config/waybar/scripts echo "==> Backing up existing config files..."
chmod +x * mkdir -p "$BACKUP_DIR"
for dir in $CONFIGS; do
if [ -d "$HOME/.config/$dir" ]; then
echo "=> Backing up $dir to $BACKUP_DIR"
mv "$HOME/.config/$dir" "$BACKUP_DIR/$dir"
fi
done
cd ~/hyprdots echo "==> Copying new config files..."
cp -r $CONFIGS "$HOME/.config/"
cd ~/.config/rofi echo "==> Making Waybar and Rofi scripts executable..."
chmod +x * chmod +x ~/.config/waybar/scripts/*
chmod +x ~/.config/rofi/* || true
cd ~/hyprdots echo "==> Copying binaries..."
mkdir -p "$LOCAL_BIN"
cp -r bin/* "$LOCAL_BIN"
chmod +x "$LOCAL_BIN"/*
cp -r bin ~/.local/bin/ echo "==> Copying .zshrc..."
cp zsh/.zshrc "$HOME/.zshrc"
cd ~/.local/bin/ echo "==> Making scripts executable..."
chmod +x * chmod +x "$DOTS_DIR"/* || true
cd ~/hyprdots/ # Font Awesome Installation
FA_DIR="$FONT_DIR/fontawesome"
mkdir -p "$FA_DIR"
echo "Copying .zshrc..." echo "==> Installing Font Awesome (v5 & v6)..."
cp zsh/.zshrc ~/.zshrc if [[ ! -f "$FA_DIR/fa-brands-400.ttf" ]]; then
#echo "Cloning dotsh repo..."
#mkdir -p ~/SideProjects/
#git clone https://github.com/ad1822/dotsh ~/SideProjects/dotsh
#cd ~/SideProjects/dotsh || exit
echo "Making scripts executable..."
chmod +x *
echo "Setup complete!"
mkdir -p ~/.local/share/fonts/fontawesome
echo "Installing Font Awesome Icon pack (Version 5 and 6)"
if [[ ! -f ~/.local/share/fonts/fontawesome/fa-brands-400.ttf ]]; then
wget -q https://use.fontawesome.com/releases/v6.7.2/fontawesome-free-6.7.2-desktop.zip wget -q https://use.fontawesome.com/releases/v6.7.2/fontawesome-free-6.7.2-desktop.zip
unzip fontawesome-free-6.7.2-desktop.zip -d ~/.local/share/fonts/fontawesome unzip -q fontawesome-free-6.7.2-desktop.zip
mv fontawesome6/otfs/*.otf ~/.local/share/fonts/fontawesome/ mv fontawesome-free-6.7.2-desktop/otfs/*.otf "$FA_DIR/"
rm -rf fontawesome6 fontawesome-free-6.7.2-desktop.zip rm -rf fontawesome-free-6.7.2-desktop*
wget -q https://use.fontawesome.com/releases/v5.15.4/fontawesome-free-5.15.4-desktop.zip wget -q https://use.fontawesome.com/releases/v5.15.4/fontawesome-free-5.15.4-desktop.zip
unzip fontawesome-free-5.15.4-desktop.zip -d ~/.local/share/fonts/fontawesome unzip -q fontawesome-free-5.15.4-desktop.zip
mv fontawesome5/otfs/*.otf ~/.local/share/fonts/fontawesome/ mv fontawesome-free-5.15.4-desktop/otfs/*.otf "$FA_DIR/"
rm -rf fontawesome5 fontawesome-free-5.15.4-desktop.zip rm -rf fontawesome-free-5.15.4-desktop*
else else
echo "Font Awesome already installed, skipping download." echo "✔️ Font Awesome already installed, skipping."
fi fi
echo "Installing JetBrains Nerd Fonts" # JetBrains Nerd Font Installation
mkdir -p ~/.local/share/fonts/JetBrainsMono JB_FONT_DIR="$FONT_DIR/JetBrainsMono"
if [[ ! -f ~/.local/share/fonts/JetBrainsMono/JetBrainsMono-Regular.ttf ]]; then mkdir -p "$JB_FONT_DIR"
echo "==> Installing JetBrains Nerd Fonts..."
if [[ ! -f "$JB_FONT_DIR/JetBrainsMono-Regular.ttf" ]]; then
wget -q https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/JetBrainsMono.zip wget -q https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/JetBrainsMono.zip
unzip -q JetBrainsMono.zip -d JetBrainsMono unzip -q JetBrainsMono.zip -d JetBrainsMono
mv JetBrainsMono/*.ttf ~/.local/share/fonts/JetBrainsMono/ mv JetBrainsMono/*.ttf "$JB_FONT_DIR/"
rm -rf JetBrainsMono JetBrainsMono.zip rm -rf JetBrainsMono JetBrainsMono.zip
else else
echo "JetBrains Nerd Fonts already installed, skipping download." echo "✔️ JetBrains Nerd Font already installed, skipping."
fi fi
echo "==> Refreshing font cache..."
fc-cache -f -v fc-cache -f -v
echo "Setup completed successfully!" echo -e "\n✅ Setup completed successfully!"