Make an atomic swap of the theme directories

This commit is contained in:
David Heinemeier Hansson
2026-01-01 12:52:04 -07:00
parent 79b31144d0
commit b95a4a44df
2 changed files with 12 additions and 7 deletions

View File

@@ -1,8 +1,8 @@
#!/bin/bash
TEMPLATES_DIR="$OMARCHY_PATH/themes/templates.d"
CURRENT_THEME_DIR="$HOME/.config/omarchy/current/theme"
COLORS_FILE="$CURRENT_THEME_DIR/colors.toml"
NEXT_THEME_DIR="$HOME/.config/omarchy/current/next-theme"
COLORS_FILE="$NEXT_THEME_DIR/colors.toml"
# Only generate dynamic templates for themes with a colors.toml definition
if [[ -f $COLORS_FILE ]]; then
@@ -14,7 +14,7 @@ if [[ -f $COLORS_FILE ]]; then
shopt -s nullglob
for tpl in "$TEMPLATES_DIR"/*.tpl; do
filename=$(basename "$tpl" .tpl)
output_path="$CURRENT_THEME_DIR/$filename"
output_path="$NEXT_THEME_DIR/$filename"
# Don't overwrite configs already exists in the output directory (copied from theme specific folder)
if [[ ! -f $output_path ]]; then