refactor: clean up and rename binaries

This commit is contained in:
2025-11-03 06:03:25 +02:00
parent 60834ccae1
commit 34b6439521
9 changed files with 40 additions and 204 deletions

39
config/shared/bin/sync-theme Executable file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -euo pipefail
declare -A THEME=(
["ghostty.url"]="https://raw.githubusercontent.com/triimdev/invero.nvim/refs/heads/main/extras/ghostty/invero_day"
["ghostty.dir"]="$HOME/.config/ghostty/themes"
["ghostty.name"]="Invero Day"
["wezterm.url"]="https://raw.githubusercontent.com/triimdev/invero.nvim/refs/heads/main/extras/wezterm/invero_day.toml"
["wezterm.dir"]="$HOME/.config/wezterm/colors"
["wezterm.name"]="Invero Day.toml"
)
theme="${1:-}"
if [[ -z "$theme" ]]; then
echo "Usage: $0 <theme>"
echo "Available themes: $(printf '%s\n' "${!THEME[@]}" | cut -d. -f1 | sort -u | tr '\n' ' ')"
exit 1
fi
if [[ -z "${THEME[$theme.url]+x}" ]]; then
echo "Unknown theme '$theme'. Available: $(printf '%s\n' "${!THEME[@]}" | cut -d. -f1 | sort -u | tr '\n' ' ')"
exit 1
fi
url="${THEME[$theme.url]}"
dir="${THEME[$theme.dir]}"
name="${THEME[$theme.name]}"
path="${dir}/${name}"
mkdir -p "$dir"
if curl -fsSL -o "$path" "$url"; then
echo "Theme downloaded to $path"
else
echo "Failed to download theme for '$theme'."
exit 1
fi