mjolnir

Core Mjolnir functionality.

configdir

mjolnir.configdir = "~/.mjolnir/"

The user's Mjolnir config directory. Modules may use it, assuming
they've worked out a contract with the user about how to use it.

focus

mjolnir.focus()

Makes Mjolnir the foreground app.

openconsole

mjolnir.openconsole()

Opens the Mjolnir Console window and focuses it.

rawprint

mjolnir.rawprint = print

The original print function, before Mjolnir overrides it.

reload

mjolnir.reload()

Reloads your init-file in a fresh Lua environment.

showerror

mjolnir.showerror(err)

Presents an error to the user via Mjolnir's GUI. The default
implementation prints the error, focuses Mjolnir, and opens
Mjolnir's console.

Users can override this with a new function that shows errors in a
custom way.

Modules can call this in the event of an error, e.g. in callbacks
from the user:

local ok, err = xpcall(callbackfn, debug.traceback)
if not ok then mjolnir.showerror(err) end