aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/Kitty_themes.sh
diff options
context:
space:
mode:
authorJa.KooLit <85185940+JaKooLit@users.noreply.github.com>2025-03-21 10:00:34 +0900
committerGitHub <noreply@github.com>2025-03-21 10:00:34 +0900
commitaf7c7389f9bdb6f8da83bd51e261ed00106eea1f (patch)
treea327f82a34d13768cb7cf5d0a3d9893cc61c3ea3 /config/hypr/scripts/Kitty_themes.sh
parentf113f871fe35acb5143e16648bcbcb2c7f675fef (diff)
parent2d927892e5354abb14b9738d895b7084452886e2 (diff)
Merge branch 'development' into main-to-dev
Diffstat (limited to 'config/hypr/scripts/Kitty_themes.sh')
-rwxr-xr-xconfig/hypr/scripts/Kitty_themes.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/config/hypr/scripts/Kitty_themes.sh b/config/hypr/scripts/Kitty_themes.sh
new file mode 100755
index 00000000..31c19a1d
--- /dev/null
+++ b/config/hypr/scripts/Kitty_themes.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
+# Kitty Themes Source https://github.com/dexpota/kitty-themes #
+
+# Define directories and variables
+kitty_themes_DiR="$HOME/.config/kitty/kitty-themes" # Kitty Themes Directory
+theme_path="$kitty_themes_DiR/$theme.conf"
+kitty_config="$HOME/.config/kitty/kitty.conf"
+iDIR="$HOME/.config/swaync/images"
+rofi_theme="$HOME/.config/rofi/config-kitty-theme.rasi"
+
+# Check if the Kitty Themes directory exists
+if [ ! -d "$kitty_themes_DiR" ]; then
+ notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Unable to locate Kitty Themes directory. Exiting....."
+ exit 1
+fi
+
+# List the kitty-theme files from the themes directory
+theme=$(ls "$kitty_themes_DiR"/*.conf | xargs -n 1 basename | sed 's/\.conf$//' | rofi -dmenu -config $rofi_theme)
+
+# Check if no theme was selected, and exit if empty
+if [ -z "$theme" ]; then
+ notify-send -u low -i "$iDIR/note.png" "No kitty theme" "selected. Exiting....."
+ exit 1
+fi
+
+# Uncomment the line that includes the kitty themes if it's commented
+if grep -q '#include ./kitty-themes/' "$kitty_config"; then
+ sed -i "s|#include ./kitty-themes/|include ./kitty-themes/$theme.conf|g" "$kitty_config"
+
+ notify-send -u low -i "$iDIR/ja.png" "$theme" "Kitty Theme Loaded"
+
+ for pid_kitty in $(pidof kitty); do
+ kill -SIGUSR1 "$pid_kitty"
+ done
+else
+ # If the line is already uncommented, just add the chosen theme
+ sed -i "s|include ./kitty-themes/.*|include ./kitty-themes/$theme.conf|g" "$kitty_config"
+
+ notify-send -u low -i "$iDIR/ja.png" "$theme" "Kitty Theme Loaded"
+
+ for pid_kitty in $(pidof kitty); do
+ kill -SIGUSR1 "$pid_kitty"
+ done
+fi
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage