Use the chrome.idle API to detect when the machine's idle state changes.
Use the chrome.idle API to detect when the machine's idle state changes. * available since Chrome 36 * https://developer.chrome.com/apps/idle
(get-auto-lock-delay)
Gets the time, in seconds, it takes until the screen is locked automatically while idle. Returns a zero duration if the screen is never locked automatically. Currently supported on Chrome OS only.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [delay] where:
|delay| - Time, in seconds, until the screen is locked automatically while idle. This is zero if the screen never locks automatically.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/apps/idle#method-getAutoLockDelay.
Gets the time, in seconds, it takes until the screen is locked automatically while idle. Returns a zero duration if the screen is never locked automatically. Currently supported on Chrome OS only. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [delay] where: |delay| - Time, in seconds, until the screen is locked automatically while idle. This is zero if the screen never locks automatically. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/idle#method-getAutoLockDelay.
(query-state detection-interval-in-seconds)
Returns 'locked' if the system is locked, 'idle' if the user has not generated any input for a specified number of seconds, or 'active' otherwise.
|detection-interval-in-seconds| - The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [new-state] where:
|new-state| - https://developer.chrome.com/apps/idle#property-callback-newState.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Returns 'locked' if the system is locked, 'idle' if the user has not generated any input for a specified number of seconds, or 'active' otherwise. |detection-interval-in-seconds| - The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [new-state] where: |new-state| - https://developer.chrome.com/apps/idle#property-callback-newState. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/idle#method-queryState.
(set-detection-interval interval-in-seconds)
Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds.
|interval-in-seconds| - Threshold, in seconds, used to determine when the system is in an idle state.
https://developer.chrome.com/apps/idle#method-setDetectionInterval.
Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds. |interval-in-seconds| - Threshold, in seconds, used to determine when the system is in an idle state. https://developer.chrome.com/apps/idle#method-setDetectionInterval.
(tap-all-events chan)
Taps all valid non-deprecated events in chromex.app.idle namespace.
Taps all valid non-deprecated events in chromex.app.idle namespace.
(tap-on-state-changed-events channel & args)
Fired when the system changes to an active, idle or locked state. The event fires with 'locked' if the screen is locked or the screensaver activates, 'idle' if the system is unlocked and the user has not generated any input for a specified number of seconds, and 'active' when the user generates input on an idle system.
Events will be put on the |channel| with signature [::on-state-changed [new-state]] where:
|new-state| - https://developer.chrome.com/apps/idle#property-onStateChanged-newState.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/apps/idle#event-onStateChanged.
Fired when the system changes to an active, idle or locked state. The event fires with 'locked' if the screen is locked or the screensaver activates, 'idle' if the system is unlocked and the user has not generated any input for a specified number of seconds, and 'active' when the user generates input on an idle system. Events will be put on the |channel| with signature [::on-state-changed [new-state]] where: |new-state| - https://developer.chrome.com/apps/idle#property-onStateChanged-newState. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/idle#event-onStateChanged.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close