# Gxkb - X11 keyboard indicator and switcher

**URL:** <https://forum.maboxlinux.org/t/gxkb-x11-keyboard-indicator-and-switcher/1092>\
**Category:** Development & Suggestions\
**Created:** [September 14, 2022, 11:45am UTC](https://forum.maboxlinux.org/t/gxkb-x11-keyboard-indicator-and-switcher/1092 "2022-09-14T11:45:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![napcok](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/napcok/32/410_2.png) [@napcok](https://forum.maboxlinux.org/u/napcok)\
**Post date:** [September 14, 2022, 11:45am UTC](https://forum.maboxlinux.org/t/gxkb-x11-keyboard-indicator-and-switcher/1092/1 "2022-09-14T11:45:10Z")

</div>

_(gxkb is preinstalled in Mabox since Istredd release)_

**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](https://github.com/zen-tools/gxkb)

 ![Mabox_20220914-13-42-44](https://forum.maboxlinux.org/uploads/default/original/2X/a/a3eed6cb94695084435a2439efefe8329bd3f505.webp)

### Installation

```auto
yay gxkb

```

### Configuration

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

```auto
[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:

```auto
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:

```auto
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:

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

```

Now you can enable/disable autostarting from GUI.  
**Menu** → **Mabox Config** → **Autostart** → **Choose 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](https://github.com/gosquared/flags) (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:

```auto
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 🙂

---

<div class="post-metadata">

**Author:** ![Twilight0](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/twilight0/32/1686_2.png) [@Twilight0](https://forum.maboxlinux.org/u/Twilight0)\
**Post date:** [November 9, 2022, 10:28pm UTC](https://forum.maboxlinux.org/t/gxkb-x11-keyboard-indicator-and-switcher/1092/2 "2022-11-09T22:28:53Z")

</div>

Is it going to have a shortcut to edit the config file just like other text config files Mabox has?

---

<div class="post-metadata">

**Author:** ![napcok](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/napcok/32/410_2.png) [@napcok](https://forum.maboxlinux.org/u/napcok)\
**Post date:** [November 10, 2022, 11:44am UTC](https://forum.maboxlinux.org/t/gxkb-x11-keyboard-indicator-and-switcher/1092/3 "2022-11-10T11:44:08Z")

</div>

You can find config file with super + F1 and searching for `gxkb`. Same for any other config file from `~/.config/` directory.  
You can also add menu position for that somewhere if you like.  
For example to **Settings Menu** super + s

```auto
echo "Keyboard layout config,xdg-open ~/.config/gxkb/gxkb.cfg" >> ~/.config/mabox/settings.csv

```

I’m not sure if I should add it to this menu by default - as gxkb is not enabled by default in Mabox.  
Maybe mention this in [Mabox Linux Manual](https://manual.maboxlinux.org/en/) will be enough.
