Your First Script
Create hello_hexis.lua in the user script directory:
hexis.script({
name = "Hello Hexis",
description = "A minimal configurable script",
author = "YourName",
version = "1.0.0"
})
local config = hexis.config({
interval = hexis.config.slider("Interval", 0.5, 5.0, 1.0, 0.5),
show_notification = hexis.config.toggle("Show notification", true)
})
function hexis.main()
hexis.log.info("Hello Hexis started")
if config.show_notification then
hexis.notify("Hello from Lua")
end
while hexis.script.is_running() do
hexis.log.debug("The script is still running")
hexis.wait(config.interval)
end
end
This script keeps declarations at file scope and side effects inside
hexis.main(). The loop uses a configurable finite wait and observes the
runtime stop state.
Try it
- Open Hexis with H.
- Select Hello Hexis.
- Change its generated settings.
- Start it and confirm the log message or notification.
- Stop it and confirm the loop exits.