Remove .config/waybar/scripts/gpu-usage/._dists.cpython-314.pyc6454044716004815114
Remove .config/waybar/scripts/gpu-usage/gpu-usage.py
This commit is contained in:
parent
c1f069d981
commit
d638987e48
2 changed files with 0 additions and 16 deletions
Binary file not shown.
|
|
@ -1,16 +0,0 @@
|
||||||
from subprocess import check_output
|
|
||||||
import json
|
|
||||||
|
|
||||||
gpu_usage = check_output(["nvidia-smi", "--query-gpu=utilization.gpu", "--format=csv,noheader,nounits"])
|
|
||||||
|
|
||||||
gpu_usage = gpu_usage.decode('utf-8').replace("\n",'')
|
|
||||||
|
|
||||||
return_json = {
|
|
||||||
"text":gpu_usage,
|
|
||||||
"alt":"GPU_PERCENT",
|
|
||||||
"tooltip":"GPU percentage",
|
|
||||||
"class":"gpu_class",
|
|
||||||
"percentage":int(gpu_usage)
|
|
||||||
}
|
|
||||||
|
|
||||||
print(json.dumps(return_json))
|
|
||||||
Loading…
Reference in a new issue