diff --git a/private_dot_config/kitty/private_executable_apply-theme-mode.sh b/private_dot_config/kitty/private_executable_apply-theme-mode.sh index b5283cf..6b97eff 100644 --- a/private_dot_config/kitty/private_executable_apply-theme-mode.sh +++ b/private_dot_config/kitty/private_executable_apply-theme-mode.sh @@ -1,7 +1,7 @@ #!/bin/sh # Regenerate the *-theme.auto.conf files kitty reads at startup from the -# canonical themes in ./themes, honouring the mode recorded in ./theme-mode: +# canonical themes in ./theme-modes, honouring the mode recorded in ./theme-mode: # # auto every appearance keeps its own theme, so kitty follows the OS # light every appearance gets the light theme, so kitty stays light @@ -10,7 +10,8 @@ # kitty gives the automatic theme files priority over everything else -- includes # and even --override -- so pinning a mode means writing the wanted theme into # whichever file the OS makes kitty pick. That is why the real themes live in -# ./themes and these three files are generated. +# ./theme-modes and these three files are generated. (./themes is separate: +# that is where the themes kitten looks for user themes.) set -eu @@ -32,7 +33,7 @@ file_mode() { script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" config_dir=${1:-"$script_dir"} -canonical_dir="$config_dir/themes" +canonical_dir="$config_dir/theme-modes" mode_file="$config_dir/theme-mode" mode=auto diff --git a/private_dot_config/kitty/private_tests/private_executable_test_theme_mode.sh b/private_dot_config/kitty/private_tests/private_executable_test_theme_mode.sh index b9b57de..567998f 100644 --- a/private_dot_config/kitty/private_tests/private_executable_test_theme_mode.sh +++ b/private_dot_config/kitty/private_tests/private_executable_test_theme_mode.sh @@ -1,7 +1,7 @@ #!/bin/sh # Behavioural regression for the remembered light/dark mode: -# - apply-theme-mode.sh generates the automatic theme files from ./themes +# - apply-theme-mode.sh generates the automatic theme files from ./theme-modes # - a pinned mode puts one theme in all three, so kitty starts in it # - `theme auto` restores per-appearance themes without losing any # - `kitten themes` changes are captured even while a mode is pinned @@ -16,7 +16,7 @@ trap 'rm -rf "$tmpdir"' EXIT HUP INT TERM config_dir="$tmpdir/config" fake_bin="$tmpdir/bin" -mkdir -p "$config_dir/themes" "$fake_bin" +mkdir -p "$config_dir/theme-modes" "$fake_bin" DARK='#111111' LIGHT='#eeeeee' @@ -24,11 +24,11 @@ NOPREF='#222222' NEW_LIGHT='#abcdef' printf 'background %s\nmacos_titlebar_color background\n' "$DARK" \ - >"$config_dir/themes/dark.conf" + >"$config_dir/theme-modes/dark.conf" printf 'background %s\nmacos_titlebar_color background\n' "$LIGHT" \ - >"$config_dir/themes/light.conf" + >"$config_dir/theme-modes/light.conf" printf 'background %s\nmacos_titlebar_color background\n' "$NOPREF" \ - >"$config_dir/themes/no-preference.conf" + >"$config_dir/theme-modes/no-preference.conf" bg() { awk '/^background/ { print $2; exit }' "$1" @@ -103,7 +103,7 @@ printf '#!/bin/sh\nexit 0\n' >"$fake_bin/kitty" chmod +x "$fake_bin/kitten" "$fake_bin/kitty" run_fish light 'theme dark >/dev/null; kitten themes' >/dev/null -expect "captured new light theme" "$config_dir/themes/light.conf" "$NEW_LIGHT" +expect "captured new light theme" "$config_dir/theme-modes/light.conf" "$NEW_LIGHT" expect "pin still held after kitten themes" \ "$config_dir/light-theme.auto.conf" "$DARK" [ "$(tr -d ' \n' <"$config_dir/theme-mode")" = dark ] || { @@ -115,7 +115,7 @@ run_fish light 'theme light >/dev/null' expect "new light theme is used once selected" \ "$config_dir/light-theme.auto.conf" "$NEW_LIGHT" expect "dark theme survived the whole exchange" \ - "$config_dir/themes/dark.conf" "$DARK" + "$config_dir/theme-modes/dark.conf" "$DARK" # --- a bare `theme` records auto when it lands on the macOS appearance ---- echo auto >"$config_dir/theme-mode" diff --git a/private_dot_config/kitty/theme-modes/private_dark.conf b/private_dot_config/kitty/theme-modes/private_dark.conf new file mode 100644 index 0000000..9125bf2 --- /dev/null +++ b/private_dot_config/kitty/theme-modes/private_dark.conf @@ -0,0 +1,29 @@ +background #202020 +foreground #adadad +cursor #ffffff +selection_background #1a3272 +color0 #000000 +color8 #545454 +color1 #fa5355 +color9 #fb7172 +color2 #126e00 +color10 #67ff4f +color3 #c2c300 +color11 #ffff00 +color4 #4581eb +color12 #6d9df1 +color5 #fa54ff +color13 #fb82ff +color6 #33c2c1 +color14 #60d3d1 +color7 #adadad +color15 #eeeeee +selection_foreground #202020 + +# START_AUTOGENERATED_TAB_STYLE +# Feel free to update these colors manually and remove these comments. +active_tab_foreground #eeeeee +active_tab_background #1a3272 +inactive_tab_foreground #adadad +inactive_tab_background #1a1a1a +# END_AUTOGENERATED_TAB_STYLE diff --git a/private_dot_config/kitty/themes/private_light.conf b/private_dot_config/kitty/theme-modes/private_light.conf similarity index 100% rename from private_dot_config/kitty/themes/private_light.conf rename to private_dot_config/kitty/theme-modes/private_light.conf diff --git a/private_dot_config/kitty/themes/private_no-preference.conf b/private_dot_config/kitty/theme-modes/private_no-preference.conf similarity index 100% rename from private_dot_config/kitty/themes/private_no-preference.conf rename to private_dot_config/kitty/theme-modes/private_no-preference.conf diff --git a/private_dot_config/kitty/grokday.conf b/private_dot_config/kitty/themes/GrokDay.conf similarity index 83% rename from private_dot_config/kitty/grokday.conf rename to private_dot_config/kitty/themes/GrokDay.conf index c4f745e..9e335d5 100644 --- a/private_dot_config/kitty/grokday.conf +++ b/private_dot_config/kitty/themes/GrokDay.conf @@ -1,3 +1,9 @@ +## name: GrokDay +## author: xAI (grok build), ported by Anton +## license: see https://github.com/xai-org/grok-build +## upstream: https://github.com/xai-org/grok-build/blob/main/crates/codegen/xai-grok-pager-render/src/theme/grokday.rs +## blurb: The GrokDay theme from grok build's TUI: light counterpart with deepened accents. + # GrokDay — neutral light gray base with deepened accents. # # Ported from grok build's TUI theme: diff --git a/private_dot_config/kitty/groknight.conf b/private_dot_config/kitty/themes/GrokNight.conf similarity index 84% rename from private_dot_config/kitty/groknight.conf rename to private_dot_config/kitty/themes/GrokNight.conf index f99f724..c8c5519 100644 --- a/private_dot_config/kitty/groknight.conf +++ b/private_dot_config/kitty/themes/GrokNight.conf @@ -1,3 +1,9 @@ +## name: GrokNight +## author: xAI (grok build), ported by Anton +## license: see https://github.com/xai-org/grok-build +## upstream: https://github.com/xai-org/grok-build/blob/main/crates/codegen/xai-grok-pager-render/src/theme/groknight.rs +## blurb: The GrokNight theme from grok build's TUI: neutral gray base with TokyoNight accents. + # GrokNight — neutral gray base with TokyoNight accents. # # Ported from grok build's TUI theme: diff --git a/private_dot_config/kitty/themes/private_dark.conf b/private_dot_config/kitty/themes/private_dark.conf deleted file mode 100644 index fc08e36..0000000 --- a/private_dot_config/kitty/themes/private_dark.conf +++ /dev/null @@ -1,31 +0,0 @@ -background #1c2836 -foreground #ffffff -cursor #bbbbbb -selection_background #b4d5ff -color0 #000000 -color8 #545454 -color1 #f9555f -color9 #fa8b8e -color2 #20af89 -color10 #34bb99 -color3 #fdf029 -color11 #ffff55 -color4 #589cf5 -color12 #589cf5 -color5 #934d95 -color13 #e75598 -color6 #1e9ee6 -color14 #3978bb -color7 #bbbbbb -color15 #ffffff -selection_foreground #1c2836 - -# START_AUTOGENERATED_TAB_STYLE -# Feel free to update these colors manually and remove these comments. -active_tab_foreground #1c2836 -active_tab_background #2e84e6 -inactive_tab_foreground #2e84e6 -inactive_tab_background #1c2836 -# END_AUTOGENERATED_TAB_STYLE - -macos_titlebar_color background diff --git a/private_dot_config/private_fish/functions/private_kitten.fish b/private_dot_config/private_fish/functions/private_kitten.fish index 0d79299..767a345 100644 --- a/private_dot_config/private_fish/functions/private_kitten.fish +++ b/private_dot_config/private_fish/functions/private_kitten.fish @@ -9,7 +9,7 @@ function kitten --description 'Run kitten and restore Kitty theme overrides' set is_themes true end - # The automatic theme files are generated from $config_dir/themes, so record + # The automatic theme files are generated from $config_dir/theme-modes, so record # their state first: whichever one the kitten rewrites is the theme just # chosen for that appearance, and has to be captured before the mode is # re-applied over the top of it. @@ -41,9 +41,9 @@ function kitten --description 'Run kitten and restore Kitty theme overrides' test "$now" = "$before[$index]" and continue - command mkdir -p "$config_dir/themes" + command mkdir -p "$config_dir/theme-modes" or return $status - command cp "$file" "$config_dir/themes/$appearance.conf" + command cp "$file" "$config_dir/theme-modes/$appearance.conf" or return $status end diff --git a/run_after_kitty-theme-mode.sh b/run_after_kitty-theme-mode.sh index 1f9a742..269e7c0 100755 --- a/run_after_kitty-theme-mode.sh +++ b/run_after_kitty-theme-mode.sh @@ -1,6 +1,6 @@ #!/bin/sh -# The kitty *-theme.auto.conf files are generated from .config/kitty/themes and +# The kitty *-theme.auto.conf files are generated from .config/kitty/theme-modes and # the per-machine .config/kitty/theme-mode, both of which .chezmoiignore keeps # out of the source state. Regenerate them here so a freshly applied machine # ends up with theme files kitty can read. @@ -15,7 +15,7 @@ apply="$config_dir/apply-theme-mode.sh" # Nothing to do on machines without this kitty config applied. [ -x "$apply" ] || exit 0 -[ -d "$config_dir/themes" ] || exit 0 +[ -d "$config_dir/theme-modes" ] || exit 0 # Never let a theming problem fail the whole apply. if ! "$apply" "$config_dir"; then