How run script after certain idle time?
I want a script to be run every time I'm idle for 10 minutes.
I want a script to be run when I become active again.
I want it to work whether I'm in the console or in X (although if I had to choose, the idle time would have to be based on X activity).
I tried to make xscreensaver run a script, but without success, first it gave me the error "test: missing argument", and lateron, I got "test: -window-id: binary operator expected", but I'd like my screen not to go blank at all, so the xscreensaver wouldn't work in this case.
The command "w" gives the idle time of shell logins, but doesn't count X idle time.
The idea originally was to set server-bandwidth to max if idle, and back to minimal when I become active again, but I'm going to try and solve that with traffic shaping techniques.
I'd like to use the idle time for cleanup scripts, backup scripts and other useful tasks.
Anyone know how to achieve this?