diff --git a/Default.preset b/Default.preset index d73b0db2..d4a4f597 100644 --- a/Default.preset +++ b/Default.preset @@ -116,6 +116,7 @@ EnableNTFSLongPaths # DisableNTFSLongPaths # EnableHibernation # DisableHibernation # DisableSleepButton # EnableSleepButton # DisableSleepTimeout # EnableSleepTimeout +# SetLidActionNone # SetLidActionSleep # SetLidActionHibernate # SetLidActionShutDown # DisableFastStartup # EnableFastStartup # DisableAutoRebootOnCrash # EnableAutoRebootOnCrash diff --git a/Win10.psm1 b/Win10.psm1 index f6d71ecb..f50b8d76 100644 --- a/Win10.psm1 +++ b/Win10.psm1 @@ -1765,6 +1765,30 @@ Function EnableSleepTimeout { powercfg /X standby-timeout-dc 15 } +# Set lid closing action to Do Nothing +Function SetLidActionNone { + Write-Output "Setting lid closing action to Do Nothing..." + powercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_BUTTONS LIDACTION 0 +} + +# Set lid closing action to Sleep +Function SetLidActionSleep { + Write-Output "Setting lid closing action to Sleep..." + powercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_BUTTONS LIDACTION 1 +} + +# Set lid closing action to Hibernate +Function SetLidActionHibernate { + Write-Output "Setting lid closing action to Hibernate..." + powercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_BUTTONS LIDACTION 2 +} + +# Set lid closing action to Shut Down +Function SetLidActionShutDown { + Write-Output "Setting lid closing action to Shut Down..." + powercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_BUTTONS LIDACTION 3 +} + # Disable Fast Startup Function DisableFastStartup { Write-Output "Disabling Fast Startup..."