350fb4fe59
Profile-based dotfiles with switchable color themes. Structure: profiles/ with themes/ and config/ per profile.
23 lines
614 B
Bash
Executable File
23 lines
614 B
Bash
Executable File
#!/bin/bash
|
|
THEMES_DIR="$HOME/.active_profile/themes"
|
|
|
|
mapfile -t themes < <(ls -d "$THEMES_DIR"/*/ 2>/dev/null | xargs -n1 basename | sort)
|
|
|
|
if [[ ${#themes[@]} -eq 0 ]]; then
|
|
echo "No themes found in $THEMES_DIR"
|
|
exit 1
|
|
fi
|
|
|
|
current=$(basename "$(readlink "$HOME/.active_theme" 2>/dev/null)" || echo "${themes[0]}")
|
|
next_index=0
|
|
for i in "${!themes[@]}"; do
|
|
if [[ "${themes[$i]}" == "$current" ]]; then
|
|
next_index=$(( (i + 1) % ${#themes[@]} ))
|
|
break
|
|
fi
|
|
done
|
|
|
|
next="${themes[$next_index]}"
|
|
ln -sfn "$HOME/.active_profile/themes/$next" "$HOME/.active_theme"
|
|
~/.config/wal/reload.sh
|