feat(kitty): добавлен stow-пакет с конфигом и темой kitty
- Зачем:
- конфиг kitty не был под контролем версий, а свёрнутый stow-каталог
приводил бы к попаданию рантайм-файлов kitty в репозиторий.
- Что:
- добавлен пакет kitty с минимальным kitty.conf и current-theme.conf
вместо 112 КБ sample-конфига от старой версии.
- в install.sh kitty добавлен в PACKAGES, а ~/.config/kitty создаётся
заранее настоящим каталогом, чтобы stow линковал по файлам.
- тест folding переведён с невыпиленного zed на kitty, устаревшая
проверка ~/.config/zed в тесте миграции заменена на assert_not_exists.
- Проверка:
- bash tests/test_install.sh
This commit is contained in:
1 parent
962012204a
commit
91592c5893
5 files changed
+96
-10
No files matched your search
@@ -52,6 +52,7 @@ Chezmoi использует отдельный source dir `chezmoi/` внутр
|
|||||||
| `tmux` | Два префикса (`Ctrl+b`, `Ctrl+Space`), vi-режим, split по `\|` / `-` |
|
| `tmux` | Два префикса (`Ctrl+b`, `Ctrl+Space`), vi-режим, split по `\|` / `-` |
|
||||||
| `vim` | Минимальный .vimrc без плагинов, 2 пробела, leader = `Space` |
|
| `vim` | Минимальный .vimrc без плагинов, 2 пробела, leader = `Space` |
|
||||||
| `wezterm` | Общий для Linux и Windows конфиг: одинаковые оформление и горячие клавиши |
|
| `wezterm` | Общий для Linux и Windows конфиг: одинаковые оформление и горячие клавиши |
|
||||||
|
| `kitty` | `kitty.conf` и тема; `~/.config/kitty` остаётся настоящим каталогом, чтобы файлы kitty не попадали в репозиторий |
|
||||||
| `zed` | Конфигурация Zed редактора |
|
| `zed` | Конфигурация Zed редактора |
|
||||||
| `vscode` | `server-env-setup` для VS Code Server в WSL: секреты + авто-прокси |
|
| `vscode` | `server-env-setup` для VS Code Server в WSL: секреты + авто-прокси |
|
||||||
|
|
||||||
|
|||||||
+9
-1
@@ -302,7 +302,7 @@ if ! command -v "$STOW_BIN" &>/dev/null; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PACKAGES=(bash tmux vim wezterm vscode agents codex gemini proxy-client)
|
PACKAGES=(bash tmux vim wezterm kitty vscode agents codex gemini proxy-client)
|
||||||
AVAILABLE_PACKAGES=()
|
AVAILABLE_PACKAGES=()
|
||||||
|
|
||||||
info "Применяю stow пакеты..."
|
info "Применяю stow пакеты..."
|
||||||
@@ -333,6 +333,14 @@ if [ -d "$HOME/.config" ] && [ ! -L "$HOME/.config" ] \
|
|||||||
mkdir -p "$HOME/.config/proxy-client"
|
mkdir -p "$HOME/.config/proxy-client"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# ~/.config/kitty создаётся заранее настоящим каталогом, чтобы stow не свернул
|
||||||
|
# его в один симлинк: kitty пишет туда свои файлы (kitty.conf.bak от
|
||||||
|
# `kitten themes`), и при свёрнутом каталоге они попадали бы в репозиторий.
|
||||||
|
if [ -d "$HOME/.config" ] && [ ! -L "$HOME/.config" ] \
|
||||||
|
&& [ ! -L "$HOME/.config/kitty" ]; then
|
||||||
|
mkdir -p "$HOME/.config/kitty"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${#AVAILABLE_PACKAGES[@]}" -gt 0 ]; then
|
if [ "${#AVAILABLE_PACKAGES[@]}" -gt 0 ]; then
|
||||||
stow_package "${AVAILABLE_PACKAGES[@]}"
|
stow_package "${AVAILABLE_PACKAGES[@]}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
# vim:ft=kitty
|
||||||
|
|
||||||
|
## name: Adwaita dark
|
||||||
|
## license: MIT
|
||||||
|
## author: Emil Löfquist (https://github.com/ewal)
|
||||||
|
## upstream: https://github.com/ewal/kitty-adwaita/blob/main/adwaita_dark.conf
|
||||||
|
## blurb: Adwaita dark - based on https://github.com/Mofiqul/adwaita.nvim
|
||||||
|
|
||||||
|
background #1d1d20
|
||||||
|
foreground #deddda
|
||||||
|
|
||||||
|
selection_background #303030
|
||||||
|
selection_foreground #c0bfbc
|
||||||
|
|
||||||
|
url_color #1a5fb4
|
||||||
|
|
||||||
|
wayland_titlebar_color system
|
||||||
|
macos_titlebar_color system
|
||||||
|
|
||||||
|
cursor #deddda
|
||||||
|
cursor_text_color #1d1d20
|
||||||
|
|
||||||
|
active_border_color #4f4f4f
|
||||||
|
inactive_border_color #282828
|
||||||
|
bell_border_color #ed333b
|
||||||
|
visual_bell_color none
|
||||||
|
|
||||||
|
active_tab_background #242424
|
||||||
|
active_tab_foreground #fcfcfc
|
||||||
|
inactive_tab_background #303030
|
||||||
|
inactive_tab_foreground #b0afac
|
||||||
|
tab_bar_background none
|
||||||
|
tab_bar_margin_color none
|
||||||
|
|
||||||
|
color0 #1d1d20
|
||||||
|
color1 #ed333b
|
||||||
|
color2 #57e389
|
||||||
|
color3 #ff7800
|
||||||
|
color4 #62a0ea
|
||||||
|
color5 #9141ac
|
||||||
|
color6 #5bc8af
|
||||||
|
color7 #deddda
|
||||||
|
|
||||||
|
color8 #9a9996
|
||||||
|
color9 #f66151
|
||||||
|
color10 #8ff0a4
|
||||||
|
color11 #ffa348
|
||||||
|
color12 #99c1f1
|
||||||
|
color13 #dc8add
|
||||||
|
color14 #93ddc2
|
||||||
|
color15 #f6f5f4
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# vim:fileencoding=utf-8:ft=kitty
|
||||||
|
|
||||||
|
# Только собственные настройки. Полный образец опций с комментариями:
|
||||||
|
# kitty +runpy 'from kitty.config import commented_out_default_config; print(commented_out_default_config())'
|
||||||
|
|
||||||
|
font_family family="JetBrains Mono"
|
||||||
|
bold_font auto
|
||||||
|
italic_font auto
|
||||||
|
bold_italic_font auto
|
||||||
|
|
||||||
|
# Блок ниже перезаписывает `kitten themes`, править вручную не нужно.
|
||||||
|
# BEGIN_KITTY_THEME
|
||||||
|
# Adwaita dark
|
||||||
|
include current-theme.conf
|
||||||
|
# END_KITTY_THEME
|
||||||
+20
-9
@@ -37,7 +37,7 @@ setup_fixture() {
|
|||||||
# zed/.config/opencode и т.п.) весят гигабайты, переполняют /tmp и ломают
|
# zed/.config/opencode и т.п.) весят гигабайты, переполняют /tmp и ломают
|
||||||
# stow конфликтами, поэтому в тестовое дерево не попадает.
|
# stow конфликтами, поэтому в тестовое дерево не попадает.
|
||||||
git -C "$REPO_ROOT" ls-files -z --cached -- \
|
git -C "$REPO_ROOT" ls-files -z --cached -- \
|
||||||
install.sh bash tmux vim zed vscode agents opencode codex gemini \
|
install.sh bash tmux vim zed kitty vscode agents opencode codex gemini \
|
||||||
claude proxy-client scripts \
|
claude proxy-client scripts \
|
||||||
| tar -C "$REPO_ROOT" --null -T - -cf - \
|
| tar -C "$REPO_ROOT" --null -T - -cf - \
|
||||||
| tar -xf - -C "$repo_root"
|
| tar -xf - -C "$repo_root"
|
||||||
@@ -114,24 +114,33 @@ test_fresh_install_uses_home_target() {
|
|||||||
assert_not_exists "$fixture/.bash_custom"
|
assert_not_exists "$fixture/.bash_custom"
|
||||||
}
|
}
|
||||||
|
|
||||||
test_fresh_install_does_not_fold_config_into_zed() {
|
test_fresh_install_does_not_fold_config_into_kitty() {
|
||||||
local fixture repo_root home_dir target expected
|
local fixture repo_root home_dir target expected
|
||||||
fixture="$(setup_fixture)"
|
fixture="$(setup_fixture)"
|
||||||
repo_root="$fixture/repo"
|
repo_root="$fixture/repo"
|
||||||
home_dir="$fixture/home"
|
home_dir="$fixture/home"
|
||||||
mkdir -p "$home_dir"
|
mkdir -p "$home_dir"
|
||||||
|
|
||||||
# Неполный клон: zed остаётся единственным stow-пакетом с каталогом .config.
|
# Неполный клон: kitty остаётся единственным stow-пакетом с каталогом .config.
|
||||||
mv "$repo_root/proxy-client" "$fixture/proxy-client-disabled"
|
mv "$repo_root/proxy-client" "$fixture/proxy-client-disabled"
|
||||||
|
|
||||||
run_install "$repo_root" "$home_dir" env WSL_DISTRO_NAME= INSTALL_INTERACTIVE_MODE=never >"$fixture/install.out"
|
run_install "$repo_root" "$home_dir" env WSL_DISTRO_NAME= INSTALL_INTERACTIVE_MODE=never >"$fixture/install.out"
|
||||||
|
|
||||||
[ -d "$home_dir/.config" ] || fail "Expected ~/.config directory"
|
[ -d "$home_dir/.config" ] || fail "Expected ~/.config directory"
|
||||||
[ ! -L "$home_dir/.config" ] || fail "Expected ~/.config to stay a real directory"
|
[ ! -L "$home_dir/.config" ] || fail "Expected ~/.config to stay a real directory"
|
||||||
[ -L "$home_dir/.config/zed" ] || fail "Expected ~/.config/zed symlink"
|
# Каталог остаётся настоящим, симлинки ставятся по файлам: kitty пишет в
|
||||||
target="$(readlink -f "$home_dir/.config/zed")"
|
# ~/.config/kitty свои файлы, и они не должны попадать в репозиторий.
|
||||||
expected="$(readlink -f "$repo_root/zed/.config/zed")"
|
[ -d "$home_dir/.config/kitty" ] || fail "Expected ~/.config/kitty directory"
|
||||||
[ "$target" = "$expected" ] || fail "~/.config/zed points to $target, expected $expected"
|
[ ! -L "$home_dir/.config/kitty" ] || fail "Expected ~/.config/kitty to stay a real directory"
|
||||||
|
[ -L "$home_dir/.config/kitty/kitty.conf" ] || fail "Expected ~/.config/kitty/kitty.conf symlink"
|
||||||
|
[ -L "$home_dir/.config/kitty/current-theme.conf" ] || fail "Expected ~/.config/kitty/current-theme.conf symlink"
|
||||||
|
target="$(readlink -f "$home_dir/.config/kitty/kitty.conf")"
|
||||||
|
expected="$(readlink -f "$repo_root/kitty/.config/kitty/kitty.conf")"
|
||||||
|
[ "$target" = "$expected" ] || fail "~/.config/kitty/kitty.conf points to $target, expected $expected"
|
||||||
|
|
||||||
|
# Файл, созданный kitty рядом с управляемыми, остаётся вне репозитория.
|
||||||
|
printf '%s\n' '# backup' > "$home_dir/.config/kitty/kitty.conf.bak"
|
||||||
|
assert_not_exists "$repo_root/kitty/.config/kitty/kitty.conf.bak"
|
||||||
}
|
}
|
||||||
|
|
||||||
test_migrates_legacy_zed_config_symlink() {
|
test_migrates_legacy_zed_config_symlink() {
|
||||||
@@ -155,7 +164,9 @@ test_migrates_legacy_zed_config_symlink() {
|
|||||||
|
|
||||||
[ -d "$home_dir/.config" ] || fail "Expected migrated ~/.config directory"
|
[ -d "$home_dir/.config" ] || fail "Expected migrated ~/.config directory"
|
||||||
[ ! -L "$home_dir/.config" ] || fail "Expected migrated ~/.config to stop being a symlink"
|
[ ! -L "$home_dir/.config" ] || fail "Expected migrated ~/.config to stop being a symlink"
|
||||||
[ -L "$home_dir/.config/zed" ] || fail "Expected managed ~/.config/zed symlink"
|
# zed больше не stow-пакет (см. PACKAGES), поэтому после миграции каталог
|
||||||
|
# zed остаётся в репозитории и в ~/.config не появляется.
|
||||||
|
assert_not_exists "$home_dir/.config/zed"
|
||||||
[ -d "$home_dir/.config/btop" ] || fail "Expected btop config to be migrated"
|
[ -d "$home_dir/.config/btop" ] || fail "Expected btop config to be migrated"
|
||||||
[ ! -L "$home_dir/.config/btop" ] || fail "Expected btop config outside the repository"
|
[ ! -L "$home_dir/.config/btop" ] || fail "Expected btop config outside the repository"
|
||||||
[ -f "$home_dir/.config/proxy-client/default.url" ] || fail "Expected profile to be migrated"
|
[ -f "$home_dir/.config/proxy-client/default.url" ] || fail "Expected profile to be migrated"
|
||||||
@@ -527,7 +538,7 @@ main() {
|
|||||||
command -v stow >/dev/null 2>&1 || fail "stow is required for tests"
|
command -v stow >/dev/null 2>&1 || fail "stow is required for tests"
|
||||||
|
|
||||||
test_fresh_install_uses_home_target
|
test_fresh_install_uses_home_target
|
||||||
test_fresh_install_does_not_fold_config_into_zed
|
test_fresh_install_does_not_fold_config_into_kitty
|
||||||
test_migrates_legacy_zed_config_symlink
|
test_migrates_legacy_zed_config_symlink
|
||||||
test_stops_legacy_migration_when_listing_fails
|
test_stops_legacy_migration_when_listing_fails
|
||||||
test_does_not_migrate_unrelated_config_symlink
|
test_does_not_migrate_unrelated_config_symlink
|
||||||
|
|||||||
Reference in new issue
Block a user