init commit
This commit is contained in:
42
setup/scripts/install-initial-packages
Executable file
42
setup/scripts/install-initial-packages
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# --- Helper functions ---
|
||||
log() { echo -e "\033[1;34m[INFO]\033[0m $*"; }
|
||||
exists() { command -v "$1" >/dev/null 2>&1; }
|
||||
|
||||
echo -e "\n--- Installing initial packages ---\n"
|
||||
|
||||
# --- Install all initial packages ---
|
||||
PACKAGES_FILE="$HOME/.local/share/Panama/setup/packages/initial-packages"
|
||||
if [[ -f "$PACKAGES_FILE" ]]; then
|
||||
INITIAL_PACKAGES=$(tr "\n" " " <"$PACKAGES_FILE")
|
||||
log "Installing $INITIAL_PACKAGES"
|
||||
sudo dnf install -y "$INITIAL_PACKAGES" > /dev/null 2>&1
|
||||
log "Packages installed!"
|
||||
else
|
||||
log "Package list was not in specified path: $PACKAGES_FILE"
|
||||
fi
|
||||
|
||||
# --- Install eza with cargo if not already installed ---
|
||||
if [[ -x "$HOME/.cargo/bin/eza" ]]; then
|
||||
log "eza already installed at \"$HOME/.cargo/bin/eza\""
|
||||
else
|
||||
if exists cargo; then
|
||||
log "Installing eza via Cargo..."
|
||||
log "Cargo must build eza so this could take a minute or two."
|
||||
cargo install eza > /dev/null 2>&1
|
||||
else
|
||||
log "Cargo not found. Was the package list installed?"
|
||||
fi
|
||||
fi
|
||||
|
||||
# --- Install oh-my-posh if not already installed. ---
|
||||
LOCAL_BIN_PATH="$HOME/.local/bin"
|
||||
mkdir -p "$LOCAL_BIN_PATH"
|
||||
|
||||
if [[ -x "$LOCAL_BIN_PATH/oh-my-posh" ]]; then
|
||||
log "oh-my-posh already installed at \"$LOCAL_BIN_PATH/oh-my-posh\""
|
||||
else
|
||||
log "Installing oh-my-posh via curl..."
|
||||
curl -s https://ohmyposh.dev/install.sh | bash -s -- -d "$LOCAL_BIN_PATH" > /dev/null 2>&1
|
||||
fi
|
||||
17
setup/scripts/link-dotfiles
Executable file
17
setup/scripts/link-dotfiles
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Define paths as they have not been defined by new bashrc yet!
|
||||
PANAMA_PATH="${PANAMA_PATH:-$HOME/.local/share/Panama}"
|
||||
PANAMA_BASH="${PANAMA_BASH:-$PANAMA_PATH/config/bash}"
|
||||
|
||||
# Backup existing .bashrc if it's a regular file
|
||||
if [ -f "$HOME/.bashrc" ] && [ ! -L "$HOME/.bashrc" ]; then
|
||||
mv "$HOME/.bashrc" "$PANAMA_BASH/.bashrc.bak"
|
||||
fi
|
||||
|
||||
# Remove old symlink if it exists and points somewhere else
|
||||
if [ -L "$HOME/.bashrc" ]; then
|
||||
rm "$HOME/.bashrc"
|
||||
fi
|
||||
|
||||
ln -s "$PANAMA_BASH/.bashrc" "$HOME/.bashrc"
|
||||
Reference in New Issue
Block a user