This commit is contained in:
2026-03-08 08:27:23 +00:00
parent 0adc324277
commit 1511447330
13 changed files with 191 additions and 83 deletions
+5
View File
@@ -18,3 +18,8 @@ alias la='ls -la'
fastfetch
# Added by LM Studio CLI (lms)
export PATH="$PATH:/home/jake/.lmstudio/bin"
# End of LM Studio CLI section
-19
View File
@@ -1,19 +0,0 @@
#!/usr/bin/env bash
#
pacman_to_add=(
"tree"
"ttf-fira-code"
"cronie"
)
aur_to_add=(
"bazecor"
"lmstudio-bin"
)
package_str=(IFS=' ' ; echo "${pacman_to_add[@]}")
aur_str=(IFS=' ' ; echo "${aur_to_add[@]}")
omarchy-pkg-add $package_str
omarchy-pkg-aur-add $aur_str
-8
View File
@@ -1,8 +0,0 @@
#!/usr/bin/env bash
#
# Copy cron tasks to /usr/local/bin
cp /mnt/nas/Jake/cron_tasks/*.sh /usr/local/bin/
# Restore from your saved file
crontab < /mnt/nas/Jake/cron_tasks/cron_backup
-18
View File
@@ -1,18 +0,0 @@
#!/bin/bash
# FIRST, MOUNT NAS AT /mnt/nas/
REMOTE="/mnt/nas/Jake
echo "📥 Pulling SSH keys..."
rsync "$REMOTE/ssh/id_rsa" ~/.ssh/ && chmod 600 ~/.ssh/id_rsa
rsync "$REMOTE/ssh/id_rsa.pub" ~/.ssh/ && chmod 644 ~/.ssh/id_rsa.pub
rsync "$REMOTE/ssh/config" ~/.ssh/ && chmod 644 ~/.ssh/config
echo "📥 Pulling GPG key..."
rsync "$REMOTE/ssh/my-gpg-key.asc" ~/
echo "🔑 Importing GPG key..."
gpg --import ~/my-gpg-key.asc
rm ~/my-gpg-key.asc # Clean up after import
echo "✅ SSH and GPG setup complete!"
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
#
# Copy cron tasks to /usr/local/bin only if source is newer
for script in /mnt/nas/Jake/cron_tasks/*.sh; do
if [ -f "$script" ]; then
basename=$(basename "$script")
dest="/usr/local/bin/$basename"
if [ ! -f "$dest" ] || [ "$(stat -c %Y "$script")" -gt "$(stat -c %Y "$dest" 2>/dev/null || echo 0)" ]; then
sudo cp "$script" "$dest"
echo " Updated $basename"
else
echo " Skipped $basename (up to date)"
fi
fi
done
# Restore crontab only if backup is newer than current crontab
CRON_BACKUP="/mnt/nas/Jake/cron_tasks/cron_backup"
if [ -f "$CRON_BACKUP" ]; then
CURRENT_CRON=$(mktemp)
crontab -l >"$CURRENT_CRON" 2>/dev/null || true
if ! diff -q "$CURRENT_CRON" "$CRON_BACKUP" >/dev/null 2>&1; then
crontab < "$CRON_BACKUP"
echo " Cron jobs updated"
else
echo " Cron jobs up to date"
fi
rm -f "$CURRENT_CRON"
else
echo "Error: Cron backup file not found at $CRON_BACKUP" >&2
exit 1
fi
@@ -24,13 +24,26 @@ restore_project() {
exit 1
fi
local target_dir="$REPO_SOURCE/$project_name"
echo "Restoring $project_name from latest backup..."
# Create the project directory if it doesn't exist
mkdir -p "$REPO_SOURCE/$project_name"
# Check if project already exists and is up to date
if [ -d "$target_dir" ]; then
local backup_mtime=$(stat -c %Y "${project_backup_path}/backup.tar" 2>/dev/null || echo 0)
local repo_mtime=$(stat -c %Y "$target_dir" 2>/dev/null || echo 0)
# Extract the backup to the source directory
tar -xf "${project_backup_path}/backup.tar" -C "$REPO_SOURCE/$project_name"
if [ "$repo_mtime" -ge "$backup_mtime" ]; then
echo " Skipped $project_name (already up to date)"
return 0
fi
fi
# Create the project directory if it doesn't exist
mkdir -p "$target_dir"
# Extract the backup to the source directory (overwrite existing files)
tar -xf "${project_backup_path}/backup.tar" -C "$target_dir"
echo "Successfully restored $project_name from backup"
}
+40
View File
@@ -0,0 +1,40 @@
#!/bin/bash
# FIRST, MOUNT NAS AT /mnt/nas/
REMOTE="/mnt/nas/Jake"
echo "📥 Pulling SSH keys..."
if [ ! -f ~/.ssh/id_rsa ] || [ "$(stat -c %Y "$REMOTE/ssh/id_rsa")" -gt "$(stat -c %Y ~/.ssh/id_rsa 2>/dev/null || echo 0)" ]; then
rsync "$REMOTE/ssh/id_rsa" ~/.ssh/ && chmod 600 ~/.ssh/id_rsa
fi
if [ ! -f ~/.ssh/id_rsa.pub ] || [ "$(stat -c %Y "$REMOTE/ssh/id_rsa.pub")" -gt "$(stat -c %Y ~/.ssh/id_rsa.pub 2>/dev/null || echo 0)" ]; then
rsync "$REMOTE/ssh/id_rsa.pub" ~/.ssh/ && chmod 644 ~/.ssh/id_rsa.pub
fi
if [ ! -f ~/.ssh/config ] || [ "$(stat -c %Y "$REMOTE/ssh/config")" -gt "$(stat -c %Y ~/.ssh/config 2>/dev/null || echo 0)" ]; then
rsync "$REMOTE/ssh/config" ~/.ssh/ && chmod 644 ~/.ssh/config
fi
echo "📥 Pulling GPG key..."
if [ ! -f ~/my-gpg-key.asc ]; then
rsync "$REMOTE/ssh/my-gpg-key.asc" ~/
else
echo " GPG key already exists locally, skipping download"
fi
if [ ! -f ~/my-gpg-key.asc ]; then
echo "✅ SSH and GPG setup complete!"
exit 0
fi
echo "🔑 Importing GPG key..."
if ! gpg --list-secret-keys --with-colons "my-gpg-key.asc" 2>/dev/null | grep -q "^sec:"; then
gpg --import ~/my-gpg-key.asc
else
echo " GPG key already imported, skipping import"
fi
rm -f ~/my-gpg-key.asc
echo "✅ SSH and GPG setup complete!"
+45
View File
@@ -0,0 +1,45 @@
#!/usr/bin/env bash
#
# Folders to link into the host .config directory
link_to_config=(
"git"
"starship.toml"
"fastfetch"
)
link_to_home=(
".bashrc"
".gitconfig"
)
directories=(
"~/source"
)
for dir in "${directories[@]}"; do
if [ -e "$dir" ] || [ -L "$dir" ]; then
echo " Skipping $dir (already exists)"
else
mkdir -p "$dir"
echo " Created $dir"
fi
done
for link in "${link_to_config[@]}"; do
config_path="$HOME/dotfiles/$link"
target_path="$HOME/.config/$link"
if [ -e "$target_path" ] || [ -L "$target_path" ]; then
echo " Skipping $target_path (already exists)"
else
ln -sf "$config_path" "$target_path"
fi
done
for link in "${link_to_home[@]}"; do
config_path="$HOME/dotfiles/$link"
target_path="$HOME/$link"
if [ -e "$target_path" ] || [ -L "$target_path" ]; then
echo " Skipping $target_path (already exists)"
else
ln -sf "$config_path" "$target_path"
fi
done
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
#
source ~/.local/share/omarchy/bin/omarchy-pkg-add
source ~/.local/share/omarchy/bin/omarchy-pkg-aur-add
pacman_to_add=(
"tree"
"ttf-fira-code"
"cronie"
)
aur_to_add=(
"bazecor"
"lmstudio-bin"
)
package_str=$(IFS=' ' ; echo "${pacman_to_add[@]}")
aur_str=$(IFS=' ' ; echo "${aur_to_add[@]}")
omarchy-pkg-add $package_str
omarchy-pkg-aur-add $aur_str
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
# Redirect the output to /dev/null to suppress any output if all is good!
omarchy-webapp-remove "HEY" 2>/dev/null || true
omarchy-webapp-remove "Basecamp" 2>/dev/null || true
omarchy-webapp-remove "Google Photos" 2>/dev/null || true
omarchy-webapp-remove "Google Messages" 2>/dev/null || true
omarchy-webapp-remove "Figma" 2>/dev/null || true
omarchy-webapp-remove "Zoom" 2>/dev/null || true
omarchy-webapp-remove "Fizzy" 2>/dev/null || true
omarchy-pkg-drop signal-desktop 2>/dev/null || true
rm -rf ~/Work/tries 2>/dev/null || true
-23
View File
@@ -1,23 +0,0 @@
#!/usr/bin/env bash
#
# Folders to link into the host .config directory
link_to_config=(
"git"
"starship.toml"
)
link_to_home=(
".bashrc"
".gitconfig"
)
for link in "${link_to_config[@]}"; do
config_path="$HOME/dotfiles/$link"
target_path="$HOME/.config/$link"
ln -s "$config_path" "$target_path"
done
for link in "${link_to_home[@]}"; do
config_path="$HOME/dotfiles/$link"
target_path="$HOME/$link"
ln -s "$config_path" "$target_path"
done
+13 -11
View File
@@ -10,36 +10,38 @@ echo " Omarchy Fresh Install - Starting..."
echo "========================================"
# 1. Add packages (must be first)
echo "[1/4] Installing packages..."
./omarchy_package_install.sh
echo "Installing packages..."
./scripts/omarchy-specific/omarchy_package_install.sh
# 2. Set up symbolic links
echo ""
echo "[2/4] Setting up symbolic links..."
./set_up_sym_links.sh
echo "Setting up symbolic links..."
./scripts/generic/set_up_sym_links.sh
# 3. Mount NAS (required for restore scripts)
echo ""
echo "[3/4] Setting up NAS mount..."
./set_up_nas_mount.sh
echo "Setting up NAS mount..."
./scripts/generic/set_up_nas_mount.sh
# 4. Restore backups (requires NAS mount)
echo ""
echo "[4/4] Restoring SSH/GPG keys and Git data..."
echo "Restoring SSH/GPG keys and Git data..."
echo " - Restoring SSH and GPG keys..."
./restore_ssh_gpg.sh
./scripts/generic/restore_ssh_gpg.sh
echo " - Restoring Git backups..."
./restore_git_backup.sh
./scripts/generic/restore_git_backup.sh >/dev/null 2>&1 || echo " (Git restore skipped)"
echo " - Restoring cron jobs..."
./restore_cron_jobs.sh
./scripts/generic/restore_cron_jobs.sh
echo " - Enabling services..."
sudo systemctl enable --now cronie.service
echo " - Removing unwanted stuf..."
./scripts/omarchy-specific/remove_bloat.sh
echo ""
echo "========================================"
echo " Omarchy Setup Complete!"