determining if system is active or inactive
For example, when a system transitions to sleep state, the system should determine if system is active or inactive.
I'm thinking of how to determine it as user activity, filesystem activity, and network activity.
I will exclude the keyboard activity.
So I'm wondering how to determine it generally in Linux (excluding keyboard activity).
Any idea or any related site?
Thanks in advance.