Omahub
← All plugins
G

Peripheral Batteries

by Gabriel Borges

Wireless mice, keyboards, headsets and controllers in the Omarchy bar: presence, battery, and low-battery notifications.

Security review

No obvious issues detected

Deterministic scan — not a security guarantee

None
Risk level
None
Analyzed commit
a87e457
Scanned
1 month ago

No potentially dangerous behavior detected in the analyzed commit.

Automated analysis only — not a security guarantee.

AI advisory review

No obvious issues detected

Language-model assessment · ~deepseek/deepseek-v4-flash-latest — advisory only

None
AI risk level
None
Recommendation
install
Model
~deepseek/deepseek-v4-flash-latest
Analyzed commit
a87e457
Reviewed
1 month ago

Manual review found no dangerous behavior: the bar widget runs a read-only Python helper over sysfs, passes notification data through argument arrays rather than a shell, and sanitizes device-supplied strings. The deterministic scan also found no issues, and the optional headsetcontrol dependency is documented and user-installed rather than bundled or hidden.

How this check works

This review combines the deterministic scan (the rule-based results above) with an independent look at the plugin's code by a language model. The model reads a trimmed sample of the repository's files, the manifest, and the README, then gives a plain-language risk level and a recommendation: install (no notable danger), review (look closer first), or avoid (clearly dangerous).

It runs on the same analyzed commit as the deterministic scan and is strictly advisory — it is not a security guarantee and never blocks a plugin by itself. A human moderator still reviews plugins before they are listed.

AI advisory only — automated analysis, not a security guarantee.

Install
$ omarchy plugin add https://github.com/xgborgeso/omarchy-peripheral-batteries --enable
Hardware #bar #quickshell #power-management

Peripheral Batteries for Omarchy

Check

An Omarchy bar widget for wireless mice, keyboards, headsets and controllers: battery percent for each one, grouped by brand, with a low-battery colour and a desktop notification. It reads /sys through a small Python helper, so there is no daemon and no dependencies beyond the Python 3 already on the system.

<p align="center"> <img src="preview.png" width="468" alt="The Peripheral Batteries panel open in the Omarchy bar, listing a Logitech mouse and headset with their battery percentages under a LOGITECH header"> </p>

Features

  • Presence and percent for every wireless peripheral the kernel already reports
  • Brand groups when the manufacturer or USB vendor id is known, so a known brand gets a header and a no-name dongle gets none
  • Placeholder names when the kernel gives none: Mouse 1, Headset 2, Device 1. Missing identity never errors the widget, and a missing percent reads --
  • Warning and critical thresholds you set on the bar, driving both the colour and the notification
  • Notifications in Omarchy's own style, with a per-kind glyph, and one alert per device: a device is warned once, again if it turns critical, and not again until it has charged back above the threshold

Laptop packs belong to omarchy.power and never appear here. Volume, connect and forget stay with the stock Audio and Bluetooth panels.

Install

omarchy plugin add https://github.com/xgborgeso/omarchy-peripheral-batteries.git --enable

--enable puts the chip on the right of the bar. Gaming headsets the kernel does not expose, a PRO X 2 LIGHTSPEED for example, need headsetcontrol on PATH: omarchy pkg add headsetcontrol, then unplug and replug the dongle so its udev rules apply.

Settings

Key Default What it does
hideWhenDisconnected true Hide the icon while nothing wireless is present. An error keeps it visible.
refreshIntervalSec 30 Poll cadence, in seconds.
lowBatteryPercent 20 Warning threshold, in percent.
criticalBatteryPercent 10 Critical threshold, in percent.
notifyOnLow true Send a desktop notification on low battery.
notifyRepeatMinutes 0 Re-notify while still low. 0 notifies once.
omarchy bar set io.github.xgborgeso.peripheral-batteries hideWhenDisconnected false --json
omarchy bar move io.github.xgborgeso.peripheral-batteries --section right

Notifications

A device is warned once when it crosses lowBatteryPercent, once more if it falls past criticalBatteryPercent, and not again until it has charged back above the threshold. Each alert carries the glyph for its kind.

<img src="docs/notification-low.png" width="424" alt="A notification reading Peripheral battery low, Logitech PRO X, 18 percent, with a mouse glyph">

<img src="docs/notification-critical.png" width="424" alt="A notification reading Peripheral battery critical, Logitech PRO X 2 LIGHTSPEED, 7 percent, with a headset glyph">

<img src="docs/notification-keyboard.png" width="424" alt="A notification reading Peripheral battery low, Logitech MX Keys, 16 percent, with a keyboard glyph">

<img src="docs/notification-controller.png" width="424" alt="A notification reading Peripheral battery critical, DualSense Wireless Controller, 9 percent, with a controller glyph">

Two devices crossing the threshold in the same poll are both warned:

<img src="docs/notification-both.png" width="424" alt="Two stacked notifications, one critical for a headset at 8 percent and one low for a mouse at 12 percent">

Controls

Left click opens the panel, middle click refreshes.

Key Action
r Refresh
Tab Next stock panel
Esc Close

The panel is also scriptable: omarchy-shell io.github.xgborgeso.peripheral-batteries toggle|refresh|status.

Helper

helper/status.py is the only part that touches the system, and it only runs for the length of one call:

python3 helper/status.py

It reads /sys only, never opens /dev/hidraw, and prints one line of JSON and exits 0 whatever happens. The ok and error fields say which state it is in. PERIPHERALS_SYSFS points it at another tree, which is how the tests run:

python3 tests/helper.test.py
node tests/model.test.js
omarchy plugin validate .

Remove

omarchy plugin remove io.github.xgborgeso.peripheral-batteries

License

MIT. Not affiliated with any peripheral vendor.