PBKittyConfigStudio 0.1.0__py3-none-any.whl
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.
- pb_kitty_config_studio/__init__.py +3 -0
- pb_kitty_config_studio/__main__.py +153 -0
- pb_kitty_config_studio/argparse_qt.py +99 -0
- pb_kitty_config_studio/config/__init__.py +81 -0
- pb_kitty_config_studio/config/_babel_extractor.py +35 -0
- pb_kitty_config_studio/config/schema.json +3654 -0
- pb_kitty_config_studio/core/__init__.py +0 -0
- pb_kitty_config_studio/core/kitty_conf.py +316 -0
- pb_kitty_config_studio/i18n.py +115 -0
- pb_kitty_config_studio/locale/en/LC_MESSAGES/pb_kitty_config_studio.mo +0 -0
- pb_kitty_config_studio/locale/en/LC_MESSAGES/pb_kitty_config_studio.po +978 -0
- pb_kitty_config_studio/locale/fr/LC_MESSAGES/pb_kitty_config_studio.mo +0 -0
- pb_kitty_config_studio/locale/fr/LC_MESSAGES/pb_kitty_config_studio.po +983 -0
- pb_kitty_config_studio/platform/__init__.py +1 -0
- pb_kitty_config_studio/platform/auto_update.py +267 -0
- pb_kitty_config_studio/platform/desktop.py +174 -0
- pb_kitty_config_studio/resources/__init__.py +54 -0
- pb_kitty_config_studio/resources/cancel.svg +1 -0
- pb_kitty_config_studio/resources/clear-all-data.svg +1 -0
- pb_kitty_config_studio/resources/help-about.svg +1 -0
- pb_kitty_config_studio/resources/pbkittyconfigstudio.icns +0 -0
- pb_kitty_config_studio/resources/pbkittyconfigstudio.ico +0 -0
- pb_kitty_config_studio/resources/pbkittyconfigstudio.png +0 -0
- pb_kitty_config_studio/resources/quit.svg +1 -0
- pb_kitty_config_studio/resources/refresh.svg +1 -0
- pb_kitty_config_studio/resources/save-as.svg +1 -0
- pb_kitty_config_studio/resources/save.svg +1 -0
- pb_kitty_config_studio/ui/__init__.py +0 -0
- pb_kitty_config_studio/ui/about_dialog.py +160 -0
- pb_kitty_config_studio/ui/main_window.py +491 -0
- pb_kitty_config_studio/ui/widgets.py +363 -0
- pbkittyconfigstudio-0.1.0.dist-info/METADATA +161 -0
- pbkittyconfigstudio-0.1.0.dist-info/RECORD +36 -0
- pbkittyconfigstudio-0.1.0.dist-info/WHEEL +4 -0
- pbkittyconfigstudio-0.1.0.dist-info/entry_points.txt +2 -0
- pbkittyconfigstudio-0.1.0.dist-info/licenses/LICENSE +674 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
"""One widget class per schema setting ``app_type``.
|
|
2
|
+
|
|
3
|
+
Every widget exposes the same tiny contract so ``main_window.py`` can build
|
|
4
|
+
and wire them up generically:
|
|
5
|
+
|
|
6
|
+
* ``value_changed`` — Signal emitted whenever the user changes the
|
|
7
|
+
control, carrying the new value in the same shape ``value()`` returns
|
|
8
|
+
(``str`` for single-value settings, ``list[str]`` for a multi-value one
|
|
9
|
+
— i.e. any setting with ``setting["multi"]`` true, such as
|
|
10
|
+
``font_features``/``modify_font``).
|
|
11
|
+
* ``set_value(...)`` — programmatically set the displayed value without
|
|
12
|
+
emitting ``value_changed``.
|
|
13
|
+
* ``value()`` — the current value in kitty.conf-ready text form.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
20
|
+
from PySide6.QtCore import Signal
|
|
21
|
+
from PySide6.QtGui import QColor
|
|
22
|
+
from PySide6.QtWidgets import (
|
|
23
|
+
QCheckBox,
|
|
24
|
+
QColorDialog,
|
|
25
|
+
QComboBox,
|
|
26
|
+
QDoubleSpinBox,
|
|
27
|
+
QHBoxLayout,
|
|
28
|
+
QInputDialog,
|
|
29
|
+
QLabel,
|
|
30
|
+
QLineEdit,
|
|
31
|
+
QListWidget,
|
|
32
|
+
QPushButton,
|
|
33
|
+
QVBoxLayout,
|
|
34
|
+
QWidget,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# Numeric bounds used when a schema entry declares no min/max of its own —
|
|
38
|
+
# wide enough to be effectively "no control", as the schema says it should
|
|
39
|
+
# be in that case.
|
|
40
|
+
_UNBOUNDED_INT = (-2_000_000_000, 2_000_000_000)
|
|
41
|
+
_UNBOUNDED_FLOAT = (-1_000_000.0, 1_000_000.0)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class ColorSettingWidget(QWidget):
|
|
45
|
+
value_changed = Signal(str)
|
|
46
|
+
|
|
47
|
+
def __init__(self, default: str, parent: QWidget | None = None) -> None:
|
|
48
|
+
super().__init__(parent)
|
|
49
|
+
self._default = default
|
|
50
|
+
|
|
51
|
+
self._swatch = QPushButton()
|
|
52
|
+
self._swatch.setFixedSize(32, 24)
|
|
53
|
+
self._swatch.clicked.connect(self._pick_color)
|
|
54
|
+
|
|
55
|
+
self._edit = QLineEdit()
|
|
56
|
+
self._edit.textEdited.connect(self._on_text_edited)
|
|
57
|
+
|
|
58
|
+
layout = QHBoxLayout(self)
|
|
59
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
60
|
+
layout.addWidget(self._swatch)
|
|
61
|
+
layout.addWidget(self._edit, 1)
|
|
62
|
+
|
|
63
|
+
self.set_value(default)
|
|
64
|
+
|
|
65
|
+
def _paint_swatch(self, text: str) -> None:
|
|
66
|
+
color = QColor(text)
|
|
67
|
+
css = text if color.isValid() else "transparent"
|
|
68
|
+
border = "#4338ca"
|
|
69
|
+
self._swatch.setStyleSheet(
|
|
70
|
+
f"background-color: {css}; border: 1px solid {border}; border-radius: 4px;"
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
def _on_text_edited(self, text: str) -> None:
|
|
74
|
+
self._paint_swatch(text)
|
|
75
|
+
self.value_changed.emit(text)
|
|
76
|
+
|
|
77
|
+
def _pick_color(self) -> None:
|
|
78
|
+
seed = QColor(self._edit.text())
|
|
79
|
+
if not seed.isValid():
|
|
80
|
+
seed = QColor(
|
|
81
|
+
self._default if QColor(self._default).isValid() else "#000000"
|
|
82
|
+
)
|
|
83
|
+
color = QColorDialog.getColor(seed, self, "")
|
|
84
|
+
if not color.isValid():
|
|
85
|
+
return
|
|
86
|
+
self.set_value(color.name())
|
|
87
|
+
self.value_changed.emit(color.name())
|
|
88
|
+
|
|
89
|
+
def set_value(self, value: str) -> None:
|
|
90
|
+
self._edit.setText(value)
|
|
91
|
+
self._paint_swatch(value)
|
|
92
|
+
|
|
93
|
+
def value(self) -> str:
|
|
94
|
+
return self._edit.text()
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class FontSettingWidget(QWidget):
|
|
98
|
+
value_changed = Signal(str)
|
|
99
|
+
|
|
100
|
+
def __init__(self, allow_auto: bool, parent: QWidget | None = None) -> None:
|
|
101
|
+
super().__init__(parent)
|
|
102
|
+
from PySide6.QtGui import QFontDatabase
|
|
103
|
+
|
|
104
|
+
self._combo = QComboBox()
|
|
105
|
+
self._combo.setEditable(True)
|
|
106
|
+
|
|
107
|
+
items: list[str] = []
|
|
108
|
+
if allow_auto:
|
|
109
|
+
items.append("auto")
|
|
110
|
+
items.append("monospace")
|
|
111
|
+
families = sorted(
|
|
112
|
+
f for f in QFontDatabase.families() if QFontDatabase.isFixedPitch(f)
|
|
113
|
+
)
|
|
114
|
+
items.extend(f for f in families if f not in items)
|
|
115
|
+
self._combo.addItems(items)
|
|
116
|
+
self._combo.currentTextChanged.connect(self.value_changed.emit)
|
|
117
|
+
|
|
118
|
+
layout = QHBoxLayout(self)
|
|
119
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
120
|
+
layout.addWidget(self._combo)
|
|
121
|
+
|
|
122
|
+
def set_value(self, value: str) -> None:
|
|
123
|
+
self._combo.blockSignals(True)
|
|
124
|
+
idx = self._combo.findText(value)
|
|
125
|
+
if idx >= 0:
|
|
126
|
+
self._combo.setCurrentIndex(idx)
|
|
127
|
+
else:
|
|
128
|
+
self._combo.setCurrentText(value)
|
|
129
|
+
self._combo.blockSignals(False)
|
|
130
|
+
|
|
131
|
+
def value(self) -> str:
|
|
132
|
+
return self._combo.currentText()
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class BooleanSettingWidget(QWidget):
|
|
136
|
+
value_changed = Signal(str)
|
|
137
|
+
|
|
138
|
+
def __init__(self, parent: QWidget | None = None) -> None:
|
|
139
|
+
super().__init__(parent)
|
|
140
|
+
self._check = QCheckBox()
|
|
141
|
+
self._label = QLabel()
|
|
142
|
+
self._check.toggled.connect(self._on_toggled)
|
|
143
|
+
|
|
144
|
+
layout = QHBoxLayout(self)
|
|
145
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
146
|
+
layout.addWidget(self._check)
|
|
147
|
+
layout.addWidget(self._label)
|
|
148
|
+
layout.addStretch(1)
|
|
149
|
+
|
|
150
|
+
def _refresh_label(self, checked: bool) -> None:
|
|
151
|
+
self._label.setText(_("Enabled") if checked else _("Disabled"))
|
|
152
|
+
|
|
153
|
+
def _on_toggled(self, checked: bool) -> None:
|
|
154
|
+
self._refresh_label(checked)
|
|
155
|
+
self.value_changed.emit("yes" if checked else "no")
|
|
156
|
+
|
|
157
|
+
def set_value(self, value: str) -> None:
|
|
158
|
+
checked = str(value).strip().lower() in ("yes", "true", "1")
|
|
159
|
+
self._check.blockSignals(True)
|
|
160
|
+
self._check.setChecked(checked)
|
|
161
|
+
self._refresh_label(checked)
|
|
162
|
+
self._check.blockSignals(False)
|
|
163
|
+
|
|
164
|
+
def value(self) -> str:
|
|
165
|
+
return "yes" if self._check.isChecked() else "no"
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class SelectSettingWidget(QWidget):
|
|
169
|
+
value_changed = Signal(str)
|
|
170
|
+
|
|
171
|
+
def __init__(self, choices: list[str], parent: QWidget | None = None) -> None:
|
|
172
|
+
super().__init__(parent)
|
|
173
|
+
self._combo = QComboBox()
|
|
174
|
+
self._combo.addItems(choices)
|
|
175
|
+
self._combo.currentTextChanged.connect(self.value_changed.emit)
|
|
176
|
+
|
|
177
|
+
layout = QHBoxLayout(self)
|
|
178
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
179
|
+
layout.addWidget(self._combo)
|
|
180
|
+
|
|
181
|
+
def set_value(self, value: str) -> None:
|
|
182
|
+
self._combo.blockSignals(True)
|
|
183
|
+
idx = self._combo.findText(value)
|
|
184
|
+
self._combo.setCurrentIndex(idx if idx >= 0 else 0)
|
|
185
|
+
self._combo.blockSignals(False)
|
|
186
|
+
|
|
187
|
+
def value(self) -> str:
|
|
188
|
+
return self._combo.currentText()
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class TextSettingWidget(QWidget):
|
|
192
|
+
value_changed = Signal(str)
|
|
193
|
+
|
|
194
|
+
def __init__(self, placeholder: str, parent: QWidget | None = None) -> None:
|
|
195
|
+
super().__init__(parent)
|
|
196
|
+
self._edit = QLineEdit()
|
|
197
|
+
self._edit.setPlaceholderText(placeholder)
|
|
198
|
+
self._edit.textEdited.connect(self.value_changed.emit)
|
|
199
|
+
|
|
200
|
+
layout = QHBoxLayout(self)
|
|
201
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
202
|
+
layout.addWidget(self._edit)
|
|
203
|
+
|
|
204
|
+
def set_value(self, value: str) -> None:
|
|
205
|
+
self._edit.setText(value)
|
|
206
|
+
|
|
207
|
+
def value(self) -> str:
|
|
208
|
+
return self._edit.text()
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
class NumberSettingWidget(QWidget):
|
|
212
|
+
"""A spin box for ``app_type`` ``"int"``/``"float"``.
|
|
213
|
+
|
|
214
|
+
``minimum``/``maximum`` are optional: absent, the schema says the value
|
|
215
|
+
is "quelconque" (unconstrained) — a wide default range is used instead
|
|
216
|
+
of disabling bounds entirely, since Qt spin boxes always need one.
|
|
217
|
+
"""
|
|
218
|
+
|
|
219
|
+
value_changed = Signal(str)
|
|
220
|
+
|
|
221
|
+
def __init__(
|
|
222
|
+
self,
|
|
223
|
+
is_int: bool,
|
|
224
|
+
minimum: float | None,
|
|
225
|
+
maximum: float | None,
|
|
226
|
+
step: float | None,
|
|
227
|
+
parent: QWidget | None = None,
|
|
228
|
+
) -> None:
|
|
229
|
+
super().__init__(parent)
|
|
230
|
+
self._decimals = 0 if is_int else 2
|
|
231
|
+
default_min, default_max = _UNBOUNDED_INT if is_int else _UNBOUNDED_FLOAT
|
|
232
|
+
|
|
233
|
+
self._spin = QDoubleSpinBox()
|
|
234
|
+
self._spin.setDecimals(self._decimals)
|
|
235
|
+
self._spin.setRange(
|
|
236
|
+
minimum if minimum is not None else default_min,
|
|
237
|
+
maximum if maximum is not None else default_max,
|
|
238
|
+
)
|
|
239
|
+
self._spin.setSingleStep(step if step is not None else 1)
|
|
240
|
+
self._spin.valueChanged.connect(self._on_changed)
|
|
241
|
+
|
|
242
|
+
layout = QHBoxLayout(self)
|
|
243
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
244
|
+
layout.addWidget(self._spin)
|
|
245
|
+
|
|
246
|
+
def _format(self, value: float) -> str:
|
|
247
|
+
return f"{value:.{self._decimals}f}" if self._decimals else str(int(value))
|
|
248
|
+
|
|
249
|
+
def _on_changed(self, value: float) -> None:
|
|
250
|
+
self.value_changed.emit(self._format(value))
|
|
251
|
+
|
|
252
|
+
def set_value(self, value: str) -> None:
|
|
253
|
+
self._spin.blockSignals(True)
|
|
254
|
+
try:
|
|
255
|
+
self._spin.setValue(float(value))
|
|
256
|
+
except ValueError:
|
|
257
|
+
pass
|
|
258
|
+
self._spin.blockSignals(False)
|
|
259
|
+
|
|
260
|
+
def value(self) -> str:
|
|
261
|
+
return self._format(self._spin.value())
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
class MultiLineSettingWidget(QWidget):
|
|
265
|
+
"""A list editor for a multi-value setting (``setting["multi"]``):
|
|
266
|
+
kitty accepts one line per repetition of the directive (e.g.
|
|
267
|
+
``font_features``, ``modify_font``, ``symbol_map``, ``env``, ...). Each
|
|
268
|
+
row here is the raw text of one such line, verbatim.
|
|
269
|
+
"""
|
|
270
|
+
|
|
271
|
+
value_changed = Signal(list)
|
|
272
|
+
|
|
273
|
+
def __init__(self, placeholder: str, parent: QWidget | None = None) -> None:
|
|
274
|
+
super().__init__(parent)
|
|
275
|
+
self._placeholder = placeholder
|
|
276
|
+
|
|
277
|
+
self._list = QListWidget()
|
|
278
|
+
|
|
279
|
+
add_button = QPushButton(_("Add…"))
|
|
280
|
+
add_button.clicked.connect(self._on_add)
|
|
281
|
+
edit_button = QPushButton(_("Edit…"))
|
|
282
|
+
edit_button.clicked.connect(self._on_edit)
|
|
283
|
+
remove_button = QPushButton(_("Remove"))
|
|
284
|
+
remove_button.clicked.connect(self._on_remove)
|
|
285
|
+
|
|
286
|
+
buttons = QHBoxLayout()
|
|
287
|
+
buttons.addWidget(add_button)
|
|
288
|
+
buttons.addWidget(edit_button)
|
|
289
|
+
buttons.addWidget(remove_button)
|
|
290
|
+
buttons.addStretch(1)
|
|
291
|
+
|
|
292
|
+
layout = QVBoxLayout(self)
|
|
293
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
294
|
+
layout.addWidget(self._list)
|
|
295
|
+
layout.addLayout(buttons)
|
|
296
|
+
|
|
297
|
+
def _emit_changed(self) -> None:
|
|
298
|
+
self.value_changed.emit(self.value())
|
|
299
|
+
|
|
300
|
+
def _on_add(self) -> None:
|
|
301
|
+
text, ok = QInputDialog.getText(self, _("Add line"), self._placeholder)
|
|
302
|
+
if ok and text.strip():
|
|
303
|
+
self._list.addItem(text.strip())
|
|
304
|
+
self._emit_changed()
|
|
305
|
+
|
|
306
|
+
def _on_edit(self) -> None:
|
|
307
|
+
item = self._list.currentItem()
|
|
308
|
+
if item is None:
|
|
309
|
+
return
|
|
310
|
+
text, ok = QInputDialog.getText(
|
|
311
|
+
self, _("Edit line"), self._placeholder, text=item.text()
|
|
312
|
+
)
|
|
313
|
+
if ok and text.strip():
|
|
314
|
+
item.setText(text.strip())
|
|
315
|
+
self._emit_changed()
|
|
316
|
+
|
|
317
|
+
def _on_remove(self) -> None:
|
|
318
|
+
row = self._list.currentRow()
|
|
319
|
+
if row >= 0:
|
|
320
|
+
self._list.takeItem(row)
|
|
321
|
+
self._emit_changed()
|
|
322
|
+
|
|
323
|
+
def set_value(self, values: list[str]) -> None:
|
|
324
|
+
self._list.blockSignals(True)
|
|
325
|
+
self._list.clear()
|
|
326
|
+
self._list.addItems(values)
|
|
327
|
+
self._list.blockSignals(False)
|
|
328
|
+
|
|
329
|
+
def value(self) -> list[str]:
|
|
330
|
+
return [self._list.item(i).text() for i in range(self._list.count())]
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
def build_setting_widget(setting: dict[str, Any]) -> QWidget:
|
|
334
|
+
"""Instantiate the right widget class for *setting* (a schema entry)."""
|
|
335
|
+
app_type = setting["app_type"]
|
|
336
|
+
|
|
337
|
+
if app_type == "font_features":
|
|
338
|
+
return MultiLineSettingWidget(
|
|
339
|
+
_("One font family + feature tags per line, e.g.: Family +ss01 -calt")
|
|
340
|
+
)
|
|
341
|
+
if app_type == "modify_font":
|
|
342
|
+
return MultiLineSettingWidget(
|
|
343
|
+
_("One directive per line, e.g.: underline_position 2")
|
|
344
|
+
)
|
|
345
|
+
if setting.get("multi"):
|
|
346
|
+
return MultiLineSettingWidget(_("One line per entry"))
|
|
347
|
+
|
|
348
|
+
if app_type == "color":
|
|
349
|
+
return ColorSettingWidget(str(setting["default"]))
|
|
350
|
+
if app_type == "font":
|
|
351
|
+
return FontSettingWidget(allow_auto=setting.get("allow_auto", False))
|
|
352
|
+
if app_type == "bool":
|
|
353
|
+
return BooleanSettingWidget()
|
|
354
|
+
if app_type == "select":
|
|
355
|
+
return SelectSettingWidget(setting["choices"])
|
|
356
|
+
if app_type in ("int", "float"):
|
|
357
|
+
return NumberSettingWidget(
|
|
358
|
+
is_int=app_type == "int",
|
|
359
|
+
minimum=setting.get("min"),
|
|
360
|
+
maximum=setting.get("max"),
|
|
361
|
+
step=setting.get("step"),
|
|
362
|
+
)
|
|
363
|
+
return TextSettingWidget(str(setting["default"]))
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: PBKittyConfigStudio
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A desktop GUI for configuring the kitty terminal
|
|
5
|
+
Project-URL: Homepage, https://github.com/kovidgoyal/kitty
|
|
6
|
+
Author-email: Marcel Spock <mrspock@cardolan.net>
|
|
7
|
+
License-Expression: GPL-3.0-or-later
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: config,gui,kitty,qt,terminal
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Environment :: X11 Applications :: Qt
|
|
12
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Terminals
|
|
16
|
+
Classifier: Topic :: Utilities
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Requires-Dist: pyside6>=6.6.0
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
21
|
+
Requires-Dist: pre-commit>=3.7; extra == 'dev'
|
|
22
|
+
Requires-Dist: pytest-cov>=5; extra == 'dev'
|
|
23
|
+
Requires-Dist: pytest-qt>=4; extra == 'dev'
|
|
24
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
25
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
26
|
+
Requires-Dist: twine>=5; extra == 'dev'
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# PBKittyConfigStudio
|
|
30
|
+
|
|
31
|
+
[](https://github.com/ppoilbarbe/PBKittyConfigStudio/releases/latest)
|
|
32
|
+
[](https://github.com/ppoilbarbe/PBKittyConfigStudio/actions/workflows/ci.yml)
|
|
33
|
+
[](https://codecov.io/gh/ppoilbarbe/PBKittyConfigStudio)
|
|
34
|
+
[](https://pypi.org/project/pbkittyconfigstudio/)
|
|
35
|
+
|
|
36
|
+
Although [kitty](https://github.com/kovidgoyal/kitty) is a keyboard-driven
|
|
37
|
+
terminal for power users that also fully supports the mouse, editing its
|
|
38
|
+
configuration file can be a chore: knowing the options, their possible
|
|
39
|
+
values, their defaults... you need the documentation open in front of you.
|
|
40
|
+
|
|
41
|
+
This program is a graphical interface for configuring the
|
|
42
|
+
[kitty](https://github.com/kovidgoyal/kitty) terminal. It covers a broad
|
|
43
|
+
set of kitty's configuration options, pulled directly from
|
|
44
|
+
[kitty](https://github.com/kovidgoyal/kitty)'s own source (see
|
|
45
|
+
[CODING.md](CODING.md) for how).
|
|
46
|
+
|
|
47
|
+
Built with Python and PySide6 (Qt6), the app needs nothing else.
|
|
48
|
+
|
|
49
|
+
## Features
|
|
50
|
+
|
|
51
|
+
- **~237 settings** across 12 categories, mirroring kitty's own grouping:
|
|
52
|
+
fonts, cursor, scrollback, mouse, performance, terminal bell, window
|
|
53
|
+
layout, tab bar, color scheme (including the 16 ANSI colors and mark
|
|
54
|
+
colors), advanced, OS-specific tweaks, and the non-mapping keyboard
|
|
55
|
+
shortcut settings.
|
|
56
|
+
- **Real widgets for real values** — color pickers, spin boxes, toggle
|
|
57
|
+
switches, dropdowns, a font picker built on Qt's own font database (no
|
|
58
|
+
shelling out to `fc-list`), and a list editor for repeatable settings
|
|
59
|
+
such as `font_features`/`modify_font`.
|
|
60
|
+
- **Search** — a search box above the sidebar filters settings by name or
|
|
61
|
+
label across every category.
|
|
62
|
+
- **Default vs. modified at a glance** — every row is badged "default" or
|
|
63
|
+
"modified" against kitty's own default value.
|
|
64
|
+
- **Non-destructive** — every save writes a timestamped backup
|
|
65
|
+
(`kitty.conf.bak_<date>`) first, and rewrites existing lines (including
|
|
66
|
+
commented-out ones) in place with a targeted regex, leaving comments and
|
|
67
|
+
everything else in the file untouched. A value equal to its default is
|
|
68
|
+
written back as a commented-out line, documenting it without forcing it.
|
|
69
|
+
- **Hot reload** — best-effort `SIGUSR1` to running kitty instances after a
|
|
70
|
+
save.
|
|
71
|
+
- **Restore default configuration** — regenerates kitty's own pristine,
|
|
72
|
+
fully-commented example `kitty.conf` (via a throwaway `kitty` instance)
|
|
73
|
+
and overwrites the current file, behind a confirmation dialog and the
|
|
74
|
+
usual timestamped backup.
|
|
75
|
+
- **Translated UI** — English and French out of the box (see
|
|
76
|
+
[Development](#development) to add a language).
|
|
77
|
+
- **Stays in sync with kitty** — the settings schema is generated straight
|
|
78
|
+
from kitty's own option definitions rather than hand-maintained; see
|
|
79
|
+
[CODING.md](CODING.md) for the full pipeline.
|
|
80
|
+
|
|
81
|
+
## Requirements
|
|
82
|
+
|
|
83
|
+
- Python 3.12+
|
|
84
|
+
- [kitty](https://github.com/kovidgoyal/kitty) terminal
|
|
85
|
+
- [pixi](https://pixi.sh) (recommended) to manage the development environment
|
|
86
|
+
|
|
87
|
+
## Quick Start
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
make venv # create the pixi environment (installs pixi if missing)
|
|
91
|
+
make run # launch PBKittyConfigStudio
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Or, without pixi, in any Python 3.12+ environment:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pip install -e .
|
|
98
|
+
python -m pb_kitty_config_studio
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Development
|
|
102
|
+
|
|
103
|
+
This project uses [pixi](https://pixi.sh) for environment management and a
|
|
104
|
+
`Makefile` for all common tasks — see `make help` for the full list.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
make venv # create/update the pixi environment
|
|
108
|
+
make install # editable install + pre-commit hooks
|
|
109
|
+
make test # run the test suite
|
|
110
|
+
make lint # ruff check + format --check
|
|
111
|
+
make format # ruff format + check --fix
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
See [CODING.md](CODING.md) for the architecture, the schema generation/
|
|
115
|
+
curation pipeline, and the i18n extraction details — start there before
|
|
116
|
+
adding or changing a setting.
|
|
117
|
+
|
|
118
|
+
### Translations
|
|
119
|
+
|
|
120
|
+
Strings are managed with [pybabel](https://babel.pocoo.org/) (never
|
|
121
|
+
`xgettext`/`msgfmt` directly).
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
make translate # extract strings, update & compile .po/.mo
|
|
125
|
+
make new-lang LOCALE=de # scaffold a new language
|
|
126
|
+
python tools/po_check.py # translation stats / search untranslated entries
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Packaging
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
make dist # standalone PyInstaller executable → dist/
|
|
133
|
+
make srcdist # source archive (git archive) → dist/
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The PyInstaller build embeds the OS-level app icon (`.ico` on Windows,
|
|
137
|
+
`.icns` in the macOS `.app` bundle). Icons are sourced from the `PBIcons`
|
|
138
|
+
project; sync them with:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
make update-icons
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
GNU General Public License v3.0 or later — see [LICENSE](LICENSE).
|
|
147
|
+
|
|
148
|
+
## Credits
|
|
149
|
+
|
|
150
|
+
- **Kovid Goyal and the kitty development team** — many thanks for building
|
|
151
|
+
and maintaining the [kitty](https://github.com/kovidgoyal/kitty) terminal
|
|
152
|
+
this app configures.
|
|
153
|
+
|
|
154
|
+
## Author
|
|
155
|
+
|
|
156
|
+
Marcel Spock <mrspock@cardolan.net>
|
|
157
|
+
PBMou
|
|
158
|
+
|
|
159
|
+
PBMou is a cross-language pun: "PB" stands for "Poilbarbe", and "Mou" is the
|
|
160
|
+
French translation of "Soft" — so PBMou reads like "PBSoft" half-translated
|
|
161
|
+
into French.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
pb_kitty_config_studio/__init__.py,sha256=YeYHevAh-8eIF2zEnJ0Te0vGb_pC9H2JU1bPi0C-Q3Y,103
|
|
2
|
+
pb_kitty_config_studio/__main__.py,sha256=-OJ_In6I6tYmWEAb_dR2bY0Qc6YMvks2fBO5aoJfuYo,5095
|
|
3
|
+
pb_kitty_config_studio/argparse_qt.py,sha256=3GBe-J5m0ILpMvk__M9cdhvZO91lsLnCM1ZBFCQADSY,3884
|
|
4
|
+
pb_kitty_config_studio/i18n.py,sha256=CxGtlUhAPIbyE4Ig82FPFP_ARap4iiMBKS1GH95cGdQ,3847
|
|
5
|
+
pb_kitty_config_studio/config/__init__.py,sha256=cpNZc53iRgvF-ozqmLvFbPi65aHha-iJvx18mGvv8VI,2905
|
|
6
|
+
pb_kitty_config_studio/config/_babel_extractor.py,sha256=oNULS0YDRfsyDYI4YnwMDQMcm3A2Mw_everoIo8d6wE,1200
|
|
7
|
+
pb_kitty_config_studio/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
pb_kitty_config_studio/core/kitty_conf.py,sha256=H0cjcivk3d4psnVJMqAl6NKngHLdOWeTgE2GapbiEB8,11640
|
|
9
|
+
pb_kitty_config_studio/locale/en/LC_MESSAGES/pb_kitty_config_studio.po,sha256=TFZ3sh4qI3rIgfqolN_XNCJdiRS3soqdtOCNMBMPuUw,18905
|
|
10
|
+
pb_kitty_config_studio/locale/fr/LC_MESSAGES/pb_kitty_config_studio.po,sha256=nxgSW8XIQwnGkqxD4mkl0g300RwbbqHI9ZgYuLxNumk,21410
|
|
11
|
+
pb_kitty_config_studio/platform/__init__.py,sha256=4hmBGkFGWWvtW7nNSn-ou_YVzB5fjx7cBC4PugAxGsM,62
|
|
12
|
+
pb_kitty_config_studio/platform/auto_update.py,sha256=ee5W3BtK-_mTs9dt2-fbRxRLztBiAD2_XMqLvlST_wU,9236
|
|
13
|
+
pb_kitty_config_studio/platform/desktop.py,sha256=WfX5OdO1nYHwotGxeI65KHhM3q2-lRQQ7APPZcYNaVE,6085
|
|
14
|
+
pb_kitty_config_studio/resources/__init__.py,sha256=r8U1giyOKlIA_w0oVC9D3TBFJ1b4u4yYunVqgn8UfP4,1471
|
|
15
|
+
pb_kitty_config_studio/resources/cancel.svg,sha256=sSfA2jcdR5_Ym4eu4DQC_tn6elXXBgTriyjA55PxsnE,1011
|
|
16
|
+
pb_kitty_config_studio/resources/clear-all-data.svg,sha256=7Dkao-SUSUXgd8cvaw_vI9sK5WIg6eIzQUT5WXid0fY,6969
|
|
17
|
+
pb_kitty_config_studio/resources/help-about.svg,sha256=6SaiSRKofD-XFP-3cJtEXsQXxakYLTi0TC_AFNBPAI8,10373
|
|
18
|
+
pb_kitty_config_studio/resources/pbkittyconfigstudio.icns,sha256=jG20SRUDWj7Sn7VgrMTPRk4vPHOWKnIaXAFdINRW6xU,1265935
|
|
19
|
+
pb_kitty_config_studio/resources/pbkittyconfigstudio.ico,sha256=0MozQeoI-KUyk_WCGHVUrsxhVpce77RYvVDg1RaQzBU,172066
|
|
20
|
+
pb_kitty_config_studio/resources/pbkittyconfigstudio.png,sha256=8PPvUXzSnqATvDxFVsGtSPdwbaMghnmHzHWBDkgL8pw,281200
|
|
21
|
+
pb_kitty_config_studio/resources/quit.svg,sha256=PHDYxoEV-cqP-tsSaEvKCiD95o57rcIiWGvdpXamtnA,1944
|
|
22
|
+
pb_kitty_config_studio/resources/refresh.svg,sha256=RZIVPLhZf4iS-Qy-1FZ7PFgw04i2noncwxJm2dR5CRs,5517
|
|
23
|
+
pb_kitty_config_studio/resources/save-as.svg,sha256=aVP5oz5gdOZc7fw8KDP5m7QToHHPqhFiOGwN5Hcoo9Y,4177
|
|
24
|
+
pb_kitty_config_studio/resources/save.svg,sha256=fZwDlfTw1ZQ3w1PkGrgEwUZJXkdmPRO8GLI9zbqV2SE,5467
|
|
25
|
+
pb_kitty_config_studio/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
+
pb_kitty_config_studio/ui/about_dialog.py,sha256=i6Ksm1KhqTSnCynmHkdT_bOT2YndmkCG8QD8tCcNl1g,5029
|
|
27
|
+
pb_kitty_config_studio/ui/main_window.py,sha256=YrannbhM083VluZbySGeQxLeLggHvaCpJXKJBTRSjtM,17384
|
|
28
|
+
pb_kitty_config_studio/ui/widgets.py,sha256=2Vw0lkn_6aTQf_klKvqYstbOT6OwdNe35Sz3oR4EmWg,11839
|
|
29
|
+
pb_kitty_config_studio/config/schema.json,sha256=gQiATQGS1oagk1U3lSOQlDAPOO9z_qcMf6u0ZfVYlAY,207127
|
|
30
|
+
pb_kitty_config_studio/locale/en/LC_MESSAGES/pb_kitty_config_studio.mo,sha256=pGqs0Uk6JKNAKk1d9GhE7wDX6IB9kevVuii7MWFdTbE,17897
|
|
31
|
+
pb_kitty_config_studio/locale/fr/LC_MESSAGES/pb_kitty_config_studio.mo,sha256=D81Y2TzYGjJ8GePvXe9RkgaLU1SEsu33nb1D2jhCxxA,20388
|
|
32
|
+
pbkittyconfigstudio-0.1.0.dist-info/METADATA,sha256=W--QTC1pg1z9Aq4WTXVMaPRXxub3TOPpUlcu2i7PJ6I,6320
|
|
33
|
+
pbkittyconfigstudio-0.1.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
34
|
+
pbkittyconfigstudio-0.1.0.dist-info/entry_points.txt,sha256=wh347NjGGj6XoZBj1ZxKgWRxozK0_sNoRC4N44B7unw,77
|
|
35
|
+
pbkittyconfigstudio-0.1.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
36
|
+
pbkittyconfigstudio-0.1.0.dist-info/RECORD,,
|