PBKittyConfigStudio 0.1.1__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/.github/workflows/ci.yml +2 -2
  2. pbkittyconfigstudio-0.3.0/.markdownlint-cli2.yaml +10 -0
  3. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/CHANGELOG.md +83 -0
  4. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/CLAUDE.md +9 -0
  5. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/CODING.md +37 -0
  6. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/Makefile +7 -7
  7. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/PBKittyConfigStudio.spec +13 -4
  8. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/PKG-INFO +12 -4
  9. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/README.md +8 -2
  10. pbkittyconfigstudio-0.3.0/hooks/pyi_rth_fonts.py +49 -0
  11. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/pyproject.toml +12 -7
  12. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/schema_builder/extract_definition.py +43 -3
  13. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/schema_builder/merge_schema.py +8 -1
  14. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/__init__.py +1 -1
  15. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/__main__.py +47 -1
  16. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/config/schema.json +245 -0
  17. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/core/kitty_conf.py +25 -3
  18. pbkittyconfigstudio-0.3.0/src/pb_kitty_config_studio/locale/de/LC_MESSAGES/pb_kitty_config_studio.po +1295 -0
  19. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/locale/en/LC_MESSAGES/pb_kitty_config_studio.po +4 -1
  20. pbkittyconfigstudio-0.3.0/src/pb_kitty_config_studio/locale/es/LC_MESSAGES/pb_kitty_config_studio.po +1297 -0
  21. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/locale/fr/LC_MESSAGES/pb_kitty_config_studio.po +6 -3
  22. pbkittyconfigstudio-0.3.0/src/pb_kitty_config_studio/locale/it/LC_MESSAGES/pb_kitty_config_studio.po +1297 -0
  23. pbkittyconfigstudio-0.3.0/src/pb_kitty_config_studio/locale/ru/LC_MESSAGES/pb_kitty_config_studio.po +1295 -0
  24. pbkittyconfigstudio-0.3.0/src/pb_kitty_config_studio/locale/vi/LC_MESSAGES/pb_kitty_config_studio.po +1294 -0
  25. pbkittyconfigstudio-0.3.0/src/pb_kitty_config_studio/locale/zh_CN/LC_MESSAGES/pb_kitty_config_studio.po +1292 -0
  26. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/platform/auto_update.py +14 -4
  27. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/__init__.py +6 -0
  28. pbkittyconfigstudio-0.3.0/src/pb_kitty_config_studio/resources/previous.svg +1 -0
  29. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/ui/main_window.py +105 -48
  30. pbkittyconfigstudio-0.3.0/tests/fixtures/README.md +35 -0
  31. pbkittyconfigstudio-0.3.0/tests/fixtures/kitty_default.conf +2468 -0
  32. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_auto_update.py +144 -2
  33. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_desktop.py +37 -0
  34. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_i18n.py +15 -3
  35. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_kitty_conf.py +126 -0
  36. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_main.py +15 -0
  37. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_main_window.py +74 -14
  38. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_resources.py +1 -0
  39. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_schema.py +11 -0
  40. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_schema_builder_extract_definition.py +58 -0
  41. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_schema_builder_merge_schema.py +24 -0
  42. pbkittyconfigstudio-0.1.1/.markdownlint-cli2.yaml +0 -5
  43. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  44. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  45. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/.gitignore +0 -0
  46. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/.pre-commit-config.yaml +0 -0
  47. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/LICENSE +0 -0
  48. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/babel.cfg +0 -0
  49. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/hatch_build.py +0 -0
  50. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/pixi.lock +0 -0
  51. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/schema_builder/README.md +0 -0
  52. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/schema_builder/build_kitty.sh +0 -0
  53. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/schema_builder/build_schema.py +0 -0
  54. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/schema_builder/pixi.toml +0 -0
  55. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/schema_builder/rst_clean.py +0 -0
  56. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/argparse_qt.py +0 -0
  57. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/config/__init__.py +0 -0
  58. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/config/_babel_extractor.py +0 -0
  59. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/core/__init__.py +0 -0
  60. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/i18n.py +0 -0
  61. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/platform/__init__.py +0 -0
  62. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/platform/desktop.py +0 -0
  63. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/cancel.svg +0 -0
  64. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/clear-all-data.svg +0 -0
  65. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/help-about.svg +0 -0
  66. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/pbkittyconfigstudio.icns +0 -0
  67. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/pbkittyconfigstudio.ico +0 -0
  68. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/pbkittyconfigstudio.png +0 -0
  69. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/quit.svg +0 -0
  70. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/refresh.svg +0 -0
  71. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/save-as.svg +0 -0
  72. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/save.svg +0 -0
  73. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/ui/__init__.py +0 -0
  74. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/ui/about_dialog.py +0 -0
  75. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/ui/widgets.py +0 -0
  76. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/conftest.py +0 -0
  77. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_about_dialog.py +0 -0
  78. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_argparse_qt.py +0 -0
  79. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_babel_extractor.py +0 -0
  80. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_schema_builder_rst_clean.py +0 -0
  81. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tests/test_widgets.py +0 -0
  82. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tools/bump_version.py +0 -0
  83. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tools/extract_changelog.py +0 -0
  84. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tools/fix_po_files.py +0 -0
  85. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tools/git_version.sh +0 -0
  86. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tools/po_check.py +0 -0
  87. {pbkittyconfigstudio-0.1.1 → pbkittyconfigstudio-0.3.0}/tools/update_icons.py +0 -0
