The story with keyboard switching shortcuts

And so one day, I set to build a lightweight desktop environment around lxde. After some customizations, the thing that bugged me was that I could not set the keyboard layout change shortcut to the Win + Space shortcut that I have grown to like. What's not to like about it. I found it brilliant when I discovered it in OS X and was delighted to discover that it became the default in Windows 10. So I have standardized to that and not being able to configure it in lxde is a huge bummer for me.

It turns out that by default the lxpanel xkbd switching applet does not allow you to choose Win+Space as a layout switching shortcut. But fear not. You can just add it by adding the line:

grp:win_space_toggle=Win+Space

Just edit the toggle.cfg file

sudo vim  /usr/share/lxpanel/xkeyboardconfig/toggle.cfg

And you are done.

You can see all the possible options supported by your X server in

man xkeyboard-config

If you are more of a barebones type, you can more or less achieve the same effect temporarily by using setxkbmap.

setxkbmap us,gr -option 'grp:win_space_toggle'

but this does not persist after the current X session ends.

setxkbmap -print

Prints the current settings.
The freebsd handbook provides some good examples to set a system-wide default.

I guess a configuration for my case, that I have not tested yet, would be putting something like the following:

Section "InputDevice"
    Identifier "Keyboard1"
    Driver "kbd"

    Option "XkbModel" "pc105"
    Option "XkbLayout" "us,gr"
    Option "XKbOptions" "grp:win_space_toggle"
EndSection

Under /usr/local/etc/X11/xorg.conf.d/kbd-layout-multi.conf

See also the more extensive XKB config docs

Show Comments