diff --git a/applications.json b/applications.json index e3a2d1e0..6204f96c 100644 --- a/applications.json +++ b/applications.json @@ -225,5 +225,43 @@ "Installzoom": { "winget": "Zoom.Zoom" } + }, + "Preset": { + "desktop": [ + "EssTweaksAH", + "EssTweaksDVR", + "EssTweaksHiber", + "EssTweaksHome", + "EssTweaksLoc", + "EssTweaksOO", + "EssTweaksRP", + "EssTweaksServices", + "EssTweaksStorage", + "EssTweaksTele", + "EssTweaksWifi", + "MiscTweaksPower", + "MiscTweaksNum" + ], + "laptop": [ + "EssTweaksAH", + "EssTweaksDVR", + "EssTweaksHome", + "EssTweaksLoc", + "EssTweaksOO", + "EssTweaksRP", + "EssTweaksServices", + "EssTweaksStorage", + "EssTweaksTele", + "EssTweaksWifi", + "MiscTweaksLapPower", + "MiscTweaksLapNum" + ], + "minimal": [ + "EssTweaksHome", + "EssTweaksOO", + "EssTweaksRP", + "EssTweaksServices", + "EssTweaksTele" + ] } } diff --git a/winutil-test.ps1 b/winutil-test.ps1 index f9b873d2..36175b15 100644 --- a/winutil-test.ps1 +++ b/winutil-test.ps1 @@ -137,48 +137,8 @@ $xaml.SelectNodes("//*[@Name]") | ForEach-Object {$global:sync["$("$($_.Name)")" Function Tweak-Buttons { Param ($button) - if ($button -eq "desktop"){ - $preset = @( - "EssTweaksAH" - "EssTweaksDVR" - "EssTweaksHiber" - "EssTweaksHome" - "EssTweaksLoc" - "EssTweaksOO" - "EssTweaksRP" - "EssTweaksServices" - "EssTweaksStorage" - "EssTweaksTele" - "EssTweaksWifi" - "MiscTweaksPower" - "MiscTweaksNum" - ) - } - if ($button -eq "laptop"){ - $preset = @( - "EssTweaksAH" - "EssTweaksDVR" - "EssTweaksHome" - "EssTweaksLoc" - "EssTweaksOO" - "EssTweaksRP" - "EssTweaksServices" - "EssTweaksStorage" - "EssTweaksTele" - "EssTweaksWifi" - "MiscTweaksLapPower" - "MiscTweaksLapNum" - ) - } - if ($button -eq "minimal"){ - $preset = @( - "EssTweaksHome" - "EssTweaksOO" - "EssTweaksRP" - "EssTweaksServices" - "EssTweaksTele" - ) - } + $preset = $global:sync["applications"].preset.$button + $global:sync.keys | Where-Object {$_ -like "*tweaks*" -and $_ -notlike "tweaksbutton"} | ForEach-Object { if ($preset -contains $_ ){$global:sync["$_"].IsChecked = $True} Else{$global:sync["$_"].IsChecked = $false}