You are not logged in.
Pages: 1
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
All configuration is done by editing config.h and recompiling, in the same manner as dwm.
Offline
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
I added .layout = "se" in the keyboard section in the config.h file and recompiled. Thanks for the explanation everybody!
Offline
Pages: 1