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
EventeventEventYesWebviewInjectall
StreamstreamStreamYesWebviewInjectall
ClipboardclipboardClipboardNoBindableall (image: no Win32)
ContextMenucontext_menuContextMenuNoBindable · WebviewInjecteventmacOS (Windows/Linux: planned)
DeepLinkdeep_linkDeepLinkNoBindableeventmacOS · Linux · Windows²
DialogsdialogsDialogsNoBindableall
DragOutdrag_outDragOutNoBindablemacOS
EditShortcutsedit_shortcutsNoWebviewInjectall
FileDropfile_dropFileDropNoWebviewInjecteventmacOS · Linux
FileWatchfile_watchFileWatchNoBindable · LifecycleeventmacOS · Linux
FilesystemfilesystemFilesystemNoBindableall
HotkeyshotkeysHotkeysNoBindableeventmacOS · Linux · Windows
NavigationnavigationNoWebviewInjectall
KvkvKvNoBindable · Lifecycleall
ShellshellShellNoBindable · LifecyclestreammacOS · Linux · Windows³
SqlitesqliteSqliteNoBindable · Lifecycleall
SystemsystemSystemNoBindableall (includes screenInfo, notify)
TraytrayTrayNoBindableeventmacOS · Linux¹ · Windows⁴
WindowwindowWindowNoBindable · WebviewInjectall (chrome opts + drag_zone macOS)
WindowswindowsWindowsNoBindable · Lifecycleall

¹ 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. Until Crystal 1.21 ships, building a runnable binary requires the one-line stdlib patch documented in WINDOWS_SETUP.md (crystal#16929, fix in master via crystal#16933). With the patch applied, the runtime works end-to-end. 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.