mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
No longer need omarchy-theme-next since themes are now fully rendered, not symlinks
This commit is contained in:
@@ -1,39 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Get all theme names (user themes override default by name)
|
|
||||||
declare -A seen
|
|
||||||
THEMES=()
|
|
||||||
|
|
||||||
for dir in ~/.config/omarchy/themes "$OMARCHY_PATH/themes"; do
|
|
||||||
for path in "$dir"/*/; do
|
|
||||||
[[ -d "$path" ]] || continue
|
|
||||||
name=$(basename "$path")
|
|
||||||
if [[ -z "${seen[$name]}" ]]; then
|
|
||||||
seen[$name]=1
|
|
||||||
THEMES+=("$name")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
IFS=$'\n' THEMES=($(printf '%s\n' "${THEMES[@]}" | sort))
|
|
||||||
|
|
||||||
# Get current theme name
|
|
||||||
CURRENT_THEME_NAME_PATH="$HOME/.config/omarchy/current/theme.name"
|
|
||||||
if [[ -f $CURRENT_THEME_NAME_PATH ]]; then
|
|
||||||
CURRENT=$(cat "$CURRENT_THEME_NAME_PATH")
|
|
||||||
else
|
|
||||||
CURRENT=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Find next theme
|
|
||||||
TOTAL=${#THEMES[@]}
|
|
||||||
for i in "${!THEMES[@]}"; do
|
|
||||||
if [[ "${THEMES[$i]}" == "$CURRENT" ]]; then
|
|
||||||
NEXT_INDEX=$(((i + 1) % TOTAL))
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
NEXT_INDEX=${NEXT_INDEX:-0}
|
|
||||||
|
|
||||||
omarchy-theme-set "${THEMES[$NEXT_INDEX]}"
|
|
||||||
notify-send "Theme changed to ${THEMES[$NEXT_INDEX]}" -t 2000
|
|
||||||
@@ -31,10 +31,5 @@ if [ ! -d "$THEME_PATH" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Move to the next theme if the current theme is the one being removed
|
|
||||||
if [ "$(readlink -f "$CURRENT_DIR/theme")" = "$(readlink -f "$THEME_PATH")" ]; then
|
|
||||||
omarchy-theme-next
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Now remove the theme directory for THEME_NAME
|
# Now remove the theme directory for THEME_NAME
|
||||||
rm -rf "$THEME_PATH"
|
rm -rf "$THEME_PATH"
|
||||||
|
|||||||
Reference in New Issue
Block a user