From 855012f05dfa0ef4f1d7aa466ee1850f69af5613 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sat, 30 Sep 2017 16:26:20 +0200 Subject: [PATCH] [modules/layout-xkb] Parameter to show full layout name If parameter "showname" is specified, do not show the symbol (e.g. "us"), but the full layout name (e.g. "English (US)"). see #177 --- bumblebee/modules/layout-xkb.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/layout-xkb.py b/bumblebee/modules/layout-xkb.py index 86186a9..aa5ed03 100644 --- a/bumblebee/modules/layout-xkb.py +++ b/bumblebee/modules/layout-xkb.py @@ -4,6 +4,9 @@ Requires the following library: * libX11.so.6 + +Parameters: + * layout-xkb.showname: Boolean that indicate whether the full name should be displayed. Defaults to false (only the symbol will be displayed) """ import bumblebee.input @@ -47,7 +50,8 @@ class Module(bumblebee.engine.Module): 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 + name = xkb.group_name if bumblebee.util.asbool(self.parameter("showname")) else xkb.group_symbol + return "{} ({})".format(name, xkb.group_variant) if xkb.group_variant else name except Exception: return "n/a"