4

I use scroll LED as keyboard layout indicator (off - English, on - Russian). It works great on the PS/2 keyboard at home. And it works in general on my work computer (USB keyboard). But sometimes I have this LED being out of sync. I assume it is related to sporadic USB device disconnection/connection (there are appropriate messages in dmesg). After that I can change layout, but LED state continue to be inversed.

The question is: how to sync led with current keyboard layout?

P.S. used xkb options: grp:ctrl_shift_toggle,grp_led:scroll

edo1
  • 241
  • You can set LED states with xset -led, but I've no idea if this syncs with the internal keyboard state. Worth a try, though. – dirkt Feb 10 '17 at 10:37
  • I tried xset, it doesn't solve the issue. – edo1 Feb 10 '17 at 19:53
  • I can fix it such way:set LED to ON state;disconnect keyboard and connect it again. After that LED is OFF and stay synced for a several hours. – edo1 Feb 10 '17 at 19:54

1 Answers1

0

I was able to work around the issue with these commands (idea from an Ubuntu bug discussion):

xmodmap -e 'remove lock = Caps_Lock'
setxkbmap -option

The keyboard was then reset to default settings: US layout and Caps Lock with the default functionality (and LED which is not inverted). After that, I reapplied my keyboard layout settings. In most popular window managers, that would be done from GUI, but I invoked setxkbmap manually:

setxkbmap -layout us,ru -option grp:caps_toggle,grp_led:caps

Not sure if the initial LED state affects whether the commands work, probably you have to try it several times.

kalan
  • 1