Let the bar render blocks other modules contribute, and give it the battery and power draw from the power module (hq ADR 0255)
The bar left the battery out because it belongs to whoever knows the hardware, and had no way to take it back in. i3status-rust now renders bar-neutral blocks through its template; the power module contributes the battery where the machine reports one and the power draw where something measures it, sampling the root-only energy counter as root and publishing only a rate. The memory block shows what programs hold, the figure memory-pressure judges by, instead of counting the cache as used.
This commit is contained in:
@@ -234,6 +234,19 @@
|
||||
"unit": "mesh-power-before-shutdown.service",
|
||||
"state": "running",
|
||||
"boot": "enabled"
|
||||
},
|
||||
{
|
||||
"id": "draw",
|
||||
"type": "process",
|
||||
"name": "mesh-power-draw",
|
||||
"artifact": "tools-go",
|
||||
"run": [
|
||||
"./power",
|
||||
"draw"
|
||||
],
|
||||
"health": {
|
||||
"kind": "unit"
|
||||
}
|
||||
}
|
||||
],
|
||||
"build": {
|
||||
@@ -255,5 +268,33 @@
|
||||
"from": "files"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"contributions": [
|
||||
{
|
||||
"seat": "node-bar",
|
||||
"kind": "block",
|
||||
"if-capability": "battery",
|
||||
"data": {
|
||||
"bar": "bottom",
|
||||
"place": "status",
|
||||
"order": 40,
|
||||
"shows": "battery"
|
||||
}
|
||||
},
|
||||
{
|
||||
"seat": "node-bar",
|
||||
"kind": "block",
|
||||
"if-capability": "power-meter",
|
||||
"data": {
|
||||
"bar": "bottom",
|
||||
"place": "status",
|
||||
"order": 45,
|
||||
"shows": "command",
|
||||
"options": {
|
||||
"command": "/usr/local/lib/mesh-power/bin/power-draw",
|
||||
"interval": 5
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user