aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr
diff options
context:
space:
mode:
authorJa.KooLit <jimmielovejay@gmail.com>2023-12-23 15:38:13 +0900
committerGitHub <noreply@github.com>2023-12-23 15:38:13 +0900
commit3c9423451a0662b6fc78b74f72ca80ccdefe2e18 (patch)
tree6903c5103988e3b7a73e226c2c6f432f0dccba54 /config/hypr
parentecbdf16080e48898e7d94a6337963967497b76fa (diff)
parent5476b388070e168be16b0f49293b1413912e4def (diff)
Merge pull request #95 from hyprhex/main
Add script to switch oh-my-zsh themes
Diffstat (limited to 'config/hypr')
-rw-r--r--config/hypr/configs/Keybinds.conf3
-rwxr-xr-xconfig/hypr/scripts/ZshChangeTheme.sh38
2 files changed, 40 insertions, 1 deletions
diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf
index b5f565b3..ca27a735 100644
--- a/config/hypr/configs/Keybinds.conf
+++ b/config/hypr/configs/Keybinds.conf
@@ -40,6 +40,7 @@ bind = $mainMod SHIFT, B, exec, $scriptsDir/ChangeBlur.sh # Toggle blur settings
bind = $mainMod SHIFT, G, exec, $scriptsDir/GameMode.sh
bind = CTRL ALT, W, exec, $scriptsDir/Wallpaper.sh
bind = $mainMod, W, exec, $scriptsDir/WallpaperSelect.sh
+bind = $mainMod SHIFT, O, exec, $scriptsDir/ChangeTheme.sh # Change oh-my-zsh theme
bind = $mainMod ALT, K, exec, $scriptsDir/SwitchKeyboardLayout.sh
bind = $mainMod ALT, R, exec, $scriptsDir/Refresh.sh
@@ -183,4 +184,4 @@ bind = $mainMod ALT, P, submap, passthru
submap = passthru
# to unbind
bind = $mainMod ALT, P, submap, reset
-submap = reset \ No newline at end of file
+submap = reset
diff --git a/config/hypr/scripts/ZshChangeTheme.sh b/config/hypr/scripts/ZshChangeTheme.sh
new file mode 100755
index 00000000..7057ed2e
--- /dev/null
+++ b/config/hypr/scripts/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