Skip to content

Plugins ​

Plugins are Lune's feature modules. Each one maps to a config key in lune.yml, an optional JS namespace in the runtime, and a set of Crystal-side lifecycle phases.

All plugins are active by default. Turn them off individually with disabled:, or whitelist specific ones with enabled::

yaml
plugins:
  disabled:
    - tray
    - file_watch

# or whitelist
plugins:
  enabled:
    - system
    - clipboard
    - event
    - stream

Core vs standard ​

Two plugins are marked core: event and stream. They are enabled by default like every other plugin — but disabling them has a cascade effect: any plugin that hard-depends on them is automatically disabled too, with a warning logged at startup.

TypeCan be disabled?Cascade effect
CoreYesAll hard-dependents are also disabled
StandardYesNo cascade

Dependency types ​

TypeBehaviour
Hard depIf the dep is inactive, this plugin is automatically disabled (warning logged)
Soft depPlugin stays active but a warning is logged; feature degrades gracefully

Lifecycle phases ​

PhaseInterfaceWhen it runs
Bindableinstall(ctx)At startup — registers RPC bridge methods that become the JS namespace
WebviewInjectinit_webview(ctx)At startup — injects JS into the webview (and during build for stubs)
LifecycleshutdownWhen the window closes — releases OS resources

Plugin matrix ​

PluginConfig keyJS namespaceCorePhasesHard depsSoft depsPlatforms
EventeventEventYesWebviewInject——all
StreamstreamStreamYesWebviewInject——all
ClipboardclipboardClipboardNoBindable——all (image: no Win32)
ContextMenucontext_menuContextMenuNoBindable · WebviewInjectevent—macOS (Windows/Linux: planned)
DeepLinkdeep_linkDeepLinkNoBindableevent—macOS · Linux · Windows²
DialogsdialogsDialogsNoBindable——all
DragOutdrag_outDragOutNoBindable——macOS
EditShortcutsedit_shortcuts—NoWebviewInject——all
FileDropfile_dropFileDropNoWebviewInjectevent—macOS · Linux
FileWatchfile_watchFileWatchNoBindable · Lifecycleevent—macOS · Linux
FilesystemfilesystemFilesystemNoBindable——all
HotkeyshotkeysHotkeysNoBindable—eventmacOS · Linux · Windows
IntrospectionintrospectionIntrospectionNoBindable · WebviewInject——all
Navigationnavigation—NoWebviewInject——all
KvkvKvNoBindable · Lifecycle——all
ShellshellShellNoBindable · Lifecyclestream—macOS · Linux · Windows³
SqlitesqliteSqliteNoBindable · Lifecycle——all
SystemsystemSystemNoBindable——all (includes screenInfo, notify)
TraytrayTrayNoBindable—eventmacOS · Linux¹ · Windows⁴
WindowwindowWindowNoBindable · WebviewInject——all (chrome opts + drag_zone macOS)
WindowswindowsWindowsNoBindable · Lifecycle——all

¹ Requires XWayland on Wayland compositors. ² Windows: cold-start (ARGV) only — no warm-start forwarding yet (Linux has Unix-socket warm-start). ³ Windows: cmd builtins (echo, dir, type, …) and .cmd / .bat shims (npm.cmd, yarn.cmd) are auto-retried via cmd /c when the direct Process.new raises File::NotFoundError — no manual wrapping needed. ⁴ Windows: lune.Tray.setIcon requires a .ico path — PNG / SVG fall back to the system default app icon with a logger warning. opts.tray.toggle_window_on is a no-op (positioning the window relative to the tray icon needs Shell_NotifyIconGetRect plumbing — tracked in ROADMAP.md). Native menus render at the cursor position rather than under the tray icon.

Windows runtime caveat. Every "Windows" entry above is in tree; many are now verified on real hardware. Building a runnable binary requires Crystal 1.21+ and the native library setup in WINDOWS_SETUP.md. For per-plugin Windows status see the Platform notes section on each plugin page.


Dependency graph ​

Event ──► ContextMenu
         └─► DeepLink
         └─► FileDrop
         └─► FileWatch
         └─► (soft) Tray

Stream   ──► Shell

Disabling event automatically disables ContextMenu, DeepLink, FileDrop, and FileWatch. Disabling stream automatically disables Shell.

Released under the MIT License.