Nucleus
OS integration

OS integration

Kotlin modules that expose native macOS, Windows, and Linux desktop capabilities such as notifications, system tray, global hotkeys, media controls, dark mode, and system colors.

The OS integration modules expose native desktop capabilities from Kotlin: notifications, system tray, global hotkeys, media controls, dark mode, and system colors. Each capability is a separate Gradle artifact, so you depend only on the modules you use.

Coverage

FeatureModulemacOSWindowsLinux
Cross-platform notificationsnotification-commonyesyesyes
Native notifications (per OS)notification-macos / notification-windows / notification-linuxyesyesyes
System tray and tray-anchored appscomposenativetrayyesyesyes
Global hotkeysglobal-hotkeyyesyesyes
Media controlsmedia-controlyesyesyes
Dark modedarkmode-detectoryesyesyes
Accent color and high contrastsystem-coloryesyesyes
Hardware and OS infosystem-infoyesyesyes
macOS menu barmenu-macosyes
FreeDesktop icon namesfreedesktop-iconsyes

Modules published by Nucleus use the group dev.nucleusframework and the artifact name nucleus.<module-name>. The composenativetray module ships from a separate repository under the same group, without the nucleus. prefix.

Cross-platform modules and platform modules

Some capabilities come in two forms. The cross-platform modules — notification-common, media-control, and darkmode-detector — expose the intersection of what all three systems support behind a single API. The platform modules, such as notification-macos, notification-windows, and notification-linux, expose each system's native API directly, so their surfaces differ from one platform to the next. Depend on a platform module when you need a platform-specific feature, such as Windows toast progress bars, macOS interruption levels, or MPRIS volume on Linux.

How it works

Each module wraps its platform's native API through a JNI bridge that Nucleus ships and loads for you. Notifications use the UserNotifications framework (UNUserNotificationCenter) on macOS, WinRT toast notifications on Windows, and the FreeDesktop notification specification (org.freedesktop.Notifications) over D-Bus on Linux. Media controls use SMTC on Windows and MPRIS on Linux. Dark mode and accent color read reactively through @Composable functions, so they participate in Compose recomposition when the system state changes.

What's next