Update script to be really pretty
This commit is contained in:
@@ -7,7 +7,7 @@ exists() { command -v "$1" >/dev/null 2>&1; }
|
|||||||
# --- Defined Paths ---
|
# --- Defined Paths ---
|
||||||
PANAMA_PATH="$HOME/.local/share/Panama"
|
PANAMA_PATH="$HOME/.local/share/Panama"
|
||||||
|
|
||||||
echo -e "--- Installing Repositories ---"
|
echo -e "\n--- Installing Repositories ---"
|
||||||
log "Installing RPM Fusion Free and Nonfree Repositories"
|
log "Installing RPM Fusion Free and Nonfree Repositories"
|
||||||
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 > /dev/null 2>&1
|
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 > /dev/null 2>&1
|
||||||
log "Enabling Fedora Cisco OpenH264 Repository"
|
log "Enabling Fedora Cisco OpenH264 Repository"
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# --- Helper functions ---
|
||||||
|
log() { echo -e "\033[1;34m[INFO]\033[0m $*"; }
|
||||||
|
|
||||||
# Define paths as they have not been defined by new bashrc yet!
|
# Define paths as they have not been defined by new bashrc yet!
|
||||||
PANAMA_PATH="${PANAMA_PATH:-$HOME/.local/share/Panama}"
|
PANAMA_PATH="${PANAMA_PATH:-$HOME/.local/share/Panama}"
|
||||||
PANAMA_BASH="${PANAMA_BASH:-$PANAMA_PATH/config/bash}"
|
PANAMA_BASH="${PANAMA_BASH:-$PANAMA_PATH/config/bash}"
|
||||||
@@ -11,36 +14,39 @@ CONFIG="$HOME/.config"
|
|||||||
mkdir -p "$PANAMA_OLD"
|
mkdir -p "$PANAMA_OLD"
|
||||||
|
|
||||||
# --- Bashrc ---
|
# --- Bashrc ---
|
||||||
|
echo -e "\n--- Replacing .bashrc ---"
|
||||||
# Backup existing .bashrc if it's a regular file
|
# Backup existing .bashrc if it's a regular file
|
||||||
if [ -f "$HOME/.bashrc" ] && [ ! -L "$HOME/.bashrc" ]; then
|
if [ -f "$HOME/.bashrc" ] && [ ! -L "$HOME/.bashrc" ]; then
|
||||||
|
log "Backing up existing .bashrc"
|
||||||
mv "$HOME/.bashrc" "$PANAMA_OLD/.bashrc"
|
mv "$HOME/.bashrc" "$PANAMA_OLD/.bashrc"
|
||||||
fi
|
fi
|
||||||
# Remove old symlink if it exists and points somewhere else
|
# Remove old symlink if it exists and points somewhere else
|
||||||
if [ -L "$HOME/.bashrc" ]; then
|
if [ -L "$HOME/.bashrc" ]; then
|
||||||
|
log "Removing old .bashrc symlink"
|
||||||
rm "$HOME/.bashrc"
|
rm "$HOME/.bashrc"
|
||||||
fi
|
fi
|
||||||
# Symlink Panama .bashrc file to ~/.bashrc
|
# Symlink Panama .bashrc file to ~/.bashrc
|
||||||
|
log "Symlinking Panama .bashrc file to ~/.bashrc"
|
||||||
ln -s "$PANAMA_BASH/.bashrc" "$HOME/.bashrc"
|
ln -s "$PANAMA_BASH/.bashrc" "$HOME/.bashrc"
|
||||||
|
|
||||||
dirs=("espanso" "forge" "ghostty" "kitty" "nvim" "tmux")
|
dirs=("espanso" "forge" "ghostty" "kitty" "nvim" "tmux")
|
||||||
|
|
||||||
for dir in "${dirs[@]}"; do
|
for dir in "${dirs[@]}"; do
|
||||||
echo "--- Setting up $dir ---"
|
echo -e "\n--- Setting up $dir ---"
|
||||||
|
|
||||||
# Remove old symlink if it exists
|
# Remove old symlink if it exists
|
||||||
if [ -L "$CONFIG/$dir" ]; then
|
if [ -L "$CONFIG/$dir" ]; then
|
||||||
rm "$CONFIG/$dir"
|
rm "$CONFIG/$dir"
|
||||||
echo "Removed old symlink at $CONFIG/$dir"
|
log "Removed old symlink at $CONFIG/$dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Backup existing directory if it exists
|
# Backup existing directory if it exists
|
||||||
if [ -d "$CONFIG/$dir" ]; then
|
if [ -d "$CONFIG/$dir" ]; then
|
||||||
mv "$CONFIG/$dir" "$PANAMA_OLD/$dir"
|
mv "$CONFIG/$dir" "$PANAMA_OLD/$dir"
|
||||||
echo "Moved existing $dir config to $PANAMA_OLD/$dir"
|
log "Moved existing $dir config to $PANAMA_OLD/$dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create symlink
|
# Create symlink
|
||||||
ln -s "$PANAMA_DOT/$dir" "$CONFIG/$dir"
|
ln -s "$PANAMA_DOT/$dir" "$CONFIG/$dir"
|
||||||
echo "Linked $PANAMA_DOT/$dir → $CONFIG/$dir"
|
log "Linked $PANAMA_DOT/$dir → $CONFIG/$dir"
|
||||||
echo
|
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user