Skip to content

Interface: SystemStatus ​

Defined in: types/desktop-engine.d.ts:4207

How the Mac is doing (DesktopEngine.systemStatus): processor, memory, network, power, temperature and disk, e.g. for a widget that shows them. Needs the "system-info" permission (and "apiVersion": 8); DesktopEngine.systemStatus is null without it. It never tells which apps run, which network the Mac is on, or any address.

The app takes a reading about once a second while the content reads the properties or listens to the events (but resume), and stops 2 seconds after the last read once nothing listens. Each property is a frozen object that's replaced by the next reading, so keep a reference to compare with the next one. Nothing comes while the content is suspended: the resume event says for how long it was.

Extends ​

Properties ​

bootTime ​

ts
readonly bootTime: number;

Defined in: types/desktop-engine.d.ts:4229

When the Mac started, ms since the epoch, to the minute


cpu ​

ts
readonly cpu: Readonly<CPUStatus>;

Defined in: types/desktop-engine.d.ts:4209

The processor


disk ​

ts
readonly disk: Readonly<DiskStatus>;

Defined in: types/desktop-engine.d.ts:4227

The startup disk


memory ​

ts
readonly memory: Readonly<MemoryStatus>;

Defined in: types/desktop-engine.d.ts:4211

Memory


network ​

ts
readonly network: Readonly<NetworkStatus>;

Defined in: types/desktop-engine.d.ts:4213

The network


onchange ​

ts
onchange: 
  | EventHandler<SystemStatus, void>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:4231

change callback


onmemorypressurechange ​

ts
onmemorypressurechange: 
  | EventHandler<SystemStatus, void>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:4247

memorypressurechange callback


onnetworkchange ​

ts
onnetworkchange: 
  | EventHandler<SystemStatus, void>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:4243

networkchange callback


onpowerchange ​

ts
onpowerchange: 
  | EventHandler<SystemStatus, void>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:4235

powerchange callback


onresume ​

ts
onresume: 
  | EventHandler<SystemStatus, SystemResumePayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:4251

resume callback


onthermalchange ​

ts
onthermalchange: 
  | EventHandler<SystemStatus, void>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:4239

thermalchange callback


power ​

ts
readonly power: Readonly<PowerStatus>;

Defined in: types/desktop-engine.d.ts:4215

Power and the battery


temperature ​

ts
readonly temperature: number | null;

Defined in: types/desktop-engine.d.ts:4225

The processor's temperature in °C, the average of its cores' sensors; null when the Mac doesn't let the app read it. It moves with the work the Mac does; thermal tells when the heat slows the Mac down


thermal ​

ts
readonly thermal: ThermalState;

Defined in: types/desktop-engine.d.ts:4220

How hard the Mac is working to stay cool, as macOS tells it: it goes up when the Mac has to slow down to cool itself. It isn't a temperature: a Mac can run hot and still be nominal

Methods ​

addEventListener() ​

ts
addEventListener<K>(type, listener): void;

Defined in: types/desktop-engine.d.ts:143

Adds an event listener; type may be given with or without the on prefix

Type Parameters ​

Type Parameter
K extends | "change" | "powerchange" | "thermalchange" | "networkchange" | "memorypressurechange" | "resume"

Parameters ​

ParameterType
typeK | `on${K}`
listenerEventHandler<SystemStatus, SystemStatusEventMap[K]>

Returns ​

void

Inherited from ​

EventedObject.addEventListener


destroy() ​

ts
destroy(): void;

Defined in: types/desktop-engine.d.ts:147

Clears all event listeners and on callbacks so the object can be garbage-collected; components also process their children recursively

Returns ​

void

Inherited from ​

EventedObject.destroy


offchange() ​

ts
offchange(): void;

Defined in: types/desktop-engine.d.ts:4233

Removes the onchange callback

Returns ​

void


offmemorypressurechange() ​

ts
offmemorypressurechange(): void;

Defined in: types/desktop-engine.d.ts:4249

Removes the onmemorypressurechange callback

Returns ​

void


offnetworkchange() ​

ts
offnetworkchange(): void;

Defined in: types/desktop-engine.d.ts:4245

Removes the onnetworkchange callback

Returns ​

void


offpowerchange() ​

ts
offpowerchange(): void;

Defined in: types/desktop-engine.d.ts:4237

Removes the onpowerchange callback

Returns ​

void


offresume() ​

ts
offresume(): void;

Defined in: types/desktop-engine.d.ts:4253

Removes the onresume callback

Returns ​

void


offthermalchange() ​

ts
offthermalchange(): void;

Defined in: types/desktop-engine.d.ts:4241

Removes the onthermalchange callback

Returns ​

void


removeEventListener() ​

ts
removeEventListener<K>(type, listener): void;

Defined in: types/desktop-engine.d.ts:145

Removes the given event listener

Type Parameters ​

Type Parameter
K extends | "change" | "powerchange" | "thermalchange" | "networkchange" | "memorypressurechange" | "resume"

Parameters ​

ParameterType
typeK | `on${K}`
listenerEventHandler<SystemStatus, SystemStatusEventMap[K]>

Returns ​

void

Inherited from ​

EventedObject.removeEventListener

The SDK is released under the Apache License 2.0