sbar / docsSource ↗
System provider

CPU

Aggregate CPU usage, for example CPU 12%.

Output

Aggregate busy CPU usage across all cores, from 0% to 100%, rounded to the nearest whole percent. The default item displays a cpu icon and CPU N%. Omitting the cpu block behaves the same as cpu: {}.

Example

{
  "id": "cpu",
  "type": "cpu",
  "cpu": {
    "smoothingSamples": 3,
    "warningThreshold": 60,
    "highThreshold": 85,
    "tints": {
      "medium": "#EBCB8B",
      "high": "#BF616A",
      "unavailable": "#888888"
    }
  },
  "text": "{{#available}}{{percentage}}%{{/available}}{{^available}}—{{/available}}"
}

This shows an icon and N%, averaging up to three recent samples. Set top-level text: "" for an icon-only item, or showSymbol: false for text-only output.

Configuration

Use the item-level text template to customise or hide the label. The provider options below control its data, symbols, colours, and visibility.

All fields below are inside cpu.

PropertyDefaultDescription
showSymboltrueShow the state icon, including an item-level override.
smoothingSamples1Integer 1 to 30; average this many recent available samples before rounding.
warningThreshold60Integer 0 to 100; medium usage starts at this displayed percentage. Must be below highThreshold.
highThreshold85Integer 0 to 100; high usage starts at this displayed percentage.
symbols.font-Shared installed font name for glyph symbols; each glyph can override it.
symbols.sizeResolved item/theme font sizeShared glyph size, 8 to 72 points; each glyph can override it.
symbols.lowcpuBelow the warning threshold.
symbols.mediumcpuAt or above warning, below high.
symbols.highcpuAt or above the high threshold.
symbols.unavailablequestionmarkNo usable CPU sample.
tints.lowNormal tintLow-usage colour.
tints.mediumNormal tintMedium-usage colour.
tints.highNormal tintHigh-usage colour.
tints.unavailableNormal tintUnavailable-sample colour.

Thresholds use the rounded, smoothed percentage shown by the item. With defaults, 0 to 59% is low, 60 to 84% is medium, and 85 to 100% is high.

Symbols accept SF Symbol names or font glyph objects. Use symbolFontWeight to set SF Symbol weight independently of text.

An item-level symbol overrides state symbols; showSymbol: false hides it regardless. State tints override the normal item/theme tint and accept #RRGGBB or #RRGGBBAA. Icon-only items retain an accessibility label, including when usage is unavailable.

To change cpu, edit the configuration file. sbar set cannot change this block.

Shared item options cover styling, symbols, actions, priority, and enabled state.

Text templates

The item-level text setting supports id, value, symbol, percentage, available. See text templates for syntax and field meanings. percentage uses the item’s smoothing setting and contains no percent sign.

Updates

The provider samples CPU usage every two seconds for all displays. Each item chooses its own smoothing window. A value of 1 disables smoothing; larger values average the most recent available samples, using fewer during warm-up. Text, thresholds, and accessibility use the same smoothed percentage. Raw provider events retain the latest unsmoothed reading.

Refresh policies capture the sample history, so manual and interval items retain their whole presentation until refreshed. Smoothing does not change the underlying sampling cadence. See refresh policies.

Unavailable samples

Startup, failed reads, unchanged CPU counters, and sampling gaps longer than ten seconds show CPU — by default and clear smoothing history. Failed reads and sampling restarts also reset the counter baseline; a fresh interval is needed before usage can be shown again. Unchanged counters mean there is no usable delta, not a measured 0% load.

Current limits

No per-core view or configurable decimal precision. Thresholds affect appearance only; they do not trigger actions.

sbar documentation Built with Hugo · Reference reviewed 12 Sep 2026