@@ -109,7 +109,7 @@ jobs:
109
109
  with:
110
110
  # One artifact per runner; merged in the release job.
111
111
  name: build-${{ runner.os }}
112
- path: dist/PBKittyConfigStudio-*
112
+ path: dist/pbkittyconfigstudio-*
113
113
  if-no-files-found: error
114
114
 
115
115
  # ── GitHub release ───────────────────────────────────────────────────────────
@@ -141,5 +141,5 @@ jobs:
141
141
  uses: softprops/action-gh-release@v3
142
142
  with:
143
143
  body: ${{ steps.changelog.outputs.body }}
144
- files: dist/PBKittyConfigStudio-*
144
+ files: dist/pbkittyconfigstudio-*
145
145
  fail_on_unmatched_files: true
@@ -0,0 +1,10 @@
1
+ config:
2
+ MD013:
3
+ # Table rows can't be wrapped without breaking the table syntax; keep
4
+ # the 80-column limit for prose everywhere else.
5
+ tables: false
6
+ # Duplicate headings allowed when they live under different parent
7
+ # sections (standard Keep-a-Changelog pattern: ### Added, ### Fixed
8
+ # repeat per release).
9
+ MD024:
10
+ siblings_only: true
@@ -5,6 +5,89 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.3.0] - 2026-08-25
9
+
10
+ ### Changed
11
+
12
+ - PyInstaller executable and source-archive names are now lowercase
13
+ (`pbkittyconfigstudio-<version>-<os>-<arch>`), for consistency with the
14
+ other PB* tools — previously `PBKittyConfigStudio-…`. `--auto-update`
15
+ looks up release assets under the new prefix first, falling back to the
16
+ old `PBKittyConfigStudio-` prefix so a pre-rename install can still find
17
+ and download its update.
18
+
19
+ ### Fixed
20
+
21
+ - Linux PyInstaller builds: bundled fonts were resolved through a
22
+ fontconfig config file containing absolute paths hardcoded to the build
23
+ machine's environment, which don't exist on the target machine —
24
+ fontconfig failed to find its config there and Qt fell back to an
25
+ illegible default font. Fonts are now registered directly with
26
+ `QFontDatabase.addApplicationFont` (bypassing fontconfig entirely), with
27
+ the application font forced to Ubuntu; a PyInstaller runtime hook
28
+ (`hooks/pyi_rth_fonts.py`) also regenerates a portable `fonts.conf` at
29
+ startup so other rendering settings (anti-aliasing, hinting, …) are still
30
+ inherited from the target system.
31
+
32
+ ## [0.2.0] - 2026-08-21
33
+
34
+ ### Added
35
+
36
+ - German, Spanish, Italian, Russian, Vietnamese and Simplified Chinese
37
+ translations (`de`, `es`, `it`, `ru`, `vi`, `zh_CN`), alongside the
38
+ existing English and French catalogues. Every translated string is
39
+ tagged `# ==AUTO== Automatically translated` pending human review (see
40
+ `CLAUDE.md`'s new "I18n" section); `grep -r "==AUTO=="` lists what's
41
+ still pending.
42
+ - Per-row "revert to saved value" button (`previous.svg`, next to the
43
+ existing "reset to default" one): restores just that setting to the
44
+ value currently on disk, without rereading the whole file and losing
45
+ other unsaved edits (`core/kitty_conf.py:values_equal()`,
46
+ `ui/main_window.py:_SettingRow`).
47
+ - `config/schema.json` now has a top-level `information` section (sibling
48
+ of `groups`), always regenerated fresh from kitty by
49
+ `schema_builder/extract_definition.py`: `total_parameters_detected` (every
50
+ `Option`/`MultiOption` kitty declares, kept + ignored) and
51
+ `ignored_parameters` (the names of the undocumented `Option`s skipped,
52
+ e.g. the 240 `color16`..`color255` slots). See `CODING.md`.
53
+ - The sidebar is now a tree instead of a flat category list: a subgroup
54
+ (e.g. "Color scheme"'s color table, "Mouse"'s mouse actions) is a child
55
+ node with its own settings page, rather than being folded into its
56
+ parent's page as an inline section. A category with a large subgroup no
57
+ longer turns into one giant scrolling page burying that subgroup's
58
+ settings far below the fold — each is now a direct, one-click sidebar
59
+ destination.
60
+ - `tests/fixtures/kitty_default.conf`: a frozen, real snapshot of kitty's
61
+ own generated example configuration, used to test
62
+ `parse_config()`/`apply_settings()` against realistic content (mixed
63
+ active/commented/bare-marker/`#:`-documentation lines) instead of only
64
+ hand-written snippets — a static asset, not regenerated in CI. See
65
+ `tests/fixtures/README.md` and `CODING.md`.
66
+
67
+ ### Changed
68
+
69
+ - Reworded the French about-dialog credits line, which repeated "kitty"
70
+ twice and read awkwardly ("... l'équipe de développement de kitty pour
71
+ le terminal kitty ...").
72
+
73
+ ### Fixed
74
+
75
+ - `language_name` for the English catalogue was left as the literal
76
+ string `"language_name"` instead of `"English"`, so the language
77
+ selector showed the raw code `en` instead of a name like every other
78
+ language.
79
+ - A setting whose only existing line was a bare `# key` marker with no
80
+ value at all (kitty's own generated example config writes these for
81
+ settings with no meaningful default to show, e.g. `# symbol_map`, `# env`
82
+ — 14 such settings in total) was written at the *end* of the file
83
+ instead of replacing that marker in place: the regex locating the line
84
+ to rewrite required at least one value after the key, so it never
85
+ matched a bare marker (`core/kitty_conf.py:_line_regex_for()` /
86
+ `_all_lines_regex_for()`).
87
+ - `pyproject.toml`'s `[project.urls]` pointed `Homepage` at kitty's own
88
+ repository instead of this project's (copy-paste leftover) — PyPI showed
89
+ the wrong project link. Added `Repository`/`Issues` alongside it.
90
+
8
91
  ## [0.1.1] - 2026-08-21
9
92
 
10
93
  ### Fixed
@@ -58,6 +58,15 @@ src/pb_kitty_config_studio/
58
58
  (`make new-lang LOCALE=xx` to add one)
59
59
  - `make dist` / `make srcdist` — PyInstaller executable / source archive
60
60
 
61
+ ## I18n
62
+
63
+ ### Auto-translation markers
64
+
65
+ All auto-translated strings are tagged `==AUTO==` (format varies by
66
+ mechanism — see the `translations` and `update-translation` skills).
67
+ Remove the marker once a human has reviewed and validated the string.
68
+ Use `grep -r "==AUTO=="` to list pending strings.
69
+
61
70
  ## Notes
62
71
 
63
72
  - Every save writes the *entire* current form state to kitty.conf (matching
@@ -45,6 +45,21 @@ make kitty-schema-skeleton
45
45
  before overwriting it. See `schema_builder/README.md` for the build details
46
46
  (why kitty needs to be compiled, the Go/pixi setup, platform notes).
47
47
 
48
+ ### The `information` section
49
+
50
+ `schema.json` has a top-level `information` object, a sibling of `groups`,
51
+ always regenerated fresh from kitty (never curator-owned, no merging
52
+ needed — `merge_schema.py` passes it through as-is):
53
+
54
+ - **`total_parameters_detected`** — how many `Option`/`MultiOption`
55
+ parameters kitty declares in total, kept ones plus ignored ones. Key/mouse
56
+ bindings aren't parameters and are never counted here (see the schema
57
+ pipeline diagram above).
58
+ - **`ignored_parameters`** — the (sorted) names of every `Option` skipped
59
+ for being undocumented (`documented=False` — e.g. the 240
60
+ `color16`..`color255` slots). A `MultiOption` has no such per-item flag
61
+ and is always kept, so it never appears here.
62
+
48
63
  ### What's regenerated vs. what's curated
49
64
 
50
65
  Every field kitty itself declares is refreshed on every run: `name`,
@@ -223,6 +238,28 @@ directives, `include` lines) is left untouched.
223
238
  order they appear in `schema.json` — the same order `schema_builder`
224
239
  wrote them in, which itself mirrors kitty's own `definition.root_group`
225
240
  order.
241
+ - **Bare, valueless marker lines**: kitty's own generated example config
242
+ marks a setting with no meaningful default to show as just `# key`, no
243
+ value at all — the real example lives separately, in `#:`-prefixed
244
+ documentation lines (e.g. `# symbol_map` followed by
245
+ `#: E.g. symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 PowerlineSymbols`). The
246
+ line-locating regexes treat the value as optional for exactly this
247
+ reason — a version that required at least one value after the key never
248
+ matched this shape, so saving such a setting appended it at the end of
249
+ the file instead of replacing the marker in place. See
250
+ `tests/fixtures/README.md`.
251
+
252
+ ### Testing against a real kitty.conf
253
+
254
+ `tests/fixtures/kitty_default.conf` is a frozen, byte-for-byte snapshot of
255
+ kitty's real generated example configuration (see
256
+ `tests/fixtures/README.md`) — used by `test_kitty_conf.py` to exercise
257
+ `parse_config()`/`apply_settings()` against realistic content no
258
+ hand-written snippet reliably covers (mixed active/commented/bare-marker/
259
+ `#:`-documentation lines). It's a static asset, refreshed manually and
260
+ deliberately, not regenerated in CI — doing so would need a real,
261
+ launchable `kitty` binary there, which every other test in this file
262
+ (mocked `subprocess.Popen`/`.run()`) is careful to avoid needing.
226
263
 
