module/xkb: log all available layouts at startup

This commit is contained in:
Daniel Eklöf 2019-01-19 18:54:31 +01:00
parent dff3104c85
commit fbb6cd47c4

View file

@ -590,12 +590,24 @@ talk_to_xkb(struct module *mod, xcb_connection_t *conn)
LOG_DBG("%s: %s", name, enabled ? "enabled" : "disabled"); LOG_DBG("%s: %s", name, enabled ? "enabled" : "disabled");
} }
LOG_INFO("layout: %s (%s), caps-lock:%s, num-lock:%s, scroll-lock:%s", {
layouts.layouts[m->current].name, char buf[512];
layouts.layouts[m->current].symbol, size_t idx = 0;
caps_lock ? "on" : "off",
num_lock ? "on" : "off", for (size_t i = 0; i < layouts.count; i++) {
scroll_lock ? "on" : "off"); idx += snprintf(&buf[idx], sizeof(buf) - idx, "%s%s (%s)%s",
i == m->current ? "*" : "",
layouts.layouts[i].name,
layouts.layouts[i].symbol,
i + 1 < layouts.count ? ", " : "");
}
LOG_INFO("layouts: %s, caps-lock:%s, num-lock:%s, scroll-lock:%s",
buf,
caps_lock ? "on" : "off",
num_lock ? "on" : "off",
scroll_lock ? "on" : "off");
}
mtx_lock(&mod->lock); mtx_lock(&mod->lock);
m->layouts = layouts; m->layouts = layouts;