mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 20:29:24 +00:00
Fix theme switcher to work with real directories in .config/omarchy/themes
Not just symlinks
This commit is contained in:
@ -3,20 +3,22 @@
|
|||||||
THEMES_DIR="$HOME/.config/omarchy/themes/"
|
THEMES_DIR="$HOME/.config/omarchy/themes/"
|
||||||
CURRENT_THEME_LINK="$HOME/.config/omarchy/current/theme"
|
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[@]}
|
TOTAL=${#THEMES[@]}
|
||||||
|
|
||||||
# Get current theme from symlink
|
# Get current theme from symlink
|
||||||
if [[ -L "$CURRENT_THEME_LINK" ]]; then
|
if [[ -L "$CURRENT_THEME_LINK" ]]; then
|
||||||
CURRENT_THEME=$(readlink "$CURRENT_THEME_LINK")
|
CURRENT_THEME=$(realpath "$CURRENT_THEME_LINK")
|
||||||
else
|
else
|
||||||
# Default to first theme if no symlink exists
|
# Default to first theme if no symlink exists
|
||||||
CURRENT_THEME=${THEMES[0]}
|
CURRENT_THEME=$(realpath "${THEMES[0]}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Find current theme index
|
# Find current theme index
|
||||||
INDEX=0
|
INDEX=0
|
||||||
for i in "${!THEMES[@]}"; do
|
for i in "${!THEMES[@]}"; do
|
||||||
|
THEMES[$i]=$(realpath "${THEMES[$i]}")
|
||||||
|
|
||||||
if [[ "${THEMES[$i]}" == "$CURRENT_THEME" ]]; then
|
if [[ "${THEMES[$i]}" == "$CURRENT_THEME" ]]; then
|
||||||
INDEX=$i
|
INDEX=$i
|
||||||
break
|
break
|
||||||
|
Reference in New Issue
Block a user