Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ jobs:
path: .cache
key: 0_${{ steps.set_cache.outputs.cache_name }}_${{ hashFiles('reqs/constraints.txt', 'reqs/dist.txt', 'reqs/test.txt') }}

# Required to install xkbcommon Python package.
- name: Install system dependencies
run: apt_get_install libxkbcommon-dev

- name: Setup Python environment
run: setup_python_env -c reqs/constraints.txt -r reqs/dist.txt -r reqs/test.txt

Expand Down Expand Up @@ -439,6 +443,10 @@ jobs:
path: .cache
key: 0_${{ steps.set_cache.outputs.cache_name }}_${{ hashFiles('reqs/constraints.txt', 'reqs/dist.txt', 'reqs/test.txt') }}

# Required to install xkbcommon Python package.
- name: Install system dependencies
run: apt_get_install libxkbcommon-dev

- name: Setup Python environment
run: setup_python_env -c reqs/constraints.txt -r reqs/dist.txt -r reqs/test.txt

Expand Down Expand Up @@ -493,6 +501,10 @@ jobs:
path: .cache
key: 0_${{ steps.set_cache.outputs.cache_name }}_${{ hashFiles('reqs/constraints.txt', 'reqs/dist.txt', 'reqs/test.txt') }}

# Required to install xkbcommon Python package.
- name: Install system dependencies
run: apt_get_install libxkbcommon-dev

- name: Setup Python environment
run: setup_python_env -c reqs/constraints.txt -r reqs/dist.txt -r reqs/test.txt

Expand Down Expand Up @@ -547,6 +559,10 @@ jobs:
path: .cache
key: 0_${{ steps.set_cache.outputs.cache_name }}_${{ hashFiles('reqs/constraints.txt', 'reqs/dist.txt', 'reqs/test.txt') }}

# Required to install xkbcommon Python package.
- name: Install system dependencies
run: apt_get_install libxkbcommon-dev

- name: Setup Python environment
run: setup_python_env -c reqs/constraints.txt -r reqs/dist.txt -r reqs/test.txt

Expand Down Expand Up @@ -601,6 +617,10 @@ jobs:
path: .cache
key: 0_${{ steps.set_cache.outputs.cache_name }}_${{ hashFiles('reqs/constraints.txt', 'reqs/dist.txt', 'reqs/test.txt') }}

# Required to install xkbcommon Python package.
- name: Install system dependencies
run: apt_get_install libxkbcommon-dev

- name: Setup Python environment
run: setup_python_env -c reqs/constraints.txt -r reqs/dist.txt -r reqs/test.txt

Expand Down Expand Up @@ -656,7 +676,7 @@ jobs:
key: 0_${{ steps.set_cache.outputs.cache_name }}_${{ hashFiles('reqs/constraints.txt', 'reqs/dist.txt', 'reqs/dist_extra_gui_qt.txt', 'reqs/test.txt') }}

- name: Install system dependencies
run: apt_get_install libdbus-1-dev libdbus-glib-1-dev libudev-dev libegl-dev libxkbcommon-x11-0
run: apt_get_install libdbus-1-dev libdbus-glib-1-dev libudev-dev libegl-dev libxkbcommon-x11-0 libxkbcommon-dev

- name: Setup Python environment
run: setup_python_env -c reqs/constraints.txt -r reqs/dist.txt -r reqs/dist_extra_gui_qt.txt -r reqs/test.txt
Expand Down Expand Up @@ -718,6 +738,10 @@ jobs:
path: .cache
key: 0_${{ steps.set_cache.outputs.cache_name }}_${{ hashFiles('reqs/constraints.txt', 'reqs/packaging.txt', 'reqs/setup.txt') }}

# Required to install xkbcommon Python package.
- name: Install system dependencies
run: apt_get_install libxkbcommon-dev

- name: Setup Python environment
run: setup_python_env -c reqs/constraints.txt -r reqs/packaging.txt -r reqs/setup.txt

Expand Down Expand Up @@ -805,6 +829,10 @@ jobs:
path: .cache
key: 0_${{ steps.set_cache.outputs.cache_name }}_${{ hashFiles('reqs/constraints.txt', 'reqs/code_quality.txt') }}

# Required to install xkbcommon Python package.
- name: Install system dependencies
run: apt_get_install libxkbcommon-dev

- name: Setup Python environment
run: setup_python_env -c reqs/constraints.txt -r reqs/code_quality.txt

