From 21170bd3d782c597b02ada3cce799986c329b3c5 Mon Sep 17 00:00:00 2001 From: LilleAila Date: Sat, 13 Jul 2024 16:47:43 +0200 Subject: [PATCH] fixed typo in linux readme --- linux/README.md | 2 +- plover/gui_qt/config_window.py | 6 ++---- plover/oslayer/linux/keyboardcontrol_uinput.py | 10 +++++++--- plover/oslayer/linux/xkb_symbols.py | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/linux/README.md b/linux/README.md index 7973a57b6..e94faf491 100644 --- a/linux/README.md +++ b/linux/README.md @@ -8,6 +8,6 @@ distribution corresponding packages): - Treal support: `libusb` (1.0) and `libudev` are needed by the [`hidapi` package](https://pypi.org/project/hidapi/). - log / notifications support: `libdbus` is needed. -- Uinput support: `libxkbcommon` are needed by the [`xkbcommon` package](https://pypi.org/project/xkbcommon) +- Uinput support: `libxkbcommon` is needed by the [`xkbcommon` package](https://pypi.org/project/xkbcommon) For the rest of the steps, follow the [developer guide](../doc/developer_guide.md). diff --git a/plover/gui_qt/config_window.py b/plover/gui_qt/config_window.py index c24818f75..bc045f276 100644 --- a/plover/gui_qt/config_window.py +++ b/plover/gui_qt/config_window.py @@ -410,10 +410,8 @@ def __init__(self, engine): '\n' 'This only applies when using Linux/BSD and not using X11.\n' 'If you\'re unsure, you probably don\'t need to change it.\n' - 'If you need to configure more options about your layout,\n' - 'such as setting the variant to a different layout like colemak,\n' - 'you can set environment variables starting with XKB_DEFAULT_\n' - 'for the RULES, MODEL, VARIANT and OPTIONS')), + 'If you use a different layout variant, format it as\n' + '"language:layout", for example "us:colemak"')), )), # i18n: Widget: “ConfigWindow”. (_('Plugins'), ( diff --git a/plover/oslayer/linux/keyboardcontrol_uinput.py b/plover/oslayer/linux/keyboardcontrol_uinput.py index 071138131..04b0cdcb6 100644 --- a/plover/oslayer/linux/keyboardcontrol_uinput.py +++ b/plover/oslayer/linux/keyboardcontrol_uinput.py @@ -173,9 +173,13 @@ def __init__(self): self._res = util.find_ecodes_by_regex(r"KEY_.*") self._ui = UInput(self._res) - def _update_layout(self, layout): - log.info("Using keyboard layout " + layout + " for keyboard emulation.") - symbols = generate_symbols(layout) + def _update_layout(self, _layout): + log.info("Using keyboard layout " + + _layout + " for keyboard emulation.") + _layout_options = _layout.split(":") + layout = _layout_options[0] + variant = _layout_options[1] if len(_layout_options) > 1 else "" + symbols = generate_symbols(layout, variant) # Remove symbols not in KEY_TO_KEYCODE syms_to_remove = [] for sym in symbols: diff --git a/plover/oslayer/linux/xkb_symbols.py b/plover/oslayer/linux/xkb_symbols.py index 72b863aae..c192c6cd3 100644 --- a/plover/oslayer/linux/xkb_symbols.py +++ b/plover/oslayer/linux/xkb_symbols.py @@ -8,9 +8,9 @@ # layout can be "no", "us", "gb", "fr" or any other xkb layout -def generate_symbols(layout="us"): +def generate_symbols(layout="us", variant = ""): ctx = xkb.Context() - keymap = ctx.keymap_new_from_names(layout=layout) + keymap = ctx.keymap_new_from_names(layout=layout, variant=variant) # The keymaps have to be "translated" to a US layout keyboard for evdev keymap_us = ctx.keymap_new_from_names(layout="us")