11

I'm searching for the possibility to execute a shell script or command based on idle time in the bash shell.

As an example, if I'm in a SSH session to a server of mine and after X minutes of inactivity in the terminal, I want a command to start a desired program like cmatrix, and when I come back and press a key I will get back where I left.

slm
  • 3,185
  • You can check the load on cpu using top – totti May 07 '13 at 09:48
  • Why not run your cmatrix or whatever all the time, but with a nice --adjustment=17 low scheduling priority? See man nice. Then, when you do something interactive, it will have a normal (0) scheduling priority and take over. – waltinator Aug 24 '15 at 03:36

1 Answers1

9

Apparently GNU screen has screensaver capabilities similar to what you're asking, if you put this in your .screenrc:

blankerprg cmatrix -ab -u2
idle 60 blanker
Paul
  • 7,224