From 4485b65722645d6c9617b5ff4aea6d62ee8a9adf Mon Sep 17 00:00:00 2001 From: Sayan Sil Date: Wed, 30 Jun 2021 11:31:42 +0530 Subject: [PATCH] Use the existing util.cli module --- bumblebee_status/modules/contrib/optman.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/bumblebee_status/modules/contrib/optman.py b/bumblebee_status/modules/contrib/optman.py index c928f24..337003c 100644 --- a/bumblebee_status/modules/contrib/optman.py +++ b/bumblebee_status/modules/contrib/optman.py @@ -5,11 +5,10 @@ Requires the following packages: """ -import subprocess - import core.module import core.widget +import util.cli class Module(core.module.Module): def __init__(self, config, theme): @@ -20,13 +19,8 @@ class Module(core.module.Module): return "GPU: {}".format(self.__gpumode) def update(self): - cmd = ["optimus-manager", "--print-mode"] - output = ( - subprocess.Popen(cmd, stdout=subprocess.PIPE) - .communicate()[0] - .decode("utf-8") - .lower() - ) + cmd = "optimus-manager --print-mode" + output = util.cli.execute(cmd).strip() if "intel" in output: self.__gpumode = "Intel"