Idle state
bugii opened this issue · comments
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.
For the Windows implementation, see here.
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.
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)
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