From bc514265d4727fe25c5873d86fd005edb21f4f94 Mon Sep 17 00:00:00 2001 From: Pierre Date: Fri, 3 Mar 2017 16:01:59 +0100 Subject: [PATCH] new module that displays current kernel it uses the output of 'uname -r' prefixed with the linux font-awesome icon --- bumblebee/modules/kernel.py | 13 +++++++++++++ themes/icons/awesome-fonts.json | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 bumblebee/modules/kernel.py diff --git a/bumblebee/modules/kernel.py b/bumblebee/modules/kernel.py new file mode 100644 index 0000000..4d5ef88 --- /dev/null +++ b/bumblebee/modules/kernel.py @@ -0,0 +1,13 @@ +import bumblebee.input +import bumblebee.output +import bumblebee.engine + +class Module(bumblebee.engine.Module): + def __init__(self, engine, config): + super(Module, self).__init__(engine, config, + bumblebee.output.Widget(full_text=self.output) + ) + self._release_name = bumblebee.util.execute("uname -r")[:-1] + + def output(self, widget): + return self._release_name diff --git a/themes/icons/awesome-fonts.json b/themes/icons/awesome-fonts.json index 7322cf9..8d6610c 100644 --- a/themes/icons/awesome-fonts.json +++ b/themes/icons/awesome-fonts.json @@ -38,6 +38,9 @@ "muted": { "prefix": "" }, "unmuted": { "prefix": "" } }, + "kernel": { + "prefix": "\uf17c" + }, "nic": { "wireless-up": { "prefix": "" }, "wireless-down": { "prefix": "" },