Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict between keyboard variants when using multiple keyboards with specific layouts #7155

Open
ortolot opened this issue Sep 2, 2022 · 0 comments

Comments

@ortolot
Copy link

ortolot commented Sep 2, 2022

Hello,

I am using a setup with two so-called keyboards:

  • a regular keyboard, layout fr, variant oss;
  • a barcode reader, layout us, variant euro.

That configuration does not work:

input type:keyboard {
    xkb_layout fr
    xkb_variant oss
}

# Barcode reader
input 1155:22352:STMicroelectronics_BCST-60_Keyboard {
    xkb_layout us
}

Sway complains: Error on line 8 (~/.config/sway/config) 'xkb_layout us': Failed to compile keymap: couldn't process include statement for 'us(oss)'

That seems normal since us(oss) does not exist, but when completed like this:

input type:keyboard {
    xkb_layout fr
    xkb_variant oss
}

# Barcode reader
input 1155:22352:STMicroelectronics_BCST-60_Keyboard {
    xkb_layout us
    xkb_variant euro
}

Sway still complains: Error on line 8 (~/.config/sway/config) 'xkb_layout us': Failed to compile keymap: couldn't process include statement for 'us(oss)'

It looks like Sway is trying to set the keyboard layout as soon as it sees the xkb_layout directive, without waiting for a possible variant specification.

When corrected that way:

input type:keyboard {
    xkb_layout fr
    xkb_variant oss
}

# Barcode reader
input 1155:22352:STMicroelectronics_BCST-60_Keyboard {
    xkb_variant euro
    xkb_layout us
}

Sway still complaing, but differently: Error on line 8 (~/.config/sway/config) 'xkb_variant euro': Failed to compile keymap: couldn't process include statement for 'fr(euro)'

It looks like Sway is trying to set the keyboard variant without waiting for a possible layout specification, and fr(euro) indeed does not exist.

I eventually found a solution, but I think it would be better if Sway could wait for the entire input block before setting anything. If that is feasible, that is… My current workaround is:

input type:keyboard {
    xkb_layout fr
    xkb_variant oss
}

# Barcode reader
input 1155:22352:STMicroelectronics_BCST-60_Keyboard {
    xkb_variant basic # that exists in both fr and us layouts
    xkb_layout us
    xkb_variant euro
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant