Jamie's Blog

Ruby developer. CTO. Swimmer. Always trying to write more


I’ve been stressing my poor little laptop pretty hard these days. I’ve written some python scripts that produce over 36,400 different datasets (72,800 files) but altogether they take about 15-20mins to produce. And, it’s going to take much longer to run the algorithm over each dataset, produce the results and collate them together. Ideally, I’d prefer not to have to sit watching the screen and waiting for the scripts to finish. Either I’d like the laptop to make a noise to alert me or shutdown/hibernate for the rest of the night. This is where being a semi-decent programmer comes in: I just wrote a C# application that monitors the processor usage and performs an action if the average processor usage falls below a certain threshold. I call it “Sigh”.

Basically, you start your long-running task (e.g., my python script or the laptop backup). Watch the Processor usage and set the trigger to a reasonable level that your computer reaches when nothing is running (typically <5-10% utilisation). Set the delay (this is the amount of time that the processor usage must remain under the threshold before the action is performed). Once trigger, Sigh can Beep (play the system beep sound), play a WAV file of your choosing, execute a .exe or .bat file with arguments, or Hibernate/Shutdown the computer. Before shutting down or hibernating, Sigh will give a 20-30 secs countdown during which the action can be aborted. Click Start, and the trigger become live. Click Start again to stop the monitoring. That’s it!

Here’s a brief look at it:

It was inspired by UnpowerIt!, the only other utility I found that did something similar but it a) looked ugly, b) did too much (like integrate with WimAmp and sync network times) and c) couldn’t run arbitary .exes or play sounds.