Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.