Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idle state #1

Open
bugii opened this issue Jan 10, 2022 · 2 comments
Open

Idle state #1

bugii opened this issue Jan 10, 2022 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@bugii
Copy link
Contributor

bugii commented Jan 10, 2022

The following electron API could be used to determine whether the user is even active. If not, write "Idle" in "activity" and "title" of the last entry.

https://www.electronjs.org/de/docs/latest/api/power-monitor#powermonitorgetsystemidlestateidlethreshold

For the Windows implementation, see here.

@casaout
Copy link
Member

casaout commented Jun 26, 2023

The following electron API could be used to determine whether the user is even active. If not, write "Idle" in "activity" and "title" of the last entry.

https://www.electronjs.org/de/docs/latest/api/power-monitor#powermonitorgetsystemidlestateidlethreshold

Note that a challenge with the above-mentioned approach is that the tracker is just TypeScript and currently has no ties to Electron. Since the powermonitor API is from Electron, it would lose that independence. (so far, our apps were always also using Electron, so it might not be a bad problem, especially, if we don't find a better solution)

@casaout
Copy link
Member

casaout commented Jun 26, 2023

Maybe there is also a simpler solution possible?

Like using a background thread that provides the number of seconds since the last activity from mouse or keyboard?
see, e.g., this simple code snippet or this Github project

Also, Chrome et al. might already support this natively through the Idle Detection API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants