From 064bfbb969fd0dfeffab21e3d9c2fe147ff5f6b6 Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" Date: Sat, 23 Dec 2023 15:26:35 +0900 Subject: [PATCH] Update and rename ChangeTheme.sh to ZshChangeTheme.sh Script is also updated to exit if no choice have been selected as previous script is changing to 3den, which is the first choice on my system --- .../scripts/{ChangeTheme.sh => ZshChangeTheme.sh} | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) rename config/hypr/scripts/{ChangeTheme.sh => ZshChangeTheme.sh} (79%) diff --git a/config/hypr/scripts/ChangeTheme.sh b/config/hypr/scripts/ZshChangeTheme.sh similarity index 79% rename from config/hypr/scripts/ChangeTheme.sh rename to config/hypr/scripts/ZshChangeTheme.sh index 3b7ad3d..7057ed2 100755 --- a/config/hypr/scripts/ChangeTheme.sh +++ b/config/hypr/scripts/ZshChangeTheme.sh @@ -1,13 +1,11 @@ #!/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" +rofi_command="rofi -dmenu -config ~/.config/rofi/config-zsh-theme.rasi" menu() { for theme in "${themes_array[@]}"; do @@ -17,6 +15,12 @@ menu() { main() { choice=$(menu | ${rofi_command}) + + # if nothing selected, script wont change anything + if [ -z "$choice" ]; then + exit 0 + fi + zsh_path="$HOME/.zshrc" var_name="ZSH_THEME" for i in "${themes_array[@]}"; do @@ -29,7 +33,6 @@ main() { break fi done - } main