No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Krzysztof Krystian Jankowski 75483e63c1 Omarchy bar widget: per-core CPU icons with load-driven opacity
One Nerd Font chip icon per core; each icon sits at a 10% opacity floor
and the remaining 90% of the range scales with the core's usage from
/proc/stat deltas. Hover shows total load and core count, left-click
opens btop. Includes Node unit tests for the parsing/opacity model.
2026-11-24 18:12:30 +01:00
test Omarchy bar widget: per-core CPU icons with load-driven opacity 2026-11-24 18:12:30 +01:00
BarWidget.qml Omarchy bar widget: per-core CPU icons with load-driven opacity 2026-11-24 18:12:30 +01:00
CpuModel.js Omarchy bar widget: per-core CPU icons with load-driven opacity 2026-11-24 18:12:30 +01:00
manifest.json Omarchy bar widget: per-core CPU icons with load-driven opacity 2026-11-24 18:12:30 +01:00
README.md Omarchy bar widget: per-core CPU icons with load-driven opacity 2026-11-24 18:12:30 +01:00

omarchy-cpus

An Omarchy shell bar widget: one CPU chip icon per core, where each icon's opacity follows that core's load — a 10% opacity floor when idle, and the remaining 90% of the range scales with usage (50% load → 55% opacity, full load → solid). Icons render in the bar's Nerd Font in the bar's foreground color, matching every other widget on the bar.

Data comes from /proc/stat deltas (no extra dependencies), polled every 1.5s with a short opacity fade so numbers change smoothly. Hover shows the total load and core count; left-click opens btop.

Install

omarchy plugin add https://git.cyfrowynomada.com/CyfrowyNomada/omachy-cpus.git --enable

The command clones the repo, validates it against the plugin schema, and installs it as kj.cpus under ~/.config/omarchy/plugins/. --enable asks where to place the widget (it suggests the right section). To place or move it by hand, add it to the bar layout in ~/.config/omarchy/shell.json:

{ "id": "kj.cpus" }

Updates: omarchy plugin update kj.cpus.

Layout in the bar

On this machine the widget lives in the right section, between audio and display:

{ "id": "kj.cpus" }

Per-widget settings

Tune via the layout entry in ~/.config/omarchy/shell.json:

{ "id": "kj.cpus", "emoji": "🧠", "interval": 1000 }
Setting Default Meaning
icon 󰻠 Glyph per core (Nerd Font). Alternatives: (fa-microchip), (oct-cpu), 󰻟 (cpu_32_bit)
interval 1500 Poll interval in ms (clamped to ≥ 500)

(emoji is still accepted as an alias for icon; a color emoji like 🔥 also works — Qt falls back to Noto Color Emoji automatically.)

Files

manifest.json      # plugin manifest (id kj.cpus, kind bar-widget)
BarWidget.qml      # the bar widget (entry point)
CpuModel.js        # pure /proc/stat parsing + opacity math
test/CpuModel.test.js  # Node tests: node test/CpuModel.test.js

How the opacity mapping works

opacity = 0.1 + 0.9 × usage      # 10% floor, 90% scaled to load

Idle cores stay visible as faint ghosts (never fully disappear), a busy core solidifies. Defined once in CpuModel.coreOpacity() with unit tests.

Icon codepoints (verified against the installed font)

Extracted from JetBrainsMonoNerdFont-Regular.ttf's cmap table:

U+F0EE0  󰻠  nf-md-cpu_64_bit        (default)
U+F0EDF  󰻟  nf-md-cpu_32_bit
U+F2DB    nf-fa-microchip
U+F4BC    nf-oct-cpu
U+F061A  󰘚  nf-md-chip

Developing

Source of truth lives here; the shell runs a copy at ~/.config/omarchy/plugins/kj.cpus/ (edits there hot-reload the bar). To push a change:

node test/CpuModel.test.js
omarchy plugin validate .
rsync -a --delete --exclude test/ --exclude README.md ./ ~/.config/omarchy/plugins/kj.cpus/

If a change doesn't apply: omarchy-shell shell rescanPlugins.