How to find the number of seconds since the keyboard was last used?

I would like a shell script or some guidance into creating one. I don’t mind using C or Python, although I have more experience with C than with Python. I tried with Node.js but I don’t have the required APIs.

Relevant things I found on the Internet:

  1. xprintidle/xprintidle.c at master · g0hl1n/xprintidle · GitHub
  2. GitHub - JackChenLucky/idlerun: Node.js Native Addon to report system Idle time based on Keyboard
  3. How long was the keyboard idle?

Any help would be great!

Maybe some keyloggers have this function :thinking:

Alternatively, you can write script which calculate this from keylogger’s logs.

Two tools that may be helpful with it: logkeys, xinput, xev

1 Like

@Tomek logkeys did the job for me! Thank you!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.