From ef7ee2fd0f64a1a0a0088b90d3cbaeb6b3436c32 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 13 Jul 2022 16:02:14 +0200 Subject: [PATCH] added active keymap prop --- src/debug/HyprCtl.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 67a20910..cdc04ff4 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -295,6 +295,7 @@ R"#( { result += "\"keyboards\": [\n"; for (auto& k : g_pInputManager->m_lKeyboards) { + const auto KM = xkb_keymap_layout_get_name(wlr_keyboard_from_input_device(k.keyboard)->keymap, 0); result += getFormat( R"#( { "address": "0x%x", @@ -303,7 +304,8 @@ R"#( { "model": "%s", "layout": "%s", "variant": "%s", - "options": "%s" + "options": "%s", + "active_keymap": "%s" },)#", &k, k.keyboard->name, @@ -311,7 +313,8 @@ R"#( { k.currentRules.model.c_str(), k.currentRules.layout.c_str(), k.currentRules.variant.c_str(), - k.currentRules.options.c_str() + k.currentRules.options.c_str(), + KM ); } @@ -377,7 +380,8 @@ R"#( { result += "\n\nKeyboards:\n"; for (auto& k : g_pInputManager->m_lKeyboards) { - result += getFormat("\tKeyboard at %x:\n\t\t%s\n\t\t\trules: r \"%s\", m \"%s\", l \"%s\", v \"%s\", o \"%s\"\n", &k, k.keyboard->name, k.currentRules.rules.c_str(), k.currentRules.model.c_str(), k.currentRules.layout.c_str(), k.currentRules.variant.c_str(), k.currentRules.options.c_str()); + const auto KM = xkb_keymap_layout_get_name(wlr_keyboard_from_input_device(k.keyboard)->keymap, 0); + result += getFormat("\tKeyboard at %x:\n\t\t%s\n\t\t\trules: r \"%s\", m \"%s\", l \"%s\", v \"%s\", o \"%s\"\n\t\t\tactive keymap: %s\n", &k, k.keyboard->name, k.currentRules.rules.c_str(), k.currentRules.model.c_str(), k.currentRules.layout.c_str(), k.currentRules.variant.c_str(), k.currentRules.options.c_str(), KM); } result += "\n\nTablets:\n";