Repository navigation
Indicators: load indicators provided by other plugins - #11659
Open
xxbouncingsoulxx wants to merge 1 commit into
Open
xxbouncingsoulxx wants to merge 1 commit into
xxbouncingsoulxx wants to merge 1 commit into
Conversation
An items entry of omarchy.indicators may now name a plugin and a QML file
inside it: { "id": "Backup", "plugin": "my.org.backup", "source": "Indicator.qml" }.
The widget resolves the plugin through the shell registry (__sourceDir) and
loads <dir>/<source>; the file is a normal BarIndicator and gets the entry's
other keys as settings. Entries without "plugin" resolve to
../indicators/<id>.qml as before. Unknown plugins, ".." and absolute paths
load nothing.
This lets a plugin put its own state (a backup job, a sync client, ...) into
the hover-reveal indicator group instead of adding a standalone bar icon.
Member
|
@dhh this could be a potentially reasonable PR if we want to expand a shell plug-in API. |
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.
What
omarchy.indicatorscan now host indicators shipped by other plugins. Anitemsentry may be an object naming the plugin and the QML file inside it:{ "id": "omarchy.indicators", "items": ["Dnd", "NightLight", { "id": "Backup", "plugin": "my.org.backup", "source": "Indicator.qml" }] }The widget looks the plugin up in the shell's plugin registry (
installedPlugins[id].__sourceDir) and loads<dir>/<source>(sourcedefaults toIndicator.qml). The file is a normalBarIndicator; the entry's other keys are passed assettings, so the plugin's indicator can be configured the same way as its bar widget.Why
The indicator group is the right home for "something is going on" state: hidden while idle, revealed dimmed on hover, visible when active. Today only the six first-party indicators can live there; a plugin that wants the same behaviour has to add a standalone bar icon or the user has to clone the whole widget. My use case is a restic backup job: red when the last run failed, green while it runs, hidden otherwise - see screenshots.
Behaviour
pluginresolve to../indicators/<id>.qmlexactly as before...insource, or an absolutesource→ nothing is loaded and a warning is logged.registryRevision, so a plugin installed after the bar started is picked up on rescan.Testing
./test/all(CLI + shell suites) on this branch.Screenshots: hidden (ok) · failed (red) · running (green) · hover-revealed.