227
264
  ### Restoring kitty's default configuration
228
265
 
@@ -7,7 +7,7 @@ endif
7
7
  SRC := src
8
8
  LOCALE_DIR := src/pb_kitty_config_studio/locale
9
9
  POT_FILE := $(LOCALE_DIR)/pb_kitty_config_studio.pot
10
- PO_LOCALES := en fr
10
+ PO_LOCALES := en fr de es it ru vi zh_CN
11
11
 
12
12
  R := \033[0m
13
13
  B := \033[1m
@@ -135,9 +135,9 @@ update-icons: ## Sync app icons (.svg/.png/.ico/.icns) from PBIcons
135
135
  # PyInstaller builds natively: run this target on the target OS.
136
136
  # Version comes from the exact git tag when HEAD is tagged and the tree is
137
137
  # clean; otherwise "dev". Output in dist/:
138
- # Linux → dist/PBKittyConfigStudio-<ver>-linux-x86_64
139
- # Windows → dist/PBKittyConfigStudio-<ver>-windows-x86_64.exe
140
- # macOS → dist/PBKittyConfigStudio-<ver>-macos-arm64 (.app bundle)
138
+ # Linux → dist/pbkittyconfigstudio-<ver>-linux-x86_64
139
+ # Windows → dist/pbkittyconfigstudio-<ver>-windows-x86_64.exe
140
+ # macOS → dist/pbkittyconfigstudio-<ver>-macos-arm64 (.app bundle)
141
141
  dist: translate ## Build a standalone executable for the current platform
142
142
  @ver=$$(bash tools/git_version.sh); \
143
143
  printf "$(C)PyInstaller — version: $$ver platform: $$($(CONDA_RUN) python -c 'import sys; print(sys.platform)')$(R)\n"; \
@@ -147,12 +147,12 @@ dist: translate ## Build a standalone executable for the current platform
147
147
  PBKittyConfigStudio.spec
148
148
  @printf "$(G)Done.$(R) Executable in $(Y)dist/$(R)\n"
149
149
 
150
- srcdist: ## Build a source archive (dist/PBKittyConfigStudio-<ver>-src.tar.gz) via git archive
150
+ srcdist: ## Build a source archive (dist/pbkittyconfigstudio-<ver>-src.tar.gz) via git archive
151
151
  @ver=$$(bash tools/git_version.sh); \
152
- out="dist/PBKittyConfigStudio-$$ver-src.tar.gz"; \
152
+ out="dist/pbkittyconfigstudio-$$ver-src.tar.gz"; \
153
153
  printf "$(C)Source archive — version: $$ver$(R)\n"; \
154
154
  mkdir -p dist; \
155
- git archive --format=tar.gz --prefix="PBKittyConfigStudio-$$ver/" HEAD -o "$$out"; \
155
+ git archive --format=tar.gz --prefix="pbkittyconfigstudio-$$ver/" HEAD -o "$$out"; \
156
156
  printf "$(G)Done.$(R) Archive: $(Y)$$out$(R)\n"
157
157
 
158
158
  # ── PyPI ──────────────────────────────────────────────────────────────────────
@@ -4,9 +4,9 @@
4
4
  The output name embeds the version and the target platform so that builds
5
5
  for different systems can coexist in the same directory:
6
6
 
7
- Linux → dist/PBKittyConfigStudio-<version>-linux-x86_64
8
- Windows → dist/PBKittyConfigStudio-<version>-windows-x86_64.exe
9
- macOS → dist/PBKittyConfigStudio-<version>-macos-arm64.app
7
+ Linux → dist/pbkittyconfigstudio-<version>-linux-x86_64
8
+ Windows → dist/pbkittyconfigstudio-<version>-windows-x86_64.exe
9
+ macOS → dist/pbkittyconfigstudio-<version>-macos-arm64.app
10
10
 
11
11
  Build with: make dist
12
12
  """
@@ -49,7 +49,7 @@ elif sys.platform == "darwin":
49
49
  else:
50
50
  _os = sys.platform
51
51
 
52
- _artifact_name = f"PBKittyConfigStudio-{_version}-{_os}-{_arch}"
52
+ _artifact_name = f"pbkittyconfigstudio-{_version}-{_os}-{_arch}"
53
53
 
54
54
  # ---------------------------------------------------------------------------
55
55
  # Data files to bundle
@@ -98,6 +98,14 @@ if sys.platform == "linux":
98
98
  if (_conda_lib_dir / name).is_file()
99
99
  ]
100
100
 
101
+ # Conda fonts: bundled to guarantee identical rendering across machines.
102
+ # On Linux, fontconfig resolves fonts via absolute paths written into fonts.conf
103
+ # at build time; those paths do not exist on the target machine.
104
+ # The runtime hook hooks/pyi_rth_fonts.py generates a portable fonts.conf at startup.
105
+ _conda_fonts = Path(sys.base_prefix) / "fonts"
106
+ if _conda_fonts.is_dir():
107
+ _datas += [(str(_conda_fonts), "fonts")]
108
+
101
109
  # ---------------------------------------------------------------------------
102
110
  # Analysis
103
111
  # ---------------------------------------------------------------------------
@@ -111,6 +119,7 @@ a = Analysis(
111
119
  binaries=_binaries,
112
120
  hiddenimports=[],
113
121
  hookspath=[],
122
+ runtime_hooks=["hooks/pyi_rth_fonts.py"],
114
123
  excludes=["tkinter", "unittest"],
115
124
  noarchive=False,
116
125
  )
@@ -1,8 +1,10 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: PBKittyConfigStudio
3
- Version: 0.1.1
3
+ Version: 0.3.0
4
4
  Summary: A desktop GUI for configuring the kitty terminal
5
- Project-URL: Homepage, https://github.com/kovidgoyal/kitty
5
+ Project-URL: Homepage, https://github.com/ppoilbarbe/PBKittyConfigStudio
6
+ Project-URL: Repository, https://github.com/ppoilbarbe/PBKittyConfigStudio
7
+ Project-URL: Issues, https://github.com/ppoilbarbe/PBKittyConfigStudio/issues
6
8
  Author-email: Marcel Spock <mrspock@cardolan.net>
7
9
  License-Expression: GPL-3.0-or-later
8
10
  License-File: LICENSE
@@ -57,10 +59,16 @@ Built with Python and PySide6 (Qt6), the app needs nothing else.
57
59
  switches, dropdowns, a font picker built on Qt's own font database (no
58
60
  shelling out to `fc-list`), and a list editor for repeatable settings
59
61
  such as `font_features`/`modify_font`.
62
+ - **A sidebar tree, not a flat list** — a subgroup (e.g. the color table
63
+ under "Color scheme", mouse actions under "Mouse") is its own entry with
64
+ its own settings page, so a category with a lot of settings never turns
65
+ into one giant scrolling page burying part of it below the fold.
60
66
  - **Search** — a search box above the sidebar filters settings by name or
61
67
  label across every category.
62
68
  - **Default vs. modified at a glance** — every row is badged "default" or
63
- "modified" against kitty's own default value.
69
+ "modified" against kitty's own default value, with one-click buttons to
70
+ reset it to that default or revert it to the value currently saved on
71
+ disk (without rereading the whole file and losing other unsaved edits).
64
72
  - **Non-destructive** — every save writes a timestamped backup
65
73
  (`kitty.conf.bak_<date>`) first, and rewrites existing lines (including
66
74
  commented-out ones) in place with a targeted regex, leaving comments and
@@ -72,7 +80,7 @@ Built with Python and PySide6 (Qt6), the app needs nothing else.
72
80
  fully-commented example `kitty.conf` (via a throwaway `kitty` instance)
73
81
  and overwrites the current file, behind a confirmation dialog and the
74
82
  usual timestamped backup.
75
- - **Translated UI** — English and French out of the box (see
83
+ - **Translated UI** — English and many other languages out of the box (see
76
84
  [Development](#development) to add a language).
77
85
  - **Stays in sync with kitty** — the settings schema is generated straight
78
86
  from kitty's own option definitions rather than hand-maintained; see
@@ -29,10 +29,16 @@ Built with Python and PySide6 (Qt6), the app needs nothing else.
29
29
  switches, dropdowns, a font picker built on Qt's own font database (no
30
30
  shelling out to `fc-list`), and a list editor for repeatable settings
31
31
  such as `font_features`/`modify_font`.
32
+ - **A sidebar tree, not a flat list** — a subgroup (e.g. the color table
33
+ under "Color scheme", mouse actions under "Mouse") is its own entry with
34
+ its own settings page, so a category with a lot of settings never turns
35
+ into one giant scrolling page burying part of it below the fold.
32
36
  - **Search** — a search box above the sidebar filters settings by name or
33
37
  label across every category.
34
38
  - **Default vs. modified at a glance** — every row is badged "default" or
35
- "modified" against kitty's own default value.
39
+ "modified" against kitty's own default value, with one-click buttons to
40
+ reset it to that default or revert it to the value currently saved on
41
+ disk (without rereading the whole file and losing other unsaved edits).
36
42
  - **Non-destructive** — every save writes a timestamped backup
37
43
  (`kitty.conf.bak_<date>`) first, and rewrites existing lines (including
38
44
  commented-out ones) in place with a targeted regex, leaving comments and
@@ -44,7 +50,7 @@ Built with Python and PySide6 (Qt6), the app needs nothing else.
44
50
  fully-commented example `kitty.conf` (via a throwaway `kitty` instance)
45
51
  and overwrites the current file, behind a confirmation dialog and the
46
52
  usual timestamped backup.
47
- - **Translated UI** — English and French out of the box (see
53
+ - **Translated UI** — English and many other languages out of the box (see
48
54
  [Development](#development) to add a language).
49
55
  - **Stays in sync with kitty** — the settings schema is generated straight
50
56
  from kitty's own option definitions rather than hand-maintained; see
@@ -0,0 +1,49 @@
1
+ """PyInstaller runtime hook — portable fontconfig on Linux.
2
+
3
+ On Linux, Qt uses fontconfig to locate fonts. The fonts.conf bundled by
4
+ PyInstaller contains absolute paths to the conda environment of the build
5
+ machine (e.g. /home/runner/…) that do not exist on the target machine.
6
+
7
+ This hook runs at frozen-app startup, before Qt initialises. It:
8
+ 1. Writes a minimal fonts.conf into sys._MEIPASS pointing to the bundled
9
+ fonts (fonts/) and the system fonts (/usr/share/fonts).
10
+ 2. Sets FONTCONFIG_FILE so that fontconfig picks up this file.
11
+ """
12
+
13
+ import os
14
+ import sys
15
+
16
+ if sys.platform != "linux" or not getattr(sys, "frozen", False):
17
+ pass
18
+ else:
19
+ _meipass = sys._MEIPASS
20
+ _fonts_dir = os.path.join(_meipass, "fonts")
21
+ if os.path.isdir(_fonts_dir):
22
+ _conf_path = os.path.join(_meipass, "fonts.conf")
23
+ # Include the system fonts.conf so that all rendering settings
24
+ # (anti-aliasing, hinting, subpixel, …) and system fonts are inherited.
25
+ # Only the bundled fonts directory needs to be added explicitly.
26
+ _conf = f"""<?xml version="1.0"?>
27
+ <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
28
+ <fontconfig>
29
+ <dir>{_fonts_dir}</dir>
30
+ <include ignore_missing="yes">/etc/fonts/fonts.conf</include>
31
+ </fontconfig>
32
+ """
33
+ with open(_conf_path, "w", encoding="utf-8") as _f:
34
+ _f.write(_conf)
35
+ os.environ["FONTCONFIG_FILE"] = _conf_path
36
+
37
+ # Force fontconfig to (re-)initialize with the new FONTCONFIG_FILE.
38
+ # libfontconfig may have already been dlopen'd and self-initialized with
39
+ # its compile-time defaults (hardcoded to the build machine's conda path)
40
+ # before this hook ran. FcFini() + FcInit() resets it so it re-reads
41
+ # FONTCONFIG_FILE before Qt's QFontDatabase is populated.
42
+ try:
43
+ import ctypes
44
+
45
+ _fc = ctypes.CDLL("libfontconfig.so.1")
46
+ _fc.FcFini()
47
+ _fc.FcInit()
48
+ except OSError:
49
+ pass
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "PBKittyConfigStudio"
7
- version = "0.1.1"
7
+ version = "0.3.0"
8
8
  description = "A desktop GUI for configuring the kitty terminal"
9
9
  readme = "README.md"
10
10
  license = "GPL-3.0-or-later"
@@ -38,7 +38,9 @@ dev = [
38
38
  PBKittyConfigStudio = "pb_kitty_config_studio.__main__:main"
39
39
 
40
40
  [project.urls]
41
- Homepage = "https://github.com/kovidgoyal/kitty"
41
+ Homepage = "https://github.com/ppoilbarbe/PBKittyConfigStudio"
42
+ Repository = "https://github.com/ppoilbarbe/PBKittyConfigStudio"
43
+ Issues = "https://github.com/ppoilbarbe/PBKittyConfigStudio/issues"
42
44
 
43
45
  [tool.hatch.build.targets.wheel]
44
46
  packages = ["src/pb_kitty_config_studio"]
@@ -89,11 +91,14 @@ channels = ["conda-forge"]
89
91
  platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
90
92
 
91
93
  [tool.pixi.dependencies]
92
- python = "3.12.*"
93
- pyside6 = "*"
94
- pytest = "*"
95
- pytest-qt = "*"
96
- pytest-cov = "*"
94
+ python = "3.12.*"
95
+ pyside6 = "*"
96
+ # Bundled into PyInstaller builds for identical, portable font rendering
97
+ # across machines — see hooks/pyi_rth_fonts.py and PBKittyConfigStudio.spec.
98
+ fonts-conda-ecosystem = "*"
99
+ pytest = "*"
100
+ pytest-qt = "*"
101
+ pytest-cov = "*"
97
102
  ruff = "*"
98
103
  pre-commit = "*"
99
104
  babel = "*"
@@ -18,6 +18,12 @@ to be edited individually) are skipped too: they'd otherwise dominate the
18
18
  skeleton with entries no one curates by hand. ``MultiOption`` items have no
19
19
  such per-option flag and are always kept (there are only 12 of them and all
20
20
  are legitimate user-facing settings).
21
+
22
+ The returned skeleton carries a top-level ``information`` section (sibling
23
+ of ``groups``) reporting how many ``Option``/``MultiOption`` parameters
24
+ kitty declares in total (kept + ignored) and the names of the ones skipped
25
+ for being undocumented — key/mouse bindings aren't parameters and are never
26
+ counted there.
21
27
  """
22
28
 
23
29
  from __future__ import annotations
@@ -65,6 +71,29 @@ def _is_kept_option(it: Any) -> bool:
65
71
  return False
66
72
 
67
73
 
74
+ def _walk_parameters(group: Group) -> tuple[list[str], list[str]]:
75
+ """Recursively collect the names of every ``Option``/``MultiOption`` in
76
+ *group* and its subgroups, split into (kept, ignored).
77
+
78
+ "Ignored" here means specifically an undocumented ``Option`` (kitty
79
+ provides no such per-item flag for key/mouse bindings, which aren't
80
+ parameters at all and are never counted here — see the module
81
+ docstring).
82
+ """
83
+ kept: list[str] = []
84
+ ignored: list[str] = []
85
+ for it in group.items:
86
+ if isinstance(it, Group):
87
+ sub_kept, sub_ignored = _walk_parameters(it)
88
+ kept.extend(sub_kept)
89
+ ignored.extend(sub_ignored)
90
+ elif isinstance(it, MultiOption):
91
+ kept.append(it.name)
92
+ elif isinstance(it, Option):
93
+ (kept if it.documented else ignored).append(it.name)
94
+ return kept, ignored
95
+
96
+
68
97
  def _group_dict(group: Group) -> dict[str, Any]:
69
98
  options = [_option_dict(it) for it in group.items if _is_kept_option(it)]
70
99
  subgroups = [_group_dict(it) for it in group.items if isinstance(it, Group)]
@@ -87,8 +116,19 @@ def build_skeleton(definition: Any) -> dict[str, Any]:
87
116
  """Return a JSON-serializable skeleton of *definition* (a kitty
88
117
  ``kitty.conf.types.Definition``, e.g. ``kitty.options.definition.definition``).
89
118
  """
119
+ root_groups = [g for g in definition.root_group.items if isinstance(g, Group)]
120
+
121
+ kept_names: list[str] = []
122
+ ignored_names: list[str] = []
123
+ for g in root_groups:
124
+ kept, ignored = _walk_parameters(g)
125
+ kept_names.extend(kept)
126
+ ignored_names.extend(ignored)
127
+
90
128
  return {
91
- "groups": [
92
- _group_dict(g) for g in definition.root_group.items if isinstance(g, Group)
93
- ],
129
+ "information": {
130
+ "total_parameters_detected": len(kept_names) + len(ignored_names),
131
+ "ignored_parameters": sorted(ignored_names),
132
+ },
133
+ "groups": [_group_dict(g) for g in root_groups],
94
134
  }
@@ -134,8 +134,15 @@ def merge_schema(
134
134
  old_groups = _flatten_groups(existing_groups)
135
135
  old_options = _flatten_options(existing_groups)
136
136
  return {
137
+ # Always fresh from kitty, like every other kitty-owned field —
138
+ # never curator-owned, so no merging needed. Defaults to an empty
139
+ # placeholder for skeletons that predate this field (or minimal
140
+ # test fixtures) rather than raising.
141
+ "information": skeleton.get(
142
+ "information", {"total_parameters_detected": 0, "ignored_parameters": []}
143
+ ),
137
144
  "groups": [
138
145
  _merge_group(g, old_groups, old_options, top_level=True)
139
146
  for g in skeleton["groups"]
140
- ]
147
+ ],
141
148
  }
@@ -1,3 +1,3 @@
1
1
  """PBKittyConfigStudio — a desktop GUI for configuring the kitty terminal."""
2
2
 
3
- __version__ = "0.1.1"
3
+ __version__ = "0.3.0"
@@ -120,6 +120,51 @@ def main() -> None:
120
120
  print(message, file=sys.stderr)
121
121
  sys.exit(0 if ok else 1)
122
122
 
123
+ _run_gui(ns) # pragma: no cover — see _run_gui's docstring/comment
124
+
125
+
126
+ def _load_bundled_fonts(app: object) -> None: # pragma: no cover
127
+ """Register bundled fonts into Qt's font database (frozen builds only).
128
+
129
+ In a PyInstaller onefile build, fontconfig uses paths hardcoded at build
130
+ time that don't exist on the target machine. QFontDatabase.addApplicationFont
131
+ bypasses fontconfig entirely and guarantees that the bundled fonts (Ubuntu,
132
+ DejaVu, …) are available regardless of the host fontconfig configuration.
133
+ """
134
+ if not getattr(sys, "frozen", False):
135
+ return
136
+
137
+ from PySide6.QtGui import QFont, QFontDatabase
138
+
139
+ fonts_dir = Path(sys._MEIPASS) / "fonts" # type: ignore[attr-defined]
140
+ if not fonts_dir.is_dir():
141
+ return
142
+
143
+ loaded: set[str] = set()
144
+ for ttf in sorted(fonts_dir.glob("*.ttf")):
145
+ fid = QFontDatabase.addApplicationFont(str(ttf))
146
+ if fid >= 0:
147
+ loaded.update(QFontDatabase.applicationFontFamilies(fid))
148
+
149
+ # Set Ubuntu as the default application font so the bundle renders
150
+ # consistently on any machine, regardless of whether fontconfig finds
151
+ # the system config. The bundled libfontconfig.so has its default config
152
+ # path hardcoded to the build machine's conda prefix, which does not exist
153
+ # on target machines, so font selection cannot rely on fontconfig.
154
+ if "Ubuntu" in loaded:
155
+ current = app.font() # type: ignore[union-attr]
156
+ app.setFont( # type: ignore[union-attr]
157
+ QFont("Ubuntu", current.pointSize() if current.pointSize() > 0 else 10)
158
+ )
159
+
160
+
161
+ def _run_gui(ns: argparse.Namespace) -> None: # pragma: no cover
162
+ # Real Qt bootstrap: creates the process's one-and-only QApplication and
163
+ # runs its event loop. Not unit-testable — PySide6 raises ("libshiboken:
164
+ # Please destroy the QApplication singleton before creating a new
165
+ # QApplication instance") if a second QApplication is instantiated in the
166
+ # same process, which pytest-qt's session-wide `qapp` fixture already
167
+ # is; this path is instead exercised by manually running the built app.
123
168
  from PySide6.QtGui import QIcon
124
169
  from PySide6.QtWidgets import QApplication
125
170
 
@@ -131,6 +176,7 @@ def main() -> None:
131
176
  # which would let Qt's own permissive C++ parser silently absorb or
132
177
  # ignore anything argparse didn't already recognize above.
133
178
  app = QApplication([sys.argv[0]] + ns.qt_args)
179
+ _load_bundled_fonts(app)
134
180
  app.setApplicationName("PBKittyConfigStudio")
135
181
  app.setApplicationVersion(__version__)
136
182
  app.setOrganizationName("cardolan")
@@ -149,5 +195,5 @@ def main() -> None:
149
195
  sys.exit(app.exec())
150
196
 
151
197
 
152
- if __name__ == "__main__":
198
+ if __name__ == "__main__": # pragma: no cover — thin script entry point
153
199
  main()