diff options
| author | Don Williams <don.e.williams@gmail.com> | 2026-07-22 02:44:02 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:40:35 -0700 |
| commit | 0d081f3aa56a0a137b1f00c83b1e7cb6dea79500 (patch) | |
| tree | a07e7f6fb0fe034f4e5d41144e7f42caa81df377 /config/hypr/scripts/DarkLight.sh | |
| parent | 724c31c02cf8f6a46040fa17ce0b5902708bee2b (diff) | |
Moved default config kitty/ghostty to UserConfigs
Updated scripts and set eclusion in lua mgiration script to preseve them
Signed-off-by: Don Williams <don.e.williams@gmail.com>
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
Diffstat (limited to 'config/hypr/scripts/DarkLight.sh')
| -rwxr-xr-x | config/hypr/scripts/DarkLight.sh | 39 |
1 files changed, 32 insertions, 7 deletions
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 |
