OS integration
Reach into every OS API a desktop dev needs — notifications, tray, dock, dark mode, global hotkeys, media controls, accent color — from idiomatic Kotlin.
Desktop apps live or die by how well they wear the host OS. Nucleus exposes the native surface of macOS, Windows, and Linux as small, focused Kotlin modules — no JNI to write, no FFI bridges to glue together, no JNA reflection traps. Pick the ones you need, leave the rest on the shelf.
TL;DR
- One Kotlin API per OS feature — same shape across macOS, Windows, Linux.
- Native backends under the hood: AppKit, WinRT, FreeDesktop / D-Bus, MPRIS, SMTC, AppIndicator, NSUserNotificationCenter — all wrapped by JNI bridges Nucleus ships and loads for you.
- À la carte. Each module is an independent Gradle artifact.
- Reactive where it matters: dark mode, accent color, and tray menus participate in Compose recomposition.
Coverage matrix
| Feature | Module | macOS | Windows | Linux |
|---|---|---|---|---|
| Cross-platform notifications | notification-common | yes | yes | yes |
| Native notifications (per OS) | notification-macos / -windows / -linux | yes | yes | yes |
| System tray + tray-anchored apps | composenativetray | yes | yes | yes |
| Global hotkeys | global-hotkey | yes | yes | yes |
| Media controls (Now Playing / SMTC / MPRIS) | media-control | yes | yes | yes |
| Dark mode (reactive) | darkmode-detector | yes | yes | yes |
| Accent color & high contrast | system-color | yes | yes | yes |
| Hardware / OS info | system-info | yes | yes | yes |
| macOS menu bar | menu-macos | yes | — | — |
| FreeDesktop icon names | freedesktop-icons | — | — | yes |
Philosophy
Every page in this section follows the same rule: if the OS exposes a capability that a serious desktop app needs, Nucleus surfaces it in Kotlin — typed, idiomatic, ready to ship. No half-baked Swing fallbacks, no "good enough" cross-platform pretending to be native.
The cross-platform facades (notification-common, media-control, darkmode-detector) cover the intersection of capabilities. When you want the long tail — Windows toast progress bars, macOS interruption levels, MPRIS volume on Linux — drop down to the platform-specific module without rewriting your app.
Where to next
- Cross-platform notifications — write once, ring everywhere.
- System tray — Compose-rendered tray icons, reactive menus.
- Global hotkey — capture keys even when unfocused.
- Dark mode — a real reactive listener, not a one-shot read.