Modules talk over the bus. The power module's bundle puts each fresh reading of its own sampler in its state draw, keyed by the machine; the bar's block shows that state, which the bar's bundle watches under the read the mesh grants it. A new catalogue check refuses a module naming another module's path under /run or /var/lib.
27 lines
902 B
Cheetah
27 lines
902 B
Cheetah
{{- /* A block other modules contribute, in i3status-rust's grammar (novox/hq ADR 0255). The controller
|
|
renders one piece at a time: its fields (bar, place, order, shows, options), module and machine. */ -}}
|
|
{{- if eq .shows "battery" -}}
|
|
[[block]]
|
|
block = "battery"
|
|
{{with .options}}{{with .device}}device = {{quote .}}
|
|
{{end}}{{end -}}
|
|
format = "$icon $percentage{ $time|}"
|
|
charging_format = "$icon $percentage{ $time|}"
|
|
not_charging_format = "$icon $percentage"
|
|
full_format = "$icon $percentage"
|
|
empty_format = "$icon $percentage"
|
|
missing_format = ""
|
|
{{- else if eq .shows "command" -}}
|
|
[[block]]
|
|
block = "custom"
|
|
command = {{quote .options.command}}
|
|
interval = {{.options.interval}}
|
|
{{- else if eq .shows "state" -}}
|
|
[[block]]
|
|
block = "custom"
|
|
command = {{quote (printf "~/.local/bin/i3status-value %s %s" .options.state (or .options.key .machine))}}
|
|
interval = 5
|
|
hide_when_empty = true
|
|
{{- end}}
|
|
|