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

Use xkb group names instead of ids #3115

Open
teto opened this Issue Jan 8, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@teto

teto commented Jan 8, 2018

I sometimes switch dynamically between different keyboards layouts. As I sync my i3 config across several computers with different keyboards, I can't rely on the bindkeycode and anyway I prefer to use bindsym which is easier to read.
Thus I make use of the "GroupX" feature of i3 which allows to keep using the same physical keys for the same i3 actions across layouts with for instance the azerty/qwerty example:

bindsym $mod+a workspace "$w1"
bindsym $mod+z workspace "$w2"
...
bindsym Group2+$mod+q workspace "$w1"
bindsym Group2+$mod+w workspace "$w2"

The problem with this approach is that depends on the xkb layout load order which varies across my machines. It's possible to make it similar across machines but I - admittedly naively - wondered if we could have sthg like GroupAzerty/GroupQwerty in order to have in i3 config

bindsym GroupAzerty+$mod+a workspace "$w1"
bindsym GroupAzerty+$mod+z workspace "$w2"
...
bindsym GroupQwerty+$mod+q workspace "$w1"
bindsym GroupQwerty+$mod+w workspace "$w2"

or bindsym --GroupQwerty $mod+w workspace "$w2" so that xkb loading order doesn't matter. It also makes it easier to distinguish the group (similar to keycode vs bindsym).

@i3 i3 deleted a comment from i3bot Jan 9, 2018

@i3 i3 deleted a comment from i3bot Jan 9, 2018

@Airblader

This comment has been minimized.

Show comment
Hide comment
@Airblader

Airblader Feb 9, 2018

Member

Are these group names something actually configured with XKB?

As a quick alternative, by the way, you could use variables for that

set $GroupQwerty Group1

If you want to use the same i3 config on all machines you could use set_from_resource to define this via Xresources where you can use #include with a machine-specific file.

Member

Airblader commented Feb 9, 2018

Are these group names something actually configured with XKB?

As a quick alternative, by the way, you could use variables for that

set $GroupQwerty Group1

If you want to use the same i3 config on all machines you could use set_from_resource to define this via Xresources where you can use #include with a machine-specific file.

@teto

This comment has been minimized.

Show comment
Hide comment
@teto

teto Feb 19, 2018

there are some utilities such as xkeyboard-config (part of xorg I believe) https://www.mankier.com/7/xkeyboard-config so the layout names seem kinda standardized.
See also xkb-switch -s us and https://unix.stackexchange.com/questions/43976/list-all-valid-kbd-layouts-variants-and-toggle-options-to-use-with-setxkbmap .

I use the variable trick with success so far :)

teto commented Feb 19, 2018

there are some utilities such as xkeyboard-config (part of xorg I believe) https://www.mankier.com/7/xkeyboard-config so the layout names seem kinda standardized.
See also xkb-switch -s us and https://unix.stackexchange.com/questions/43976/list-all-valid-kbd-layouts-variants-and-toggle-options-to-use-with-setxkbmap .

I use the variable trick with success so far :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment