]> us-delaporte.pagekite.me Git - dotfiles.git/commitdiff
stay awake
authorEdward Delaporte <edward@delaporte.us>
Fri, 29 Oct 2021 02:53:07 +0000 (03:53 +0100)
committerEdward Delaporte <edward@delaporte.us>
Fri, 29 Oct 2021 02:53:07 +0000 (03:53 +0100)
win/stay_awake.ps1 [new file with mode: 0644]

diff --git a/win/stay_awake.ps1 b/win/stay_awake.ps1
new file mode 100644 (file)
index 0000000..7d40cfe
--- /dev/null
@@ -0,0 +1,9 @@
+$wsh = New-Object -ComObject WScript.Shell
+$minutes = 15
+do{
+    $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