From 0dd8a4ffeb524db49f206580b3a49b3fb6a978dd Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sat, 30 Sep 2017 11:53:28 +0200 Subject: [PATCH] [modules/layout-xkb] Ignore errors --- bumblebee/modules/layout-xkb.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bumblebee/modules/layout-xkb.py b/bumblebee/modules/layout-xkb.py index 3b62322..a31a51e 100644 --- a/bumblebee/modules/layout-xkb.py +++ b/bumblebee/modules/layout-xkb.py @@ -35,8 +35,11 @@ class Module(bumblebee.engine.Module): pass def current_layout(self, widget): - xkb = XKeyboard() - log.debug("group num: {}".format(xkb.group_num)) - return "{} ({})".format(xkb.group_symbol, xkb.group_variant) if xkb.group_variant else xkb.group_symbol + try: + xkb = XKeyboard() + log.debug("group num: {}".format(xkb.group_num)) + return "{} ({})".format(xkb.group_symbol, xkb.group_variant) if xkb.group_variant else xkb.group_symbol + except Exception: + return "n/a" # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4