Use the existing util.cli module
This commit is contained in:
parent
3ff2e49e5f
commit
4485b65722
1 changed files with 3 additions and 9 deletions
|
@ -5,11 +5,10 @@ Requires the following packages:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
import core.module
|
import core.module
|
||||||
import core.widget
|
import core.widget
|
||||||
|
|
||||||
|
import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config, theme):
|
def __init__(self, config, theme):
|
||||||
|
@ -20,13 +19,8 @@ class Module(core.module.Module):
|
||||||
return "GPU: {}".format(self.__gpumode)
|
return "GPU: {}".format(self.__gpumode)
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
cmd = ["optimus-manager", "--print-mode"]
|
cmd = "optimus-manager --print-mode"
|
||||||
output = (
|
output = util.cli.execute(cmd).strip()
|
||||||
subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
|
||||||
.communicate()[0]
|
|
||||||
.decode("utf-8")
|
|
||||||
.lower()
|
|
||||||
)
|
|
||||||
|
|
||||||
if "intel" in output:
|
if "intel" in output:
|
||||||
self.__gpumode = "Intel"
|
self.__gpumode = "Intel"
|
||||||
|
|
Loading…
Reference in a new issue