native
A collection of system capability modules. Each subdirectory is an independent module, you can use only one of them, or you can not use the ui interface at all.
| Modules | Capabilities | Dependencies |
|---|---|---|
| permission | Check and apply for system permissions | native, native/internal/sys |
| screen | Monitor list, screenshots | Same as above |
| input | Synthesize mouse and keyboard events | Same as above |
| hotkey | Global shortcut keys | Same as above |
| clipboard | Asynchronously read clipboard text, encoded images, and file references (macOS / Windows / Linux Wayland, X11) | Same as above |
| notification | System notification permissions, delivery and withdrawal (macOS .app / Linux D-Bus) | Same as above |
| tray | Desktop status icons and native menus (macOS / Windows / Linux SNI) | native, native/internal/sys |
| process | Terminal foreground process group and process working directory (macOS / Linux) | native, native/internal/sys |
Modules do not reference each other, nor do they reference ui and Gio. This is guaranteed by the tests in internal/deps.
The two shared parts are not independent modules:
native(native.gofor this directory): Error valuenative.Err*common to all modules.native/internal/sys: Platform bindings: macOS's Objective-C runtime and system frameworks through purego (no cgo), Windows' Win32 calls, Linux's X11 protocol and D-Bus are all here. Cannot be referenced externally.native/internal/wlclip: Reads the Linux Wayland clipboard, loading libwayland-client at run time through purego (no cgo). Only clipboard references it, so other modules never load libwayland.
Supports macOS 14+, Windows, and Linux, other platforms return native.ErrUnsupported. On Linux, screenshots and composite input go through X11 (via XWayland in Wayland sessions), notifications go through D-Bus, and the clipboard is supported by both Wayland and X11. For details on each ability on each platform, see Native ability.
Document: Native ability · New native ability
Mobile iOS and Android backends for native/* are not implemented; operations return native.ErrUnsupported. See Mobile support for UI packaging and running.