aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/UserScripts/ZshChangeTheme.sh
diff options
context:
space:
mode:
authorJa.KooLit <jimmielovejay@gmail.com>2023-12-29 15:44:57 +0900
committerGitHub <noreply@github.com>2023-12-29 15:44:57 +0900
commit2c070b5bfb2de84abed8a4cd45e999999021db38 (patch)
treeab297f40d72eab1dad7506e005cec1654f942ff6 /config/hypr/UserScripts/ZshChangeTheme.sh
parent76672ae5a6ac03c416bc705d51dec363f88b7a40 (diff)
parent69772de8b00a85a7da8e3d56c802fcfd01affe1c (diff)
Merge pull request #106 from JaKooLit/development
Development to Main for v2.2.2 Changes
Diffstat (limited to 'config/hypr/UserScripts/ZshChangeTheme.sh')
-rwxr-xr-xconfig/hypr/UserScripts/ZshChangeTheme.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/config/hypr/UserScripts/ZshChangeTheme.sh b/config/hypr/UserScripts/ZshChangeTheme.sh
new file mode 100755
index 00000000..7057ed2e
--- /dev/null
+++ b/config/hypr/UserScripts/ZshChangeTheme.sh
@@ -0,0 +1,38 @@
+#!/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-zsh-theme.rasi"
+
+menu() {
+ for theme in "${themes_array[@]}"; do
+ echo "$theme"
+ done
+}
+
+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
+ 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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage