Cleanup previous PR

This commit is contained in:
Kovid Goyal
2023-03-19 10:37:37 +05:30
parent 14dcf38e51
commit fda2646dd3
10 changed files with 33 additions and 12 deletions

View File

@@ -858,8 +858,8 @@ MP3 or WAV on macOS (NSSound)
'''
)
opt('linux_bell_theme_name', '__custom',
long_text='If audio bell is enabled on Linux, sets the XDG Sound Theme kitty will use to play the bell sound.'
opt('linux_bell_theme', '__custom', ctype='!bell_theme',
long_text='The XDG Sound Theme kitty will use to play the bell sound.'
' Defaults to the custom theme name used by GNOME and Budgie, falling back to the default freedesktop theme if it does not exist.'
' This option may be removed if Linux ever provides desktop-agnostic support for setting system sound themes.'
)

View File

@@ -1024,8 +1024,8 @@ class Parser:
def kitty_mod(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
ans['kitty_mod'] = to_modifiers(val)
def linux_bell_theme_name(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
ans['linux_bell_theme_name'] = str(val)
def linux_bell_theme(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
ans['linux_bell_theme'] = str(val)
def linux_display_server(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
val = val.lower()

View File

@@ -473,6 +473,19 @@ convert_from_opts_bell_path(PyObject *py_opts, Options *opts) {
Py_DECREF(ret);
}
static void
convert_from_python_linux_bell_theme(PyObject *val, Options *opts) {
bell_theme(val, opts);
}
static void
convert_from_opts_linux_bell_theme(PyObject *py_opts, Options *opts) {
PyObject *ret = PyObject_GetAttrString(py_opts, "linux_bell_theme");
if (ret == NULL) return;
convert_from_python_linux_bell_theme(ret, opts);
Py_DECREF(ret);
}
static void
convert_from_python_active_border_color(PyObject *val, Options *opts) {
opts->active_border_color = active_border_color(val);
@@ -1119,6 +1132,8 @@ convert_opts_from_python_opts(PyObject *py_opts, Options *opts) {
if (PyErr_Occurred()) return false;
convert_from_opts_bell_path(py_opts, opts);
if (PyErr_Occurred()) return false;
convert_from_opts_linux_bell_theme(py_opts, opts);
if (PyErr_Occurred()) return false;
convert_from_opts_active_border_color(py_opts, opts);
if (PyErr_Occurred()) return false;
convert_from_opts_inactive_border_color(py_opts, opts);

View File

@@ -104,6 +104,10 @@ background_image(PyObject *src, Options *opts) { STR_SETTER(background_image); }
static void
bell_path(PyObject *src, Options *opts) { STR_SETTER(bell_path); }
static void
bell_theme(PyObject *src, Options *opts) { STR_SETTER(bell_theme); }
static void
window_logo_path(PyObject *src, Options *opts) { STR_SETTER(default_window_logo); }

View File

@@ -376,7 +376,7 @@ option_names = ( # {{{
'italic_font',
'kitten_alias',
'kitty_mod',
'linux_bell_theme_name',
'linux_bell_theme',
'linux_display_server',
'listen_on',
'macos_colorspace',
@@ -535,7 +535,7 @@ class Options:
input_delay: int = 3
italic_font: str = 'auto'
kitty_mod: int = 5
linux_bell_theme_name: str = '__custom'
linux_bell_theme: str = '__custom'
linux_display_server: choices_for_linux_display_server = 'auto'
listen_on: str = 'none'
macos_colorspace: choices_for_macos_colorspace = 'srgb'