Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to run script when my mac is idle (for example after 5 minutes or screen saver start time is also ok) and when I resume it from idle state.

I know that I can write daemon using NSDistributedNotificationCenter and com.apple.screenIsLocked and com.apple.screenIsUnlocked, but I hope that there is already solution without creating new daemon.

I need this to for example turn on/off speed limit for Transmission (as it is sometimes hard to work when hashing/downloading on full speed).

share|improve this question
up vote 1 down vote accepted

Sleepwatcher -- See my answer to Automatically run a program when mac wakes from sleep

share|improve this answer
    
I see how you can script 'sleep' events, but not when your machine goes to idle / inactive. – brianegge May 31 '11 at 15:36
    
From Sleepwatcher's help text: -i or --idle execute idlecommand when no user interaction (keyboard, mouse) took place in the period given with the -t option. – JRobert May 31 '11 at 16:09

Look at the batch command:

man batch
share|improve this answer
    
Man page says about queueing at specific time or when load average drops below special value, nothing about idle/resume – tig May 12 '10 at 10:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .