Users can set a config option clamshell_default_lid_action to set their desired option when clamshell is not engaged.

This commit is contained in:
IceStormNG
2023-07-26 21:14:03 +02:00
parent ccb413b2e6
commit 254e6a8633

View File

@@ -62,7 +62,7 @@ namespace GHelper.Helpers
} }
public static void DisableClamshellMode() public static void DisableClamshellMode()
{ {
PowerNative.SetLidAction(1, true); PowerNative.SetLidAction(GetDefaultLidAction(), true);
Logger.WriteLine("Disengaging Clamshell Mode"); Logger.WriteLine("Disengaging Clamshell Mode");
} }
@@ -89,5 +89,15 @@ namespace GHelper.Helpers
if (IsClamshellEnabled()) if (IsClamshellEnabled())
ToggleLidAction(); ToggleLidAction();
} }
//Power users can change that setting.
//0 = Do nothing
//1 = Sleep (default)
//2 = Hibernate
//3 = Shutdown
private static int GetDefaultLidAction()
{
return AppConfig.Get("clamshell_default_lid_action", 1);
}
} }
} }