Repository navigation
New controller-battery plugin - #25
Conversation
…lable from the community store
|
@verbrannter-toast sick idea man! Can we set the version to 1.0.0 since it's the first iteration you've submitted? I'll do a code review after that |
|
Ah yeah sure. It was just my internal development versioning. I'll change it now. |
|
@0xSolanaceae I just made the repo I was working in before the fork public so you can test the functionality separately from this repo before merging. Here is the link: https://github.com/verbrannter-toast/controller-battery (I did use claude for a few parts of the code which make up like 20-30% of all code written. Everything else is written by me so have some mercy when reviewing since I am not that well versed in QML yet hehe) |
0xSolanaceae
left a comment
There was a problem hiding this comment.
Good, couple of changes to make. You can probably just get rid of main.qml
There was a problem hiding this comment.
This appears to be patching a shell bug, not a plugin concern. PluginLoader.setPluginEnabled already finds the right discovered[j], then throws that reference away and passes the lossy ListModel row to syncBackgroundWidgets.
As written it also declares the widget spec twice (here and metadata.json:28-35), skips normalizeBackgroundWidgets's path validation, and depends on isKnown()/register() internals.
| } | ||
| } | ||
|
|
||
| Component.onDestruction: BackgroundWidgetRegistry.unregister(root.pluginId) |
There was a problem hiding this comment.
This deferred unregister can fire after the new instance's register() and wipe it. The only thing bringing the widget back is the 150 ms timer. Both go away with the fix above.
|
|
||
| // The desktop layer only passes input to this region when the Plasma | ||
| // wallpaper is shown instead of Caelestia's. | ||
| property var inputRegion: Region { |
There was a problem hiding this comment.
PendingRegion only tracks x/y/width/height of item, not visible, so when line 168 hides the widget this still contributes a card-sized rect to BackgroundWindow.widgetRegions
| ## Customizing | ||
|
|
||
| The panel is movable across the whole desktop and saves its position across reboots. You can reset the position to the default by double clicking it. | ||
| [DesktopWidget.qml](DesktopWidget.qml) features a ton of customizing options between line 32 and 56 which should make adjusting to your preference easy. This is also where you can adjust the default position that double clicking resets to. If you want to use different icons to the default ones just replace them with the exact file name in `/icons`. |
There was a problem hiding this comment.
The line numbers appear to be stale
There was a problem hiding this comment.
The line numbers appear to be stale
Not sure what you mean by this. Line 32 - 56 are the correct line numbers for the customization section. I applied all other changes though and will commit in a bit after running the check script again.
|
Alright, everything you requested should be committed now. I hope the fix in line 29 of DesktopWidget.qml is fine. I wasn't able to reproduce the behavior you described so I couldn't test it |
|
good, thanks! |
What does this PR do?
This adds a new plugin to show controller battery percentage and charging status as a widget directly on the desktop. The widget is fully movable and saves its position across restarts. Most functionality is explained in the readme.
(These svg icons are made by myself and licensed under the same MIT license)
Plugin
controller-batteryquickshellChecklist
plugins/<id>/and the folder name equals theidinmetadata.jsonmetadata.jsonis valid JSON and passespython scripts/validate.pyLICENSEfile is included in the plugin folderversionfollows semver and was bumped for updates