diff options
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/ChangeTheme.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/config/hypr/scripts/ChangeTheme.sh b/config/hypr/scripts/ChangeTheme.sh new file mode 100755 index 00000000..3b7ad3d4 --- /dev/null +++ b/config/hypr/scripts/ChangeTheme.sh @@ -0,0 +1,35 @@ +#!/bin/bash + + +themes_dir="$HOME/.oh-my-zsh/themes" +file_extension=".zsh-theme" + +themes_array=($(find "$themes_dir" -type f -name "*$file_extension" -exec basename {} \; | sed -e "s/$file_extension//")) + + +rofi_command="rofi -dmenu -config ~/.config/rofi/config-themezsh.rasi" + +menu() { + for theme in "${themes_array[@]}"; do + echo "$theme" + done +} + +main() { + choice=$(menu | ${rofi_command}) + zsh_path="$HOME/.zshrc" + var_name="ZSH_THEME" + for i in "${themes_array[@]}"; do + if [[ "$i" == "$choice"* ]]; then + if [ -f "$zsh_path" ]; then + sed -i "s/^$var_name=.*/$var_name=\"$i\"/" "$zsh_path" + else + echo "File not found" + fi + break + fi + done + +} + +main |
