sbar / docsSource ↗
System provider

Disk

Capacity of a selected volume, with configurable formats and free-space colours.

Output

Capacity of a selected volume, defaulting to the home volume. The default item displays an internaldrive icon and text such as 120 GB free. Omitting the disk block behaves the same as disk: {}.

Example

{
  "id": "external",
  "type": "disk",
  "disk": {
    "path": "/Volumes/External",
    "warningThreshold": 20,
    "criticalThreshold": 10,
    "tints": {
      "warning": "#EBCB8B",
      "critical": "#BF616A",
      "unavailable": "#888888"
    }
  },
  "text": "{{#available}}{{used}} / {{total}}{{/available}}{{^available}}—{{/available}}"
}

Replace the path with an existing file or directory on the volume you want to monitor. This shows an icon and used/total capacity. 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 disk.

PropertyDefaultDescription
showSymboltrueShow the state icon, including an item-level override.
pathHome directoryAbsolute path or path with ~ expansion; capacity describes its containing filesystem.
warningThreshold20Integer 0 to 100; warning applies at or below this percentage free.
criticalThreshold10Integer 0 to 100; critical applies at or below this percentage free. Must be below warningThreshold.
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.availableinternaldriveValid capacity reading.
symbols.unavailablequestionmarkNo usable capacity reading.
tints.normalNormal tintFree percentage above the warning threshold.
tints.warningNormal tintFree percentage at or below warning, above critical.
tints.criticalNormal tintFree percentage at or below critical.
tints.unavailableNormal tintUnavailable-reading colour.

Display formats

Text templateExample with labelMeaning
{{free}} free120 GB freeFree capacity.
{{used}} used380 GB usedTotal minus free capacity.
{{total}} total500 GB totalTotal filesystem capacity.
{{used}} / {{total}} used380 GB / 500 GB usedUsed and total capacity.
{{percentage}}% used76% usedUsed percentage, rounded to the nearest whole percent.

Bytes use macOS file-size formatting. Choose fields in top-level text. The item-level format remains for date and time items.

State appearance

Thresholds compare the unrounded free percentage, while {{percentage}}% displays the rounded used percentage. Critical takes precedence over warning. State tints override the normal item/theme tint and accept #RRGGBB or #RRGGBBAA; omitted colours use the normal tint.

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

An item-level symbol overrides both state icons; showSymbol: false hides it regardless. Icon-only items retain the path, free/total capacity, and used percentage in their accessibility label, or identify the path as unavailable.

To change disk, 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, used, free, total, percentage, freeBytes, totalBytes, available. See text templates for syntax and field meanings. Fields follow the selected path. percentage measures used space, regardless of the default display format.

Updates

The provider samples disk capacity every two seconds. Paths on the same volume share one capacity read per sampling pass, across items and displays. Refresh policies capture each item’s full capacity state; manual and interval items hold their snapshot until refreshed. Changing an item’s path immediately clears its old snapshot. See refresh policies.

Disk value events use each item ID, with free-space text regardless of display mode. Unavailable values use Disk —.

Missing or unmounted volumes

Missing paths, failed reads, and invalid capacities display — unavailable with a questionmark icon by default. A valid sample restores the reading.

The provider checks the mount before and after reading. Once a path has produced a valid reading, a different mount point is treated as unavailable so an unmounted drive does not silently become a reading for its parent disk. Leftover directories under /Volumes are rejected unless they are on that mounted volume.

Current limits

The provider tracks the volume at a path, not a persistent physical-drive identity. Free and total capacity come from the filesystem’s systemFreeSize and systemSize; used is total minus free. There is no estimate of reclaimable storage or configurable units. Thresholds control colours, not actions.

sbar documentation Built with Hugo · Reference reviewed 12 Sep 2026