initial dotfiles setup
Profile-based dotfiles with switchable color themes. Structure: profiles/ with themes/ and config/ per profile.
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user