feat(battery-wireless-devices): add wireless devices battery indicators plugin#912
Open
aslauw wants to merge 12 commits into
Open
feat(battery-wireless-devices): add wireless devices battery indicators plugin#912aslauw wants to merge 12 commits into
aslauw wants to merge 12 commits into
Conversation
Bar widget showing battery indicators for connected devices (mouse, keyboard, headphones, etc.), each rendered as a device icon inside a circular battery ring. - scripts/scan.py: normalized JSON data layer probing openrazer + Solaar; add a scan_*() and append to SOURCES to support a new device source - Main.qml: polls scan.py on a timer, exposes live devices, IPC refresh - BarWidget.qml: one pill per enabled device, theme-aware colors, tooltip, click-to-launch, right-click settings menu - Settings.qml: per-device enable/icon/colors/launch-command, applied live
openrazer intermittently returns a placeholder serial (e.g. "UNKNOWN_153200B7_0000") instead of the real one, which got saved as separate, unstable device ids. - scan.py: skip devices with an empty or "UNKNOWN_*" serial rather than minting an unstable id; the device reappears once the serial is readable - Settings.qml: auto-heal stale offline entries that match a detected device by source + name (folding config into the real id), and add a per-card delete button to remove cruft manually
Size each pill to the capsule height (smaller than the full bar height) so the bar centers it, matching the core widgets, instead of filling the whole bar height. Scale the ring and device icon to the capsule height.
Devices in the settings list can be reordered by dragging a grip handle; the order (top = left-most / top-most) is persisted as deviceOrder and honoured by the bar widget. Reuses the core NReorderCheckboxes pattern (absolute-positioned, uniform-height cards, reorder on release).
NToggle emits toggled(checked) without updating its own checked, so the global show-percentage value never flipped and commit() kept persisting the old value. Drive it from a notifiable showPercentageEdit property, matching the per-device toggle fix.
New "Show charging indicator" option adds a lightning (bolt) icon next to any device that is currently charging. Persisted as showCharging and driven by a notifiable mirror property so the toggle applies live.
- README.md with overview, screenshots, requirements, usage, settings reference, and how to add a new device source - MIT LICENSE - docs/ screenshots (bar + settings) - manifest author lowercased to "aslauw" - CLAUDE.md: correct the stale "data comes from BluetoothService" notes (data comes only from scripts/scan.py) - Settings.qml: fix card subtree indentation, drop unused toggle ids - BarWidget.qml: move barFontSize up with the other properties - scan.py: docstring battery is always 0-100 (never null)
The openrazer daemon often reports an unstable placeholder serial (e.g. UNKNOWN_153200B7_0000), especially when run as the systemd user service, which caused the device to be skipped entirely. Key the device id on USB vendor:product id instead — stable regardless of how the daemon is launched. Existing serial-keyed config auto-migrates via the settings dedup (matched by source + name).
- add i18n/en.json; route all user-facing strings through pluginApi.tr() - manifest: point repository at noctalia-plugins, add tags [Bar, Indicator, System], bump minNoctaliaVersion to 4.6.6 - rename IPC target to plugin:battery-wireless-devices - rename plugin to "Battery for Wireless Devices"; rewrite install docs - keep CLAUDE.md accurate (version, IPC target, i18n note)
…ting at noctalia-plugins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Battery for Wireless Devices
A customizable bar widget showing battery levels for wireless peripherals. Each device is an icon inside a circular battery ring.
Bar widget
Widget settings
Data comes from a small standalone scanner (
scripts/scan.py); adding a vendor is just a newscan_<source>().Supported today: Razer (OpenRazer) and Logitech (Solaar), both degrading gracefully if the tool is absent.
How to test
python3 scripts/scan.py | python3 -m json.tool.