powerMonitor Type
⚠ Process Availability: Main ✔ | Renderer ❌ | Utility ❌ | Exported ✔
Monitor power state changes.Process: Main
Static members
| Static member |
Description
|
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.
|
Full Usage:
powerMonitor.getSystemIdleState idleThreshold
Parameters:
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.
|
Full Usage:
powerMonitor.getSystemIdleTime ()
Returns: int
Modifiers: inline |
Idle time in secondsCalculate system idle time in seconds.
|
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.
|
Full Usage:
powerMonitor.offLockScreen handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the system is about to lock the screen.
|
Full Usage:
powerMonitor.offOnAc handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the system changes to AC power.
|
Full Usage:
powerMonitor.offOnBattery handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when system changes to battery power.
|
Full Usage:
powerMonitor.offResume handler
Parameters:
unit -> unit
Modifiers: inline |
Emitted when system is resuming.
|
Full Usage:
powerMonitor.offShutdown handler
Parameters:
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().
|
Full Usage:
powerMonitor.offSpeedLimitChange handler
Parameters:
Details -> unit
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.
|
Full Usage:
powerMonitor.offSuspend handler
Parameters:
unit -> unit
Modifiers: inline |
Emitted when the system is suspending.
|
Full Usage:
powerMonitor.offThermalStateChange handler
Parameters:
Details -> unit
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
|
Full Usage:
powerMonitor.offUnlockScreen handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted as soon as the systems screen is unlocked.
|
Full Usage:
powerMonitor.offUserDidBecomeActive handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a login session is activated. See documentation for more information.
|
Full Usage:
powerMonitor.offUserDidResignActive handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a login session is deactivated. See documentation for more information.
|
Full Usage:
powerMonitor.onBatteryPower
|
A boolean property. True if the system is on battery power.See powerMonitor.isOnBatteryPower(). |
Full Usage:
powerMonitor.onLockScreen handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the system is about to lock the screen.
|
Full Usage:
powerMonitor.onOnAc handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the system changes to AC power.
|
Full Usage:
powerMonitor.onOnBattery handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when system changes to battery power.
|
Full Usage:
powerMonitor.onResume handler
Parameters:
unit -> unit
Modifiers: inline |
Emitted when system is resuming.
|
Full Usage:
powerMonitor.onShutdown handler
Parameters:
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().
|
Full Usage:
powerMonitor.onSpeedLimitChange handler
Parameters:
Details -> unit
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.
|
Full Usage:
powerMonitor.onSuspend handler
Parameters:
unit -> unit
Modifiers: inline |
Emitted when the system is suspending.
|
Full Usage:
powerMonitor.onThermalStateChange handler
Parameters:
Details -> unit
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
|
Full Usage:
powerMonitor.onUnlockScreen handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted as soon as the systems screen is unlocked.
|
Full Usage:
powerMonitor.onUserDidBecomeActive handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a login session is activated. See documentation for more information.
|
Full Usage:
powerMonitor.onUserDidResignActive handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a login session is deactivated. See documentation for more information.
|
Full Usage:
powerMonitor.onceLockScreen handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the system is about to lock the screen.
|
Full Usage:
powerMonitor.onceOnAc handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when the system changes to AC power.
|
Full Usage:
powerMonitor.onceOnBattery handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when system changes to battery power.
|
Full Usage:
powerMonitor.onceResume handler
Parameters:
unit -> unit
Modifiers: inline |
Emitted when system is resuming.
|
Full Usage:
powerMonitor.onceShutdown handler
Parameters:
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().
|
Full Usage:
powerMonitor.onceSpeedLimitChange handler
Parameters:
Details -> unit
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.
|
Full Usage:
powerMonitor.onceSuspend handler
Parameters:
unit -> unit
Modifiers: inline |
Emitted when the system is suspending.
|
Full Usage:
powerMonitor.onceThermalStateChange handler
Parameters:
Details -> unit
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
|
Full Usage:
powerMonitor.onceUnlockScreen handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ✔ | MAC ✔ | LIN ❌ | MAS ❌ Emitted as soon as the systems screen is unlocked.
|
Full Usage:
powerMonitor.onceUserDidBecomeActive handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a login session is activated. See documentation for more information.
|
Full Usage:
powerMonitor.onceUserDidResignActive handler
Parameters:
unit -> unit
Modifiers: inline |
⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Emitted when a login session is deactivated. See documentation for more information.
|
fable-electron-docs-api