From fe5bbd4b468e12b60c289c1bf9072f9675b19301 Mon Sep 17 00:00:00 2001 From: Tobi-wan Kenobi Date: Fri, 3 Mar 2017 19:18:25 +0100 Subject: [PATCH] [modules/kernel] Use Python standard module "platform" Instead of executing an external call to "uname", use the standard Python module "platform" to retrieve information about the kernel used. Positive side-effect: This is portable, if i3 ever exists on Windows :P --- bumblebee/modules/kernel.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/kernel.py b/bumblebee/modules/kernel.py index 3f7b888..761fa8c 100644 --- a/bumblebee/modules/kernel.py +++ b/bumblebee/modules/kernel.py @@ -2,6 +2,8 @@ """Shows Linux kernel version information""" +import platform + import bumblebee.input import bumblebee.output import bumblebee.engine @@ -11,7 +13,7 @@ class Module(bumblebee.engine.Module): super(Module, self).__init__(engine, config, bumblebee.output.Widget(full_text=self.output) ) - self._release_name = bumblebee.util.execute("uname -r")[:-1] + self._release_name = platform.release() def output(self, widget): return self._release_name