27 lines
975 B
JSON
27 lines
975 B
JSON
{
|
|
"group/load": {
|
|
"orientation": "horizontal",
|
|
"modules": ["cpu", "memory", "custom/gpu-util", "custom/gpu-vram"],
|
|
},
|
|
"cpu": {
|
|
"interval": 2,
|
|
"format": " {usage}%",
|
|
"tooltip": true,
|
|
},
|
|
"memory": {
|
|
"interval": 2,
|
|
"format": " {percentage}%",
|
|
"tooltip": true,
|
|
},
|
|
"custom/gpu-util": {
|
|
"exec": "command -v nvidia-smi &>/dev/null && nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits | awk '{printf \"{\\\"text\\\": \\\" %2s%%\\\", \\\"tooltip\\\": \\\"GPU Usage: %s%%\\\"}\\n\", $1, $1}' || echo ''",
|
|
"return-type": "json",
|
|
"interval": 4
|
|
},
|
|
"custom/gpu-vram": {
|
|
"exec": "command -v nvidia-smi &>/dev/null && nvidia-smi --query-gpu=memory.used,memory.total --format=csv,noheader,nounits | awk -F', ' '{printf \"{\\\"text\\\": \\\" %2d%%\\\", \\\"tooltip\\\": \\\"VRAM: %sMB / %sMB\\\"}\\n\", int(($1/$2)*100), $1, $2}' || echo ''",
|
|
"return-type": "json",
|
|
"interval": 2
|
|
}
|
|
}
|