consistent styling
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
# Scaffold a new theme directory (basic/.config/themes/scripts/new-theme.sh).
|
||||
#
|
||||
# Usage: new-theme.sh <theme-id> e.g. new-theme.sh rose-pine-moon
|
||||
#
|
||||
# Copies themes/catppuccin-mocha as a template. Afterwards:
|
||||
# 1. Replace every palette value in the new directory.
|
||||
# 2. Add one row to themes/registry.conf.
|
||||
# 3. Run scripts/switch-theme.sh <theme-id> to try it.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../.." && pwd)"
|
||||
THEMES_DIR="$REPO_ROOT/basic/.config/themes/themes"
|
||||
|
||||
[[ $# -eq 1 ]] || { echo "usage: $(basename "$0") <theme-id>" >&2; exit 1; }
|
||||
theme_id="$1"
|
||||
if [[ ! "$theme_id" =~ ^[a-z0-9][a-z0-9-]*$ ]]; then
|
||||
echo "error: invalid theme-id '$theme_id'" >&2
|
||||
exit 1
|
||||
fi
|
||||
[[ -e "$THEMES_DIR/$theme_id" ]] && { echo "error: $theme_id already exists" >&2; exit 1; }
|
||||
|
||||
cp -r "$THEMES_DIR/catppuccin-mocha" "$THEMES_DIR/$theme_id"
|
||||
echo "scaffolded $THEMES_DIR/$theme_id"
|
||||
echo "next: replace the palette values, add a registry.conf row, run switch-theme.sh $theme_id"
|
||||
Reference in New Issue
Block a user