Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

Add functions to change what happens when a laptop lid is closed #337

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Default.preset
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ EnableNTFSLongPaths # DisableNTFSLongPaths
# EnableHibernation # DisableHibernation
# DisableSleepButton # EnableSleepButton
# DisableSleepTimeout # EnableSleepTimeout
# SetLidActionNone # SetLidActionSleep # SetLidActionHibernate # SetLidActionShutDown
# DisableFastStartup # EnableFastStartup
# DisableAutoRebootOnCrash # EnableAutoRebootOnCrash

Expand Down
24 changes: 24 additions & 0 deletions Win10.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down