The other way around: if the script sees increasing size of the ~/Downloadsdirectory, it disables suspend, until no activity was detected for more then five minutes. If there is no activity for more then five minutes (but you can set any other "wait" time), the script assumes no download is going in, and "normal" suspend is (re-) enabled. The script compares each check with the last one, to check for download activity (increase of size). In a loop (once per 20 seconds), the script checks the size of the targeted folder with the command: du -ks ~/Downloads ![]() ![]() You can set any other directory to be watched as download folder. Inspired by second comment, the script below does what you describe: assuming the downloads folder is the directory you download into, it disables suspend during download, and subsequently waits for five minutes (arbitrary to set) before re- enabling suspend, to make sure the download is really finished.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |