[modules/layout] Add autodetection and auto-adding of languages

Whenever the language is changed outside the bar, update the bar
accordingly. Also, when a new language is used, automatically append it
to the list of available languages.
This commit is contained in:
Tobi-wan Kenobi 2016-11-27 19:48:12 +01:00
parent ca64851687
commit 4819147410
2 changed files with 25 additions and 1 deletions

View file

@ -24,7 +24,9 @@ def durationfmt(duration):
def execute(cmd):
args = shlex.split(cmd)
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out = p.communicate()
out, err = p.communicate()
if p.returncode != 0:
raise RuntimeError("{} exited with {}".format(cmd, p.returncode))
return out.decode("utf-8")