Hello,

For changing the keyboard map I use the following code for a long time:

-- Change_keyboard_maps
kbdcfg = {}
kbdcfg.cmd = "setxkbmap"
kbdcfg.layout = { "fr bepo", "fr", "us" }
-- kbdcfg.model = { "tm2030USB", "pc105", "pc105" }
kbdcfg.current = 1 -- us is our default layout
kbdcfg.widget = wibox.widget.textbox()
kbdcfg.switch = function ()
kbdcfg.current = kbdcfg.current % #(kbdcfg.layout) + 1
local t = " " .. kbdcfg.layout[kbdcfg.current] .. " "
kbdcfg.widget:set_text(t)
os.execute( kbdcfg.cmd .. t )
end

-- Mouse bindings
kbdcfg.widget:buttons(awful.util.table.join(awful.button({ }, 1, function () kbdcfg.switch() end)
))

which is the previous one before the this one in https://awesome.naquadah.org/wiki/Change_keyboard_maps .

I also use superkb (http://superkb.sourceforge.net/) to launch applications through a click on a virtual keyboard key displayed on the screen. For example, depressing F6-C launches Calculator.

To stop and restart superkb in rc.lua, I already have the command

awful.util.spawn_with_shell("pkill superkb ; setxkbmap -model tm2030USB fr bepo ; superkb")

to use a TypeMatrix keyboard with a fr bepo layout, and that works.

When I change the layout to fr by clicking on the taskbar widget, the keyboard layout is well changed into fr, but the virtual keyboard does not change.

So I have to insert in the « Change_keyboard_maps » code the commands

awful.util.spawn_with_shell("pkill superkb ; setxkbmap -model tm2030USB fr bepo ; superkb")
and the command
awful.util.spawn_with_shell("pkill superkb ; setxkbmap -model tm2030USB fr ; superkb")

Could you explain me how to do that ?

Jean-Luc Duflot
using awesome v3.5.6








--
To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.

Reply via email to