From 2d5285fc5647a1877b398a918da57df1f342fd82 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 11 Jul 2025 08:57:55 -0700 Subject: [PATCH] Fix theme switcher to work with real directories in .config/omarchy/themes Not just symlinks --- bin/omarchy-theme-next | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/omarchy-theme-next b/bin/omarchy-theme-next index 40ace80..8899526 100755 --- a/bin/omarchy-theme-next +++ b/bin/omarchy-theme-next @@ -3,20 +3,22 @@ THEMES_DIR="$HOME/.config/omarchy/themes/" CURRENT_THEME_LINK="$HOME/.config/omarchy/current/theme" -THEMES=($(find "$THEMES_DIR" -mindepth 1 | sort)) +THEMES=($(find "$THEMES_DIR" -mindepth 1 -maxdepth 1 | sort)) TOTAL=${#THEMES[@]} # Get current theme from symlink if [[ -L "$CURRENT_THEME_LINK" ]]; then - CURRENT_THEME=$(readlink "$CURRENT_THEME_LINK") + CURRENT_THEME=$(realpath "$CURRENT_THEME_LINK") else # Default to first theme if no symlink exists - CURRENT_THEME=${THEMES[0]} + CURRENT_THEME=$(realpath "${THEMES[0]}") fi # Find current theme index INDEX=0 for i in "${!THEMES[@]}"; do + THEMES[$i]=$(realpath "${THEMES[$i]}") + if [[ "${THEMES[$i]}" == "$CURRENT_THEME" ]]; then INDEX=$i break