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...