You are not logged in.

#1 2021-12-10 11:06:13

peonerovv
Member
Registered: 2021-08-11
Posts: 34

[SOLVED] Changing keymap in wayland.

Hi,

I'm trying out wayland (dwl specifically), but I'd like to use the Swedish keymap instead of US one. How do I change it?

Thanks.

Last edited by peonerovv (2021-12-11 11:35:28)

Offline

#2 2021-12-10 11:38:34

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Changing keymap in wayland.

dwl wiki wrote:

All configuration is done by editing config.h and recompiling, in the same manner as dwm.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2021-12-10 13:03:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,493
Website

Re: [SOLVED] Changing keymap in wayland.

To expand slightly on the above, wayland isn't a real thing; it's a protocol, an idea, or a concept.  There is no implementation other than your compositor.  With X11 you had the Xorg server and a window manager as separated bits of software - and questions about the keymap would be addressed at the level of the Xorg server, so it is meaningful to ask a question like "How do I change my keymap in X11" (or really that should be Xorg not X11, but for better or worse the two are used interchangeably now).  But "How do I change my keymap in Wayland" makes no sense; you have to change it in your compositor - in your case in dwl's settings which are commented on above.

And how you do this in dwl is completely different than how you'd do it in sway, or weston, or any other wayland compositor.  There may be some vague similarity as they all use similar protocols to talk to clients, so some convergence in how you specific some configuration is likely - but this is mostly just coincidence: different compositors *can* handle such things completely differently, and some will not handle it at all.

All that said, *many* compositors use xkbcommon, and those that do can be influenced by the same environment variables.  As I'm pretty sure this is the case for dwl, you can see here for the answer for another compositor that uses xkbcommon.  In short, set (and export) XKB_DEFAULT_LAYOUT before starting dwl.  It can be set to the two-letter abbreviation for the Swedish locale (which I don't know off hand).  This should be easier and will not require a recompile.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2021-12-11 11:34:59

peonerovv
Member
Registered: 2021-08-11
Posts: 34

Re: [SOLVED] Changing keymap in wayland.

I added .layout = "se" in the keyboard section in the config.h file and recompiled. Thanks for the explanation everybody!

Offline

Board footer

Powered by FluxBB