google / xsecurelock

X11 screen lock utility with security in mind
Apache License 2.0
876 stars 65 forks source link

Less clutter in keyboard layout message #95

Open Vladimir-csp opened 4 years ago

Vladimir-csp commented 4 years ago

Layout indicator in auth box is sometimes a bit messy. For us layout it is ok, the message just says: Keyboard: English (US) But for ru layout it says: Keyboard: Russian, Scroll Lock, Group 2

The second field here is not helpful. Is this message a reaction to scroll lock LED state, or to grp_led:scroll option in xkb? Can the actual state of scroll lock be tracked, not just LED? Can scroll lock mess with password entry in principle? If not, then I doubt that scroll lock tracking is at all needed in the auth box.

The third field (Group 2) can either be dropped completely, or shown if there are more than 2 layouts.

divVerent commented 4 years ago

Yes, it is correct that we're showing the LED status. It currently shows all LEDs, as the Xkb API does not actually reveal information about what each LED means.

There is an alternate API that reveals Caps Lock but not Num Lock, by looking at the modifiers returned by XkbGetState. This, of course, has its own issues, as Num Lock can affect password typing a lot, especially on laptops, but is only returned as a rather opaque Mod2, which on non-Linux system might mean something different.

divVerent commented 4 years ago

Can you try with this commit and XSECURELOCK_SHOW_LOCKS_AND_LATCHES=1 set? I don't quite like it yet as I have not found a good source for the names yet, but this otherwise is probably closer to the minimum info that should be shown.

Vladimir-csp commented 4 years ago

Num lock is shown as Mod2, caps lock is shown as just Lock. But when those are not engaged, layouts themselves are shown cleanly.

Barbaross93 commented 3 years ago

Perhaps I should make another issue for this, but I think that having an option to completely hide what the current keyboard layout is along with activated locks would be great for those of us who prefer minimal setups

andys8 commented 2 years ago

having an option to completely hide what the current keyboard layout is along with activated locks would be great for those of us who prefer minimal setups

Would be really cool :) Mine shows "Keyboard: German (no dead keys)" and I would prefer getting rid of this information.