From b9142a94aecfc0633f7aec52dc21848e5e9b7bcb Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sat, 26 Dec 2020 21:32:06 +0000 Subject: [PATCH] Add xkb config options --- include/cfg.h | 5 +++++ src/main.c | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/cfg.h b/include/cfg.h index 9c7a50a..b067bf8 100644 --- a/include/cfg.h +++ b/include/cfg.h @@ -28,6 +28,11 @@ X(string, address) \ X(uint, port) \ X(bool, enable_pam) \ + X(string, xkb_rules) \ + X(string, xkb_model) \ + X(string, xkb_layout) \ + X(string, xkb_variant) \ + X(string, xkb_options) \ struct cfg { #define string char* diff --git a/src/main.c b/src/main.c index 2eb4534..5f352e3 100644 --- a/src/main.c +++ b/src/main.c @@ -946,9 +946,12 @@ int main(int argc, char* argv[]) self.keyboard_manager, self.selected_seat->wl_seat); struct xkb_rule_names rule_names = { - .layout = self.kb_layout, - .model = "pc105", - .variant = self.kb_variant, + .rules = self.cfg.xkb_rules, + .layout = self.kb_layout ? self.kb_layout : self.cfg.xkb_layout, + .model = self.cfg.xkb_model ? self.cfg.xkb_model : "pc105", + .variant = self.kb_variant ? self.kb_variant : + self.cfg.xkb_variant, + .options = self.cfg.xkb_options, }; keyboard_init(&self.keyboard_backend, &rule_names);