Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod_xkb/xkbion: Per-window num/caps/scroll-lock? #352

Open
mjf opened this issue Feb 13, 2023 · 0 comments
Open

mod_xkb/xkbion: Per-window num/caps/scroll-lock? #352

mjf opened this issue Feb 13, 2023 · 0 comments

Comments

@mjf
Copy link

mjf commented Feb 13, 2023

Hello,
I tried to configure xkbion for num/caps/scroll-lock so that it works similarly to
keyboard layout switching and the lock was on/off per program window in X.org:

xkbion_set {
    {
        name = "     ",
        hint = "xkb_num_off",
        action = function() mod_xkb.lock_modifiers(1, 0) end,
    },
    {
        name = " NUM ",
        hint = "xkb_num_on",
        action = function() mod_xkb.lock_modifiers(1, 2) end,
    },
    key = "Num_Lock",
    statusname = "xkb_num",
    atomname = "XKBION_NUM",
}

xkbion_set {
    {
        name = "      ",
        hint = "xkb_caps_off",
        action = function() mod_xkb.lock_modifiers(2, 0) end,
    },
    {
        name = " CAPS ",
        hint = "xkb_caps_on",
        action = function() mod_xkb.lock_modifiers(2, 2) end,
    },
    key = "Caps_Lock",
    statusname = "xkb_caps",
    atomname = "XKBION_CAPS",
}

xkbion_set {
    {
        name = "     ",
        hint = "xkb_scroll_off",
        action = function() mod_xkb.lock_modifiers(3, 0) end,
    },
    {
        name = " SCR ",
        hint = "xkb_scroll_on",
        action = function() mod_xkb.lock_modifiers(3, 2) end,
    },
    key = "Scroll_Lock",
    statusname = "xkb_scroll",
    atomname = "XKBION_SCROLL",
}

It does not behave as expected. The locks are on/off globally and the indicator are actually per window
so they does not reflect the real state. How to fix this, please? It looks like the mod_xkb.lock_group() works somehow
differently to mod_xkb.lock_modifiers() or I perhaps do something completely wrong.


OT: This is how I configured my keyboard layout switching which works per window:

xkbion_set {
    {
        name = "     ",
        hint = "xkb_group_0",
        action = function() mod_xkbevents.lock_group(0) end,
    },
    {
        name = " CZE ",
        hint = "xkb_group_1",
        action = function() mod_xkbevents.lock_group(1) end,
    },
    key = "Shift+ISO_Next_Group",
    statusname = "xkb_group",
    atomname = "XKBION_GROUP",
}

To clarify more further, I like to switch keyboard layouts using L_Shift+R_Shift (which is ISO_Next_Group in xev(1) output) and this was the only way I could achieve it to somewhat work with xkbion. But it's wrong, I think. If somebody has some idea how to get it really working (still there are some issues, see below), it would be splendid and very appreciated too! Thanks.

To keep keyboard layouts and lock states per window is excellent feature and it is one of the greatest features I can imagine for window manager. By the way, it would be even greater if I could, for example, tag some set of windows and switch keyboard layouts and lock states for them or if I could do it per frame etc. I think such functionality should be part of the Notion's core to handle it really properly (there are some issues with empty scratchpad for example etc). Also language and lock state indicators would be nice to have on tabs, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant