Added automatic toggle for "Lid Action" when external display and power is connected to keep the laptop awake when lid is closed (known as Clamshell Mode).

This commit is contained in:
Carsten Braun
2023-07-19 11:54:51 +02:00
parent 2b8d82b58f
commit 595336288a
7 changed files with 158 additions and 0 deletions

View File

@@ -106,6 +106,7 @@ namespace GHelper
checkUSBC.Text = Properties.Strings.OptimizedUSBC;
checkAutoApplyWindowsPowerMode.Text = Properties.Strings.ApplyWindowsPowerPlan;
checkFnLock.Text = Properties.Strings.FnLock;
checkAutoToggleClamshellMode.Text = Properties.Strings.ToggleClamshellMode;
labelBacklightKeyboard.Text = Properties.Strings.Keyboard;
labelBacklightBar.Text = Properties.Strings.Lightbar;
@@ -210,6 +211,9 @@ namespace GHelper
}
}
checkAutoToggleClamshellMode.Checked = AppConfig.Is("toggle_clamshell_mode");
checkTopmost.Checked = AppConfig.Is("topmost");
checkTopmost.CheckedChanged += CheckTopmost_CheckedChanged; ;
@@ -466,5 +470,12 @@ namespace GHelper
{
AppConfig.Set("auto_apply_power_plan", checkAutoApplyWindowsPowerMode.Checked ? 1 : 0);
}
private void checkAutoToggleClamshellMode_CheckedChanged(object sender, EventArgs e)
{
AppConfig.Set("toggle_clamshell_mode", checkAutoToggleClamshellMode.Checked ? 1 : 0);
ClamshellModeControl ctrl = new ClamshellModeControl();
ctrl.ToggleLidAction();
}
}
}