[modules/nvidiagpu] Hide if not found
This commit is contained in:
parent
f1341772e5
commit
65faf73e8d
1 changed files with 6 additions and 0 deletions
|
@ -13,6 +13,7 @@ import core.module
|
|||
import core.widget
|
||||
|
||||
import util.cli
|
||||
import util.format
|
||||
|
||||
class Module(core.module.Module):
|
||||
def __init__(self, config, theme):
|
||||
|
@ -23,6 +24,11 @@ class Module(core.module.Module):
|
|||
def utilization(self, widget):
|
||||
return self.__utilization
|
||||
|
||||
def hidden(self):
|
||||
if "not found" in self._utilization.startswith("not found"):
|
||||
return True
|
||||
return False
|
||||
|
||||
def update(self):
|
||||
sp = util.cli.execute('nvidia-smi -q', ignore_errors=True)
|
||||
|
||||
|
|
Loading…
Reference in a new issue