I have a fresh i3 version 4.11 (2015-09-30, branch "4.11") installed over my Ubuntu 16.04.
Actually I need to use 3 different keyboard layouts for example en
, fr
and ru
with the possibility to switch between them by using some keyboard shortcut.
I have tried some methods but neither was completely satisfactory:
- Using
ibus-daemon
almost works but I cannot use any shortcuts for change layouts. -
My actual setup is configuring
setxkbmap
when I starti3
:exec --no-startup-id "setxkbmap -model pc105 -layout fr,us,ru -option grp:alt_shift_toggle"
So I can switch between my layouts but sometimes I have no idea which layout I am actually in use because there is not any tray icon for that in this setup.
For conclusion my needs are:
-
Be able to switch layouts by pressing some hotkeys.
-
Some indications(preferably, tray icon) for layout I am actually in use.
Is there some work around about this? Or maybe there is some i3 plugin tha t actually does the job? Some third software?
Best Answer
You can do it with
xkblayout-state
andi3blocks
For
xkblayout-state
:I assume you have
git
.Now copy compiled
xkblayout-state
somewhere in yourPATH
, for example:Now for
i3blocks
:In your
i3
config file (~/.config/i3/config) replacei3status
withi3blocks
,And restart
i3wm
(mod+shift+R), you should now see thati3blocks
appeared.Open your
~/.i3blocks.conf
and add somewhere (for example, right above [VOLUME] section):Again, restart i3wm (mod+shift+R), and you should see your locales in status bar, switching.
Check out
xkblayout-state --help
, there is many options for different output.