# Stay awake to allow large transfers to complete
# without permanently giving up battery saving features
-function Invoke-StayAwake() {
+function Invoke-StayAwakeWindows() {
param($minutes=90)
$wsh = New-Object -ComObject WScript.Shell
do{
# Thank you to http://www.zhornsoftware.co.uk/caffeine/
}
-Export-ModuleMember -Function Invoke-StayAwake
\ No newline at end of file
+Export-ModuleMember -Function Invoke-StayAwake
+Export-ModuleMember -Function Invoke-StayAwakeWindows
+
+function Invoke-StayAwake() {
+ param($minutes=90)
+ do{
+ "Staying awake for $minutes minutes"
+ systemd-inhibit sleep 60
+ $minutes-=1;
+ }until($minutes -lt 0)
+}
+
+++ /dev/null
-param($minutes=90)
-$wsh = New-Object -ComObject WScript.Shell
-do{
- "Staying awake for $minutes minutes"
- $minutes-=1;
- # Send Shift+F15
- $wsh.SendKeys('+{F15}')
- Start-Sleep -seconds 59
-}until($minutes -lt 0)
-# Thank you to http://www.zhornsoftware.co.uk/caffeine/