Closed friedow closed 1 year ago
Turns out: the protocol, pop-launcher
as well as onagre
do support updating data from the plugin side continuously. My implementation of this was just flawed! For everyone wondering, here is a working implementation of the clock plugin:
#!/usr/bin/env nu
while true {
let currentTime = (date now | date format '%H:%M')
print '"Clear"' # double quotes inside single quotes to send a string to the json ipc ;)
print $'{ "Append": { "id": 0, "name": "($currentTime)", "description": "Current Time" } }'
print '"Finished"'
sleep 1sec
}
To System76 and all maintainers of this project: Thanks for open sourcing this and doing an awesome job on this project :heart:!
Currently plugins are invoked on input changes (when the user types in new stuff). This enables plugins to react to stuff happening in the frontend. However, sometimes data from plugins changes even if the user does not do anything.
Take this plugin, which displays the current time as an example:
plugin.ron
clock.nu
Currently there is no way to update the time from the plugin proactively. I would however love to do something like this:
clock.nu
This could enable a bunch of new plugins especially for displaying data. Imagine plugins like:
PS: These are my thought on pop-launcher combined with onagre. Please correct me if any of my assumptions are wrong.