on

abstract fun on(event: PowerMonitorEvent.LOCK_SCREEN, listener: Function<Unit>)(source)

Emitted when the system is about to lock the screen.


abstract fun on(event: PowerMonitorEvent.ON_AC, listener: Function<Unit>)(source)

Emitted when the system changes to AC power.


abstract fun on(event: PowerMonitorEvent.ON_BATTERY, listener: Function<Unit>)(source)

Emitted when system changes to battery power.


abstract fun on(event: PowerMonitorEvent.RESUME, listener: Function<Unit>)(source)

Emitted when system is resuming.


abstract fun on(event: PowerMonitorEvent.SHUTDOWN, listener: Function<Unit>)(source)

Emitted when the system is about to reboot or shut down. If the event handler invokes e.preventDefault(), Electron will attempt to delay system shutdown in order for the app to exit cleanly. If e.preventDefault() is called, the app should exit as soon as possible by calling something like app.quit().


abstract fun on(event: PowerMonitorEvent.SPEED_LIMIT_CHANGE, listener: Function<Unit>)(source)

Notification of a change in the operating system's advertised speed limit for CPUs, in percent. Values below 100 indicate that the system is impairing processing power due to thermal management.


abstract fun on(event: PowerMonitorEvent.SUSPEND, listener: Function<Unit>)(source)

Emitted when the system is suspending.


Emitted when the thermal state of the system changes. Notification of a change in the thermal status of the system, such as entering a critical temperature range. Depending on the severity, the system might take steps to reduce said temperature, for example, throttling the CPU or switching on the fans if available.

Apps may react to the new state by reducing expensive computing tasks (e.g. video encoding), or notifying the user. The same state might be received repeatedly.

See https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/RespondToThermalStateChanges.html


abstract fun on(event: PowerMonitorEvent.UNLOCK_SCREEN, listener: Function<Unit>)(source)

Emitted as soon as the systems screen is unlocked.


Emitted when a login session is activated. See documentation for more information.


Emitted when a login session is deactivated. See documentation for more information.