Gxkb - X11 keyboard indicator and switcher

(this will be included with next Mabox release - Istredd)

gxkb is a tiny indicator applet which allows to quickly switch between different keyboard layouts in X. A flag corresponding to the country of the active layout is shown in the indicator area.

Github repo: GitHub - zen-tools/gxkb: X11 keyboard indicator and switcher

Mabox_20220914-13-42-44

Installation

yay gxkb

Configuration

Example config file ~/.config/gxkb/gxkb.cfg

[xkb config]
group_policy=2
default_group=0
never_modify_config=false
model=pc105
layouts=pl,ua,lt,us
variants=,,
toggle_option=grp:alt_shift_toggle
compose_key_position=

Most interesting options:

layouts=pl,ua,lt,us
toggle_option=grp:alt_shift_toggle

Available layouts (in this example): Polish, Ukrainian, Latvian, English (USA)
Toggle between layouts: alt + shift
Mouse wheel above system tray indicator also works.
Instead of grp:alt_shift_toggle you can use whatever the following command gives you:

grep grp:.*toggle /usr/share/X11/xkb/rules/base.lst

Configure those options to your needs.
You can use up to 4 layouts.

Autostart

Copy desktop file to needed location:

 cp /usr/share/applications/gxkb.desktop ~/.config/autostart/

Now you can enable/disable autostarting from GUI.
MenuMabox ConfigAutostartChoose apps/services (GUI)

Custom flags

By default many flags are missing, but you can put custom flags to ~/.local/share/gxkb/flags.
Good flags → GitHub - gosquared/flags: GoSquared's flag icon set (MIT licensed)
24px flags-iso works well.
gxkb expects flags named with lowercase letters, like: pl.png, ua.png, lt.png.
If you use flags from above repo, go to directory and rename them:

cd ~/.local/share/gxkb/flags
for i in $( ls | grep [A-Z] ); do mv -i $i `echo $i | tr 'A-Z' 'a-z'`; done

Enjoy :slight_smile:

3 Likes