Talk:Change keyboard maps

I just tried using this in awesome 3.3pre on arch (3.2.1 with some fixes from the development branch), as well as on the latest git pull, but could only get it to display the name of the layout defined through 'kbdcfg.current'. Clicking didn't work at all. The idea is great though, and it would be great to have this functionality.

-- Here, do it like this and it will work. Although I would personally do the whole widget differently. -- Both widgets on the page are now updated and in working order -- - 22.08.2009

One last thing, since you want a keyboard widget consider writing one that will show the caps/scroll/numlock states (and possibly change them). That would be a nice contribution too, as it was often requested (hint: xset).

-- anrxc --

Okay, i tried 'em and this code is still not working. I have the same problem: the widget appears, but bindings do nothing, both Alt-Shift_r and Ctrl-Shift (i would prefer Ctrl-Shift). I have awesome 3.3.4 (Mercury) on Ubuntu 9.10 Oreolek 03:30, 31 October 2009 (UTC)

---

The setxkbmap method works, but it's not executed at startup. So, if I want my default keyboard layout to be something else than the standard US, I need to click on the item once after every restart. I fixed this by adding setxkbmap de to my ~.xinitrc.

Also, if you have two different layout variants of the same language, e.g. {"de", ""} and {"de" , "neo"} the symbol in the widget will stay the same when switching between them. So I added a third value to the kbdcfg.layout - line where I can define a custom name for the layout. It now looks like this: kbdcfg.layout = { { "de", "neo", "Neo" }, { "de", "" , "De" } , { "us","" , "US"} } ... ... kbdcfg.widget:set_text(" " .. kbdcfg.layout[kbdcfg.current][3] .. " ") ...  ...   ...  kbdcfg.widget:set_text(" " .. t[3] .. " ") ...

-- Dervonnebenaan 11:26, 11 November 2014 (ECT) -- update: merged this into the wiki page. 14.Nov 18:48 (ECT)