[modules/layout] Add rotation logic and language parameter

User can now specify a list of languages as parameter (pipe-separated
list). Variants can also be specified by separating language and variant
with a :

For instance: -p layout.lang="us|rs:latin"

Left click moves on to the next language, right click to the previous.

Right now, there are the following caveats:
* The first entry in the list must be the language used when the bar
  starts
* kxbd changes outside the bar are not picked up automatically
This commit is contained in:
Tobi-wan Kenobi 2016-11-27 18:08:22 +01:00
parent 1f1e7748a3
commit 60d96506e8
2 changed files with 25 additions and 21 deletions

View file

@ -93,10 +93,10 @@ class Output(object):
), None)
cb = self._callbacks.get((
event.get("button", -1),
event.get("instance", event.get("name", None)),
event.get("instance", event.get("module", None)),
), cb)
identity = event.get("instance", event.get("name", None))
identity = event.get("instance", event.get("module", None))
return Command(cb, event, self._widgets.get(identity, None))
def wait(self):