diff --git a/src/config/parse_config.h b/src/config/parse_config.h index ca1e164..f865782 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -242,6 +242,7 @@ typedef struct { int single_scratchpad; int xwayland_persistence; + struct xkb_rule_names xkb_rules; } Config; typedef void (*FuncType)(const Arg *); @@ -877,6 +878,16 @@ void parse_config_line(Config *config, const char *line) { config->drag_tile_to_tile = atoi(value); } else if (strcmp(key, "swipe_min_threshold") == 0) { config->swipe_min_threshold = atoi(value); + } else if (!xkb_rules.rules && strcmp(key, "xkb_rules_rules") == 0) { + xkb_rules.rules = strdup(value); + } else if (!xkb_rules.model && strcmp(key, "xkb_rules_model") == 0) { + xkb_rules.model = strdup(value); + } else if (!xkb_rules.layout && strcmp(key, "xkb_rules_layout") == 0) { + xkb_rules.layout = strdup(value); + } else if (!xkb_rules.variant && strcmp(key, "xkb_rules_variant") == 0) { + xkb_rules.variant = strdup(value); + } else if (!xkb_rules.options && strcmp(key, "xkb_rules_options") == 0) { + xkb_rules.options = strdup(value); } else if (strcmp(key, "scroller_proportion_preset") == 0) { // 1. 统计 value 中有多少个逗号,确定需要解析的浮点数个数 int count = 0; // 初始化为 0 diff --git a/src/config/preset_config.h b/src/config/preset_config.h index 71b8bbf..10c8993 100644 --- a/src/config/preset_config.h +++ b/src/config/preset_config.h @@ -107,7 +107,8 @@ struct xkb_rule_names xkb_rules = { /* example: .options = "ctrl:nocaps", */ - .options = NULL, + .rules = NULL, .model = NULL, .layout = NULL, + .variant = NULL, .options = NULL, }; int repeat_rate = 25;