Header menu logo fable-electron-docs-api

powerMonitor Type

⚠ Process Availability: Main ✔ | Renderer ❌ | Utility ❌ | Exported ✔

Monitor power state changes.Process: Main

Static members

Static member Description

powerMonitor.getCurrentThermalState ()

Full Usage: powerMonitor.getCurrentThermalState ()

Returns: GetCurrentThermalState
Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌

The system's current thermal state. Can be unknown, nominal, fair, serious, or critical.

Returns: GetCurrentThermalState

powerMonitor.getSystemIdleState idleThreshold

Full Usage: powerMonitor.getSystemIdleState idleThreshold

Parameters:
    idleThreshold : int

Returns: GetSystemIdleState
Modifiers: inline

The system's current idle state. Can be active, idle, locked or unknown.Calculate the system idle state. idleThreshold is the amount of time (in seconds) before considered idle. locked is available on supported systems only.

idleThreshold : int
Returns: GetSystemIdleState

powerMonitor.getSystemIdleTime ()

Full Usage: powerMonitor.getSystemIdleTime ()

Returns: int
Modifiers: inline

Idle time in secondsCalculate system idle time in seconds.

Returns: int

powerMonitor.isOnBatteryPower ()

Full Usage: powerMonitor.isOnBatteryPower ()

Returns: bool
Modifiers: inline

Whether the system is on battery power.To monitor for changes in this property, use the on-battery and on-ac events.

Returns: bool

powerMonitor.offLockScreen handler

Full Usage: powerMonitor.offLockScreen handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌

Emitted when the system is about to lock the screen.

handler : unit -> unit

powerMonitor.offOnAc handler

Full Usage: powerMonitor.offOnAc handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌

Emitted when the system changes to AC power.

handler : unit -> unit

powerMonitor.offOnBattery handler

Full Usage: powerMonitor.offOnBattery handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌

Emitted when system changes to battery power.

handler : unit -> unit

powerMonitor.offResume handler

Full Usage: powerMonitor.offResume handler

Parameters:
    handler : unit -> unit

Modifiers: inline

Emitted when system is resuming.

handler : unit -> unit

powerMonitor.offShutdown handler

Full Usage: powerMonitor.offShutdown handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ✔ | MAS ❌

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().

handler : unit -> unit

powerMonitor.offSpeedLimitChange handler

Full Usage: powerMonitor.offSpeedLimitChange handler

Parameters:
Modifiers: inline

⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌

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.

handler : Details -> unit

powerMonitor.offSuspend handler

Full Usage: powerMonitor.offSuspend handler

Parameters:
    handler : unit -> unit

Modifiers: inline

Emitted when the system is suspending.

handler : unit -> unit

powerMonitor.offThermalStateChange handler

Full Usage: powerMonitor.offThermalStateChange handler

Parameters:
Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌

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

handler : Details -> unit

powerMonitor.offUnlockScreen handler

Full Usage: powerMonitor.offUnlockScreen handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌

Emitted as soon as the systems screen is unlocked.

handler : unit -> unit

powerMonitor.offUserDidBecomeActive handler

Full Usage: powerMonitor.offUserDidBecomeActive handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌

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

handler : unit -> unit

powerMonitor.offUserDidResignActive handler

Full Usage: powerMonitor.offUserDidResignActive handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌

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

handler : unit -> unit

powerMonitor.onBatteryPower

Full Usage: powerMonitor.onBatteryPower

A boolean property. True if the system is on battery power.See powerMonitor.isOnBatteryPower().

powerMonitor.onLockScreen handler

Full Usage: powerMonitor.onLockScreen handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌

Emitted when the system is about to lock the screen.

handler : unit -> unit

powerMonitor.onOnAc handler

Full Usage: powerMonitor.onOnAc handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌

Emitted when the system changes to AC power.

handler : unit -> unit

powerMonitor.onOnBattery handler

Full Usage: powerMonitor.onOnBattery handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌

Emitted when system changes to battery power.

handler : unit -> unit

powerMonitor.onResume handler

Full Usage: powerMonitor.onResume handler

Parameters:
    handler : unit -> unit

Modifiers: inline

Emitted when system is resuming.

handler : unit -> unit

powerMonitor.onShutdown handler

Full Usage: powerMonitor.onShutdown handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ✔ | MAS ❌

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().

handler : unit -> unit

powerMonitor.onSpeedLimitChange handler

Full Usage: powerMonitor.onSpeedLimitChange handler

Parameters:
Modifiers: inline

⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌

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.

handler : Details -> unit

powerMonitor.onSuspend handler

Full Usage: powerMonitor.onSuspend handler

Parameters:
    handler : unit -> unit

Modifiers: inline

Emitted when the system is suspending.

handler : unit -> unit

powerMonitor.onThermalStateChange handler

Full Usage: powerMonitor.onThermalStateChange handler

Parameters:
Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌

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

handler : Details -> unit

powerMonitor.onUnlockScreen handler

Full Usage: powerMonitor.onUnlockScreen handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌

Emitted as soon as the systems screen is unlocked.

handler : unit -> unit

powerMonitor.onUserDidBecomeActive handler

Full Usage: powerMonitor.onUserDidBecomeActive handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌

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

handler : unit -> unit

powerMonitor.onUserDidResignActive handler

Full Usage: powerMonitor.onUserDidResignActive handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌

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

handler : unit -> unit

powerMonitor.onceLockScreen handler

Full Usage: powerMonitor.onceLockScreen handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌

Emitted when the system is about to lock the screen.

handler : unit -> unit

powerMonitor.onceOnAc handler

Full Usage: powerMonitor.onceOnAc handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌

Emitted when the system changes to AC power.

handler : unit -> unit

powerMonitor.onceOnBattery handler

Full Usage: powerMonitor.onceOnBattery handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌

Emitted when system changes to battery power.

handler : unit -> unit

powerMonitor.onceResume handler

Full Usage: powerMonitor.onceResume handler

Parameters:
    handler : unit -> unit

Modifiers: inline

Emitted when system is resuming.

handler : unit -> unit

powerMonitor.onceShutdown handler

Full Usage: powerMonitor.onceShutdown handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ✔ | MAS ❌

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().

handler : unit -> unit

powerMonitor.onceSpeedLimitChange handler

Full Usage: powerMonitor.onceSpeedLimitChange handler

Parameters:
Modifiers: inline

⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌

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.

handler : Details -> unit

powerMonitor.onceSuspend handler

Full Usage: powerMonitor.onceSuspend handler

Parameters:
    handler : unit -> unit

Modifiers: inline

Emitted when the system is suspending.

handler : unit -> unit

powerMonitor.onceThermalStateChange handler

Full Usage: powerMonitor.onceThermalStateChange handler

Parameters:
Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌

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

handler : Details -> unit

powerMonitor.onceUnlockScreen handler

Full Usage: powerMonitor.onceUnlockScreen handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌

Emitted as soon as the systems screen is unlocked.

handler : unit -> unit

powerMonitor.onceUserDidBecomeActive handler

Full Usage: powerMonitor.onceUserDidBecomeActive handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌

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

handler : unit -> unit

powerMonitor.onceUserDidResignActive handler

Full Usage: powerMonitor.onceUserDidResignActive handler

Parameters:
    handler : unit -> unit

Modifiers: inline

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌

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

handler : unit -> unit

Type something to start searching.