Oma JuiceMaxx
Oma JuiceMaxx is a local Omarchy bar widget for honest battery-power diagnostics and one carefully constrained optimization action. System watts are measured from readable discharging-battery telemetry; process “drains” are activity attribution, not direct per-process power sensors.
Created by Cagan Orsun / @0nagac. The stable marketplace ID is oma.juicemaxx and the public source is github.com/cagano/omarchy-juicemaxx.
What it does
- Discovers batteries, CPU frequency driver, DRM cards/connectors, physical block devices, wireless interfaces, Bluetooth state, and advertised power profiles without hardware-name assumptions.
- Uses Omarchy/Quickshell's existing UPower subscription for live bar percentage and discharge rate, so the closed widget does not launch Python on a timer.
- Runs a bounded local Python 3 standard-library measurement using monotonic timing and trapezoidal integration.
- Keeps static hardware/profile context outside the sampling loop; fast samples use direct battery, kernel counters, process activity, and optional read-only powercap counters. The helper reports its own CPU/RSS/subprocess overhead separately and never converts that overhead to watts.
- Ranks redacted process activity across adjacent
/procsamples using(pid,starttime)identities, including process starts, exits, and counter resets. - Shows measured system watts separately from estimated process watts. Process watt estimates appear only with a fresh, condition-matched multi-sample baseline; otherwise the UI shows activity ranking and unallocated measured residual.
- Runs a deterministic
observe → measure → attribute → explain → propose → consent → apply → verify → rollbackflow. - Uses Quickshell's optional UPower subscription for live bar percentage, state, and
changeRate; older hosts fall back to the last explicit backend result. Power Profile state is taken from the backend at explicit boundaries; no unconfirmed live profile hint is shown. - Watches a user-only assistant completion marker instead of launching a Python poller while the widget is closed. NVIDIA
nvidia-smiis queried only when an NVIDIA-family DRM device is already runtime-active. - Keeps
Recommendas the default. It requires visible consent before applying an advertisedpower-saverprofile.Guarded Automaticis opt-in and requires a valid persisted policy, matched baseline, quality/coverage, battery, cooldown, and daily-limit checks; it can execute at most one typed power-profile action per run.
Bluetooth, display persistence, Wi-Fi/runtime-PM, GPU/driver, ASPM, boot/initramfs, and other privileged or vendor-specific tuning remain manual or recommendation-only. Agent Assistance is enabled by default, but each analysis still requires an explicit user action; it explains redacted evidence and suggests fixed diagnostic IDs, and has no action authority. See docs/llm-assistance.md.
Vendor GPU tools never run on the idle widget path. NVIDIA telemetry is queried only during an explicit diagnostic and only when its DRM device is already runtime-active, avoiding an accidental wake of a suspended GPU.
Installing it
omarchy plugin add https://github.com/cagano/omarchy-juicemaxx.git --enable
omarchy bar move oma.juicemaxx --section right
The plugin is intentionally unsandboxed because it reads /sys, /proc, and optional local diagnostics. Review docs/safety.md and docs/privacy-safety.md before enabling it. Missing batteries, tools, permissions, or telemetry produce degraded/unknown status rather than fabricated zeroes.
Compatibility
The backend uses only Python 3 standard-library code and fixed executable argument arrays. The legacy shell helpers remain as read-only/compatibility interfaces; mutation requests through scripts/power-action are refused so they cannot bypass typed transaction safety.
Quickshell UPower is preferred for lightweight live presentation. Direct /sys/class/power_supply remains authoritative for short diagnostic sampling and works when UPower has no usable display device. Power Profile state, powercap, DRM, /proc, and vendor telemetry all degrade independently when absent or unreadable. No package is installed and no root permission is requested.
The manifest follows Omarchy’s first-party service + bar-widget contract with a keep-loaded Service.qml coordinator and BarWidget.qml UI. The widget consumes the injected/bar.shell.serviceFor("oma.juicemaxx") singleton and falls back to one serialized, one-shot local backend process only on older hosts without the service API. A prior installed-host filename case-mismatch remains a compatibility condition to verify during installation; it is documented in docs/compatibility.md and is not silently treated as successful service loading.
Removing it
omarchy plugin disable oma.juicemaxx
omarchy plugin remove oma.juicemaxx
The backend stores local history, policy, proposals, and recovery records below ${XDG_STATE_HOME:-$HOME/.local/state}/omarchy-battery-optimizer/. Remove that directory separately if you also want to delete local state. If an interrupted transaction is reported, inspect the recorded target and recovery status before using the explicit rollback path.
Development
From the plugin directory:
jq empty manifest.json
python3 -m unittest discover -s tests -p 'test_*.py'
gjs tests/test-model.js Model.js
python3 -m py_compile bin/battery-optimizer
bash -n scripts/power-audit scripts/power-measure scripts/power-action scripts/lib/common.sh
bash tests/test-audit.sh
bash tests/test-service.sh
python3 tests/test_agent_features.py
python3 tests/validate_schemas.py
Use fixture tests for deterministic work. Read-only live checks are safe; do not run apply or rollback during development validation.
License
MIT. See LICENSE.