Skip to content

Performance

locainin edited this page Jul 1, 2026 · 7 revisions

Performance

This page lists configuration and workflow choices that reduce CPU and wakeups.

Prefer built-ins

Built-in widget readers (builtin:*) avoid external processes and are cheaper than shell commands. Prefer built-ins for CPU, memory, battery, and network stats.

Use watch commands

Long-running watch_cmd entries (for volume, Wi-Fi, Bluetooth, rfkill) update widgets on events and reduce polling. When a watch command is unavailable, the widget falls back to polling.

UnixNotis also filters known watcher startup noise before it triggers a refresh:

  • pactl subscribe refreshes only on sink and server events
  • nmcli monitor startup status lines are ignored
  • udevadm monitor banner lines are ignored
  • dbus-monitor ignores its own startup NameAcquired/NameLost chatter

Custom watch commands should print a line only when the widget should refresh. Bursty output is debounced before it reaches GTK.

Media marquee cost

Long media titles scroll with a marquee effect, which triggers periodic redraws. If lower idle CPU is preferred, either increase the title threshold or disable the media widget entirely:

[media]
title_char_limit = 48
enabled = false

Media metadata retries are bounded per player, so delayed metadata updates should not accumulate unbounded background retry tasks under bursty player signals.

The newer media shell knobs can also reduce work:

[media]
show_art = false
show_navigation = false
title_char_limit = 48
  • hiding art avoids artwork decode and texture updates
  • hiding player navigation removes extra buttons and width pressure
  • a larger title_char_limit reduces marquee redraws
  • smaller art_size_px, content_spacing_px, and navigation_spacing_px help tighter panels stay within their requested width with less CSS pressure

Remote browser artwork is disabled by default. Turning on:

[media]
remote_art_policy = "browsers_too"

allows browser media sessions to fetch remote https artwork too, which improves visuals but increases network activity and trust in webpage-controlled metadata.

Increase refresh intervals

For lightweight dashboards, increase refresh intervals:

[widgets]
refresh_interval_ms = 2000
refresh_interval_slow_ms = 6000

Panel profiling

unixnotis-center also exposes an opt-in runtime probe for panel-open and steady-state churn:

UNIXNOTIS_PERF_PROBE=1 noticenterctl open-panel --debug verbose

This is meant for profiling sessions, not normal daily use.

When enabled, the center logs structured snapshots around:

  • panel open
  • a short settled window after open
  • panel close

The probe is useful for spotting:

  • refresh timers that keep firing after the panel settles
  • watch-driven churn that keeps reapplying widget state
  • marquee activity that continues to redraw while visible

Use it alongside perf, flamegraph, or repeated branch-to-branch runs when tracking down CPU usage during animated panel opens.

CSS validation cost

noticenterctl css-check caches GTK parse results for unchanged active CSS files. The lint, runtime, and geometry checks still run so stale warnings do not survive config edits, but repeated theme validation should avoid reparsing files that did not change.

Prefer simple commands

Simple commands run directly and avoid shell overhead. Use sh -c only when a pipeline is required.

Normal widget commands may use shell syntax when they need it. Plugin commands are intentionally stricter and must stay shell-free, so plugins should move branching or pipelines into a script file.

Sound bursts

Notification sound playback is bounded:

  • playback requests have a short cooldown
  • at most two sound commands run at once
  • sound child processes time out after three seconds

This keeps notification storms from turning into unbounded process fanout. If every notification does not make a sound during a burst, that is usually the limiter doing its job.

Notification payload bounds

The daemon bounds untrusted notification content before storing it:

  • action rows are capped at 8 action pairs
  • body text is capped at 16 KiB
  • summaries, categories, action labels, and hints are also capped
  • very long unbroken tokens are folded to avoid layout spikes
  • raw image payloads are capped and large list/history views avoid carrying raw image buffers

These limits are meant to keep popup and panel rendering predictable under noisy applications.

UI child supervision

unixnotis-daemon starts unixnotis-center and unixnotis-popups as supervised child processes. If a UI child exits, the daemon restarts it with backoff:

  • first restart delay: 250 ms
  • maximum restart delay: 5000 ms
  • a child that runs for at least 30 seconds resets the backoff

The daemon prefers sibling binaries next to unixnotis-daemon, then falls back to PATH. When the daemon was launched with --config, the same config path is passed to child UIs through UNIXNOTIS_CONFIG_PATH.

Disable unused widgets

Disable widgets that are not needed:

[widgets.volume]
enabled = false

[widgets.brightness]
enabled = false

Clone this wiki locally