mirror of
https://github.com/wizbright/waybox.git
synced 2025-10-29 05:40:20 -04:00
Let setting the keyboard layout through the XKB_DEFAULT_* environment variables
This commit is contained in:
parent
7570698224
commit
7191191377
1 changed files with 8 additions and 3 deletions
|
|
@ -99,9 +99,14 @@ static void server_new_keyboard(struct wb_server *server,
|
||||||
keyboard->server = server;
|
keyboard->server = server;
|
||||||
keyboard->device = device;
|
keyboard->device = device;
|
||||||
|
|
||||||
/* We need to prepare an XKB keymap and assign it to the keyboard. This
|
/* We need to prepare an XKB keymap and assign it to the keyboard. */
|
||||||
* assumes the defaults (e.g. layout = "us"). */
|
struct xkb_rule_names rules = {
|
||||||
struct xkb_rule_names rules = { 0 };
|
.rules = getenv("XKB_DEFAULT_RULES"),
|
||||||
|
.model = getenv("XKB_DEFAULT_MODEL"),
|
||||||
|
.layout = getenv("XKB_DEFAULT_LAYOUT"),
|
||||||
|
.variant = getenv("XKB_DEFAULT_VARIANT"),
|
||||||
|
.options = getenv("XKB_DEFAULT_OPTIONS"),
|
||||||
|
};
|
||||||
struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
||||||
struct xkb_keymap *keymap = xkb_map_new_from_names(context, &rules,
|
struct xkb_keymap *keymap = xkb_map_new_from_names(context, &rules,
|
||||||
XKB_KEYMAP_COMPILE_NO_FLAGS);
|
XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue