System manager
Access through app.system (CryKit::System::Manager).
Methods
| Method | Returns | Purpose | Platform |
|---|---|---|---|
os | CryKit::System::OS | Identify Darwin, Linux, or Windows | All |
screen_info | CryKit::System::ScreenInfo | Read the current main screen's dimensions and scale | macOS |
accent_color | String | Read the current system accent as CSS hex | macOS |
open_in_file_manager(path) | Nil | Open an existing directory in Finder | macOS |
reveal_in_file_manager(path) | Nil | Select a file or directory in Finder | macOS |
os is available before startup. Call the other native operations on the UI context after native startup, such as a mounted event callback or job.notify. Unsupported platforms raise CryKit::System::UnsupportedError.
File manager
app.system.open_in_file_manager("/Users/me/Documents")
app.system.reveal_in_file_manager(Path.new("/Users/me/Documents/report.pdf"))| Path rule | Behavior |
|---|---|
| Type | String or Path |
| Relative path | Resolved against the process's working directory |
| Spaces, Unicode, shell metacharacters | Passed literally |
~ or symbolic links | No tilde expansion or symlink resolution; target must exist |
| Empty, NUL-containing, invalid UTF-8, or missing path | ArgumentError on macOS |
| Open a non-directory | ArgumentError |
| Finder rejects the request | CryKit::System::FileManagerError |
Both methods use AppKit's file viewer API. Unsupported platforms raise before path validation.
OS and screen information
app.system.os
screen = app.system.screen_info| Value | Type | Meaning |
|---|---|---|
os | CryKit::System::OS | Darwin, Linux, or Windows |
screen.width | Int32 | Full screen width in logical points |
screen.height | Int32 | Full screen height in logical points |
screen.scale | Float64 | Backing pixels per logical point |
ScreenInfo is immutable. Each call reads AppKit's main screen: the screen containing the window receiving keyboard events, which can differ from the primary display. Dimensions include the menu bar and Dock areas. If no main screen is available, the call raises CryKit::System::ScreenUnavailableError.
System accent color
accent = app.system.accent_colorReturns a lowercase six-digit sRGB CSS hex string, for example "#007aff". The getter reads the current value each time; it does not observe changes. Call again to refresh after the user's settings change.
| Detail | Behavior |
|---|---|
| Appearance | Application appearance; a per-window Light/Dark override does not affect the lookup |
| Conversion | NSColor.controlAccentColor converted to sRGB; channels rounded and clamped to bytes |
| Lookup or conversion failure | CryKit::System::AccentColorUnavailableError |
The demo application includes a system accent swatch and a refresh action.