Expand Down Expand Up @@ -862,7 +890,7 @@ jobs:
key: 0_${{ steps.set_cache.outputs.cache_name }}_${{ hashFiles('reqs/constraints.txt', 'reqs/build.txt', 'reqs/setup.txt', 'reqs/dist_*.txt', 'linux/appimage/deps.sh') }}

- name: Install system dependencies
run: apt_get_install libdbus-1-dev libdbus-glib-1-dev libudev-dev libegl-dev libxkbcommon-x11-0
run: apt_get_install libdbus-1-dev libdbus-glib-1-dev libudev-dev libegl-dev libxkbcommon-x11-0 libxkbcommon-dev

- name: Setup Python environment
run: setup_python_env -c reqs/constraints.txt -r reqs/build.txt -r reqs/setup.txt
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/ci/workflow_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,17 @@ jobs:
run: setup_osx_python '<@ j.python @>'

<% endif %>
<% if j.type in ['build', 'test_gui_qt'] and j.os == 'Linux' %>
<% if j.os == 'Linux' %>
<% if j.type in ['build', 'test_gui_qt'] %>
- name: Install system dependencies
run: apt_get_install libdbus-1-dev libdbus-glib-1-dev libudev-dev libegl-dev libxkbcommon-x11-0 libxkbcommon-dev

<% else %>
# Required to install xkbcommon Python package.
- name: Install system dependencies
run: apt_get_install libdbus-1-dev libdbus-glib-1-dev libudev-dev libegl-dev libxkbcommon-x11-0
run: apt_get_install libxkbcommon-dev

<% endif %>
<% endif %>
<% if j.type != 'notarize' %>
- name: Setup Python environment
Expand Down
1 change: 1 addition & 0 deletions linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ To be able to setup a complete development environment, you'll need to manually
install some system libraries (including the development version of your
distribution corresponding packages):
- log / notifications support: `libdbus` is needed.
- 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).
1 change: 1 addition & 0 deletions news.d/feature/1807.linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support determining keyboard layout from Wayland with the `wayland-auto` layout.
2 changes: 1 addition & 1 deletion plover/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def _set(self, section, option, value):
),
choice_option(
"keyboard_layout",
("qwerty", "qwertz", "colemak", "colemak-dh", "dvorak"),
("qwerty", "qwertz", "colemak", "colemak-dh", "dvorak", "wayland-auto"),
OUTPUT_CONFIG_SECTION,
),
# Logging.
Expand Down
39 changes: 36 additions & 3 deletions plover/gui_qt/config_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,23 @@ def __init__(self, choice_false, choice_true):
super().__init__(choices)


class TextWrapQLabel(QLabel):
"""Simple QLabel wrapper that enables wordWrap"""

def __init__(self, *args):
super().__init__(*args)
self.setWordWrap(True)


class ConfigOption:
def __init__(
self, display_name, option_name, widget_class, help_text="", dependents=()
self,
display_name,
option_name,
widget_class,
help_text="",
dependents=(),
additional_widget_classes=[],
):
self.display_name = display_name
self.option_name = option_name
Expand All @@ -318,6 +332,9 @@ def __init__(
self.layout = None
self.widget = None
self.label = None
# Other widgets to be added immediately after the main widget_class
# Does not work in dependents
self.additional_widget_classes = additional_widget_classes


class ConfigWindow(QDialog, Ui_ConfigWindow, WindowStateMixin):
Expand Down Expand Up @@ -521,12 +538,26 @@ def __init__(self, engine):
"colemak": "colemak",
"colemak-dh": "colemak-dh",
"dvorak": "dvorak",
"wayland-auto": "wayland-auto",
},
),
_(
"Set the keyboard layout configurad in your system.\n"
"This only applies when using Linux/BSD and not using X11."
"Set the keyboard layout configured in your system.\n"
"This only applies when using Linux/BSD and not using X11.\n\n"
"When wayland-auto is selected,"
"Plover is only able detect the first keyboard layout\n"
"and can not detect to layout switches."
),
additional_widget_classes=[
partial(
TextWrapQLabel,
_(
"When wayland-auto is selected, "
"Plover is only able detect the first keyboard layout "
"and can not detect to layout switches."
),
)
],
),
),
),
Expand Down Expand Up @@ -592,6 +623,8 @@ def __init__(self, engine):
option.label.setToolTip(option.help_text)
option.label.setBuddy(option.widget)
layout.addRow(option.label, option.widget)
for additional_widget_class in option.additional_widget_classes:
layout.addRow(None, additional_widget_class())
frame = QFrame()
frame.setLayout(layout)
frame.setAccessibleName(section)
Expand Down
Loading
Loading