From 0d081f3aa56a0a137b1f00c83b1e7cb6dea79500 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 22 Jul 2026 02:44:02 -0400 Subject: Moved default config kitty/ghostty to UserConfigs Updated scripts and set eclusion in lua mgiration script to preseve them Signed-off-by: Don Williams On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: CHANGELOG.md modified: config/hypr/scripts/DarkLight.sh modified: config/hypr/scripts/Ghostty_themes.sh modified: config/hypr/scripts/Kitty_themes.sh modified: scripts/migrate-hypr-to-lua.sh --- config/hypr/scripts/DarkLight.sh | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'config/hypr/scripts/DarkLight.sh') diff --git a/config/hypr/scripts/DarkLight.sh b/config/hypr/scripts/DarkLight.sh index 16f1a4ef..e8e69910 100755 --- a/config/hypr/scripts/DarkLight.sh +++ b/config/hypr/scripts/DarkLight.sh @@ -25,7 +25,9 @@ theme_state_dir="${XDG_STATE_HOME:-$HOME/.local/state}/hypr" theme_state_file="$theme_state_dir/theme_mode" legacy_theme_state_file="$HOME/.cache/.theme_mode" -kitty_conf="${XDG_CONFIG_HOME:-$HOME/.config}/kitty/kitty.conf" +user_kitty_conf="${XDG_CONFIG_HOME:-$HOME/.config}/hypr/UserConfigs/kitty.conf" +fallback_kitty_conf="${XDG_CONFIG_HOME:-$HOME/.config}/kitty/kitty.conf" +kitty_conf="$user_kitty_conf" wallust_config="${XDG_CONFIG_HOME:-$HOME/.config}/wallust/wallust.toml" pallete_dark="dark16" @@ -39,6 +41,24 @@ notify_enabled=1 preserve_wallpaper=0 forced_mode="" +ensure_managed_kitty_conf() { + if [[ -f "$user_kitty_conf" && -r "$user_kitty_conf" ]]; then + kitty_conf="$user_kitty_conf" + return 0 + fi + + if [[ -r "$fallback_kitty_conf" ]]; then + mkdir -p "$(dirname "$user_kitty_conf")" 2>/dev/null || true + cp -f "$fallback_kitty_conf" "$user_kitty_conf" 2>/dev/null || true + if [[ -f "$user_kitty_conf" && -r "$user_kitty_conf" ]]; then + kitty_conf="$user_kitty_conf" + return 0 + fi + fi + + kitty_conf="$fallback_kitty_conf" +} + normalize_mode() { case "$1" in Dark|Light) printf '%s' "$1" ;; @@ -185,14 +205,19 @@ if command -v ags >/dev/null 2>&1; then fi # kitty background color change +ensure_managed_kitty_conf if [ "$next_mode" = "Dark" ]; then - sed -i '/^foreground /s/^foreground .*/foreground #dddddd/' "${kitty_conf}" - sed -i '/^background /s/^background .*/background #000000/' "${kitty_conf}" - sed -i '/^cursor /s/^cursor .*/cursor #dddddd/' "${kitty_conf}" + if [[ -w "$kitty_conf" ]]; then + sed -i '/^foreground /s/^foreground .*/foreground #dddddd/' "${kitty_conf}" + sed -i '/^background /s/^background .*/background #000000/' "${kitty_conf}" + sed -i '/^cursor /s/^cursor .*/cursor #dddddd/' "${kitty_conf}" + fi else - sed -i '/^foreground /s/^foreground .*/foreground #000000/' "${kitty_conf}" - sed -i '/^background /s/^background .*/background #dddddd/' "${kitty_conf}" - sed -i '/^cursor /s/^cursor .*/cursor #000000/' "${kitty_conf}" + if [[ -w "$kitty_conf" ]]; then + sed -i '/^foreground /s/^foreground .*/foreground #000000/' "${kitty_conf}" + sed -i '/^background /s/^background .*/background #dddddd/' "${kitty_conf}" + sed -i '/^cursor /s/^cursor .*/cursor #000000/' "${kitty_conf}" + fi fi for pid_kitty in $(pidof kitty); do -- cgit v1.2.3