Amphetamine: End session when download is complete
I'm a pretty surprised this was not already implemented.
I would like to have a function, that Amphetamine will end session when download is complete. This is kind of tricky, because every browser handles downloads a bit differently.
But one universal solution should be, to let user to select a file that he is currently downloading. Amphetamine will watch that file. If the file size stops increasing for minute or two, download has finished, and computer can sleep.
Amphetamine 4 includes an option to keep your Mac awake while a file is downloading.
Dusan Hlavaty commented
I think monitoring network traffic is far more less reliable. You have a lot of software that communicate via network these days. Updates, notifications, ...
Monitoring of file size is IMHO quite reliable, but not 100% of course. If an end user can edit it's own settings - like if this file doesn't change for X minutes, that it means that download was (very probably :-) finnished. If you use some sort of download manager (wget, curl, or even any "clever" browser plugin) that will handle download fails, slow downs or interrupted connections. I don't think it should be resposibility of Amphetamine to do this.
File-size monitoring is a low-hanging-fruit that can solve a lot of problems with monitoring downloads. It is simple to implement, and quite reliable. More advanced network monitoring can be implemented as a next step. Network monitoring is probably good solution for monitoring uploads.
Christophe Soudron commented
I think there's a more simple solution : monitor network traffic (what a lot of apps are doing to display upload/download traffic : Bandwidth+, iStats Mini, etc.).
Then, allow the user to create a new kind of trigger (a network trigger), allowing him to specify a bandwith treshold (because even if you're not downloading something, there might be a little traffic in the background).
For example : I know my internet connection let me download à 1,3 MByte/s, so I create a trigger with a treshold of, let's say, 50 Ko/s, to be safe.
This way, I have a generic trigger that works for any app and any file.
As long as the traffic monitoring system detects something above my treshold, Amphetamine keeps my mac awake. If it's below, it can sleeps.
It would also be interesting to have 2 separate triggers : one for download and an other one for upload (to have 2 separates tresholds).