]> us-delaporte.pagekite.me Git - dotfiles.git/blobdiff - win/stay_awake.ps1
Notes on CLI setup
[dotfiles.git] / win / stay_awake.ps1
index 7d40cfed9c0135c2a2d0bd52e50195138e98d65a..40bc896ffc34dc5dae60371e6df9aca523620d9a 100644 (file)
@@ -1,9 +1,10 @@
+param($minutes=90)
 $wsh = New-Object -ComObject WScript.Shell
-$minutes = 15
 do{
-    $minutes-=1;
+       "Staying awake for $minutes minutes"
+  $minutes-=1;
   # Send Shift+F15
   $wsh.SendKeys('+{F15}')
   Start-Sleep -seconds 59
-}until($minutes < 0)
-# Thank you to http://www.zhornsoftware.co.uk/caffeine/
\ No newline at end of file
+}until($minutes -lt 0)
+# Thank you to http://www.zhornsoftware.co.uk/caffeine/