mirror of
https://github.com/prdlk/noctalia-ostt.git
synced 2026-08-02 17:41:38 +00:00
feat(core): add example plugin with declarative and imperative API examples
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
--!nonstrict
|
||||
-- Headless [[service]] entry: runs in the background with no UI, ticking once a
|
||||
-- second and publishing an incrementing counter to the plugin's shared state.
|
||||
-- Any of this plugin's entries (the hello widget) can read it with
|
||||
-- noctalia.state.get / noctalia.state.watch.
|
||||
|
||||
local count = 0
|
||||
|
||||
-- Drive this service's own tick rate
|
||||
noctalia.setUpdateInterval(1000)
|
||||
|
||||
function update()
|
||||
count += 1
|
||||
noctalia.state.set("tick", count)
|
||||
end
|
||||
Reference in New Issue
Block a user