1

I would like to know if there is any way of using the standard ubuntu keyboard layouts from outside Unity. I am using a different WM (Fluxbox).

The brute force approach would be to use xkb. I can do. But, before I go down that route, I'd like to explore other options. I have tried running the ibus-daemon directly which seems to work, but the keyboard layouts it offers are different from the standard ubuntu ones (and there are much less of them).

I noticed that i can't just run

/usr/lib/x86_64-linux-gnu/indicator-keyboard/indicator-keyboard-service &

Any ideas?

The Ubuntu version is 15.10.

  • Why should using a different WM change the keyboard layout? Keyboard shortcuts maybe, but keyboard layout? – DK Bose Mar 23 '16 at 17:07
  • I do not have the access from Fluxbox to a indicator-keyboard systray applet (it appears there is no equivalent of 'nm-applet' in this case). The alternative is to run an ibus-daemon instance which installs it's own (uglier) systray applet with only a limited choice of keyboard layouts. – Mali Remorker Mar 24 '16 at 10:06
0

So, I've decided to stop the impossible and pull out pieces of Unity into Fluxbox. Instead, there is a much more fluxboxy solution, indeed relying on setxkbmap. With reference to this unix stack exchange answer I have made a similar submenu setup for Serbian (Latin) and German on an US keyboard.

In .fluxbox/menu,

[begin] (fluxbox)
[include] (/etc/X11/fluxbox/fluxbox-menu)
[submenu] (keyboards)
[exec] (us) {setxkbmap us}
[exec] (de) {setxkbmap de qwerty}
[exec] (rs) {setxkbmap rs latinunicodeyz}
[end]

the preceding snippet sets up three items corresponding to different keyboard layouts.

To make things more flexible, i have also added keyboard shortcuts in .fluxbox/keys,

Mod4 Shift 1 :Exec chkb.sh us
Mod4 Shift 2 :Exec chkb.sh rs latinunicodeyz
Mod4 Shift 3 :Exec chkb.sh de qwerty

where chkb.sh is a script with the following content

#!/bin/bash    
langsel="$1"
varant="$2"
setxkbmap "$1" "$2"
xmodmap "/home/user/.Xmodmap"

. Since I am an Emacs user, I prefer to bind Caps Lock to Ctrl functionality (and Ctrl to Caps Lock) , and each time I change the keyboard layout, I need to repeat the binding process by rereading the .Xmodmap definition. This is nicer if packed into a script, than called directly by the :Exec directive.

Maybe someone still has a different solution...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.