#!/bin/bash # Clone and trim omarchy scripts for archypr # This script copies all omarchy scripts, renames them (removing 'omarchy-' prefix), # and transforms variable names and paths. set -euo pipefail OMARCHY_BIN="/home/oval/.local/share/omarchy/bin" TARGET_DIR="/home/oval/archypr-config/scripts" THEMES_SOURCE="/home/oval/.local/share/omarchy/themes" THEMES_TARGET="/home/oval/archypr-config/themes/themes" echo "=== Cloning omarchy scripts ===" mkdir -p "$TARGET_DIR" count=0 # Process each omarchy script for script in "$OMARCHY_BIN"/omarchy-*; do [[ -f "$script" ]] || continue base_name=$(basename "$script") new_name="${base_name#omarchy-}" # Create a temporary file for transformation tmp_file=$(mktemp) # Perform transformations on the file content sed -E \ -e 's/OMARCHY_/ARCHYPR_/g' \ -e 's|~/.config/omarchy|~/.config/archypr|g' \ -e 's|~/.local/share/omarchy|~/.local/share/archypr|g' \ -e 's/\$OMARCHY_PATH/\$ARCHYPR_PATH/g' \ -e 's/"omarchy-/"archypr-/g' \ -e 's/ omarchy-/ archypr-/g' \ -e 's/omarchy-[a-z]/archypr-/g' \ -e 's/# omarchy:/# archypr:/g' \ -e 's/omarchy-hw-touchpad/archypr-hw-touchpad/g' \ -e 's/omarchy-swayosd-client/archypr-swayosd-client/g' \ -e 's/omarchy-w-/archypr-w-/g' \ -e 's/omarchy-m-/archypr-m-/g' \ "$script" > "$tmp_file" # Move the transformed file to target mv "$tmp_file" "$TARGET_DIR/$new_name" chmod +x "$TARGET_DIR/$new_name" ((count++)) || true done echo "Cloned $count scripts to $TARGET_DIR" echo "=== Copying omarchy themes ===" mkdir -p "$THEMES_TARGET" for theme_dir in "$THEMES_SOURCE"/*/; do [[ -d "$theme_dir" ]] || continue theme_name=$(basename "$theme_dir") cp -r "$theme_dir" "$THEMES_TARGET/$theme_name" done echo "Copied themes to $THEMES_TARGET" echo "=== Done ===" echo "Next steps:" echo " 1. Add ~/archypr-config/scripts to your PATH" echo " 2. Create ~/archypr-config/.machine-branch with machine name" echo " 3. Run backup.sh to create initial commit"