RunAppWhenIdle -- Run an application when you are not using your computer
I wrote With RunAppWhenIdle, you can either bind to an already running process on your system, or execute a new application. The application will be suspended (not killed!) while you are using your computer, and will resume when you are idle. InstallationDownload and run RunAppWhenIdle from the command prompt. You can specify either a process-id (pid) to bind, or a new program to execute. You can get a list of currently running processes if you run with no command line arguments. Command-line arguments explainedusage: RunAppWhenIdle.exe [-idle secs] [-pollIdle milisecs] [-pollUse milisecs] [-cpuLimit 0-100] [-pid procId [-resume] | /path/to/executable argument-list]
ExamplesExample: Binding to an already running applicationStart your application (firefox in this example) first. Make sure this is an application you wouldn't mind playing with at the moment. Then run RunAppWhenIdle with no arguments to get a list of currently running processes, so that we can get the process-id (pid) of the application. > ./RunAppWhenIdle.exe usage: RunAppWhenIdle.exe [-idle secs] [-pollIdle milisecs] [-pollUse milisecs] [-cpuLimit 0-100] [-pid procId [-resume] | /path/to/executable argument-list] Pid ExeFile 0 [System Process] 4 System 440 smss.exe ... 4148 firefox.exe 4988 RunAppWhenIdle.exe
Now let's bind to firefox. (I decreased the idle and polling times to see the effect without having to wait for long.). After you start RunAppWhenIdle, see how the counter is changing when you move the mouse. > ./RunAppWhenIdle.exe -idle 5 -pollIdle 300 -pollUse 300 -pid 4148 watching process with pid= 4148 suspending process... waiting for the computer to become idle... time remaining to idleness: 4.832 secs. The counter will go down as the time goes by. It will go back to 5.0 secs if you move your mouse or press a key on the keyboard. Note that the process (firefox) is suspended at the moment, and you would not be able to interact with it. Try going to your application (firefox); it will not respond, because it is kept sleeping while you are using your computer. time remaining to idleness: 0.273 secs. computer is idle now. resuming process... The process is resumed when the computer is idle. As soon as you move the mouse or press a key, the process is suspended again. suspending process... waiting for the computer to become idle... time remaining to idleness: 164 secs. computer is idle now. resuming process...
Press Example: Running a new application
You can also specify a new application to be executed by RunAppWhenIdle. Below example runs > ./RunAppWhenIdle.exe -idle 5 -pollIdle 300 -pollUse 300 sleep 10 waiting for the computer to become idle... time remaining to idleness: 0.140 secs. computer is idle now. running command [sleep "10"] started application with process id: 1904 watching process with pid= 1904 suspending process... waiting for the computer to become idle... time remaining to idleness: 0.149 secs. computer is idle now. resuming process... process with pid=1904 has finished running. ~~DISCUSSION~~ |