I want to change the 'Close lid to sleep' setting such that:
- Whenever my laptop is connected to the dock or monitor, closing lid does nothing
- When I disconnect it from dock/monitor, closing lid puts laptop to sleep.
I want a solution such that it happens automatically when (dis)connecting the dock/monitor without any manual seting change required.
Is there any way to achieve this?Or any powershell scripts to detect dock/monitor & then execute a command to change 'Close lid' setting.
Edit: powercfg /setacvalueindex scheme_current sub_buttons lidaction 0
does the close lid setting, how to trigger this when connected/disconnected to dock?
I have a Windows 10 laptop and a thinkpad dock.