Compare commits

...

8 Commits

Author SHA1 Message Date
MyDrift
e27f0edeba
Merge 1678663f46 into 2ce4f54b80 2024-12-17 16:56:04 +01:00
ChrisTitusTech
2ce4f54b80 Deploying to main from @ ChrisTitusTech/winutil@a05556a896 🚀 2024-12-17 15:34:08 +00:00
MyDrift
1678663f46 added missing default states 2024-12-10 23:53:56 +01:00
MyDrift
295b5a4095 fix search defaultstate 2024-12-10 23:36:28 +01:00
MyDrift
faad84da46 remove helper console logs 2024-12-10 23:22:03 +01:00
MyDrift
a2c31008cf improve handling if entry does not exist
- add DefaultState property
- add handler for DefaultState in Get-WinUtilToggleStatus
2024-12-09 06:36:30 +01:00
MyDrift
6b1a914e9e add iseducationenvironment notice 2024-12-06 21:46:33 +01:00
MyDrift
4e96ca0c3c add WPFToggleRemoveRecommended
- add WPFToggleStartMenuRecommendations
- add reg entrys to modify for toggle
- add non working link bc devdocs are broken in general
2024-12-06 06:27:06 +01:00
3 changed files with 81 additions and 7 deletions

View File

@ -52,7 +52,7 @@ If you have Issues, refer to [Known Issues](https://christitustech.github.io/win
These are the sponsors that help keep this project alive with monthly contributions.
<!-- sponsors --><a href="https://github.com/TriHydera"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;39857764?u&#x3D;5dbda638f45530582eee1703b4473f2a5e229e28&amp;v&#x3D;4" width="60px" alt="User avatar: TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;3272468?u&#x3D;4391ed4655e4fd8b56e23b4169e44e2ac9b6cd97&amp;v&#x3D;4" width="60px" alt="User avatar: " /></a><a href="https://github.com/DelDongo"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;127976398?v&#x3D;4" width="60px" alt="User avatar: " /></a><a href="https://github.com/markamos"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;9561861?u&#x3D;3cca179dcff0413538591e57a3abea116d65ce56&amp;v&#x3D;4" width="60px" alt="User avatar: Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;54533224?u&#x3D;a49ea000a8f52adb31382ea69a1a7501b27fefdd&amp;v&#x3D;4" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;58894405?v&#x3D;4" width="60px" alt="User avatar: " /></a><a href="https://github.com/jdiegmueller"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;18660571?u&#x3D;601d0a23040a271c86b5d40339f899a6dbf27086&amp;v&#x3D;4" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;105566568?v&#x3D;4" width="60px" alt="User avatar: " /></a><a href="https://github.com/zepled112"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;65176625?v&#x3D;4" width="60px" alt="User avatar: wyatt" /></a><a href="https://github.com/altugtekiner"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;105917451?u&#x3D;ee73ff639c7bd9feb4708ab4ba7b14eff80196f7&amp;v&#x3D;4" width="60px" alt="User avatar: " /></a><a href="https://github.com/robertsandrock"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;12015331?u&#x3D;76849d3cb36b420922d235299558e00a09f2f8b4&amp;v&#x3D;4" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/mmomega"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;71956566?v&#x3D;4" width="60px" alt="User avatar: " /></a><a href="https://github.com/KenichiQaz"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;31177857?u&#x3D;efdbae734a4c60a7bb95df4659d0535e60a6fd57&amp;v&#x3D;4" width="60px" alt="User avatar: Stefan" /></a><a href="https://github.com/paulsheets"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;45240946?u&#x3D;d4db66f8e8d7a2606fe7a5521daf48ca9f097105&amp;v&#x3D;4" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;4107092?v&#x3D;4" width="60px" alt="User avatar: Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;19240897?u&#x3D;f82b4be098cac65c8421421b70ebd2d1da85c67e&amp;v&#x3D;4" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/claudemods"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;73653396?u&#x3D;d64c656fb8db24ef56bb000197532df9b618d06c&amp;v&#x3D;4" width="60px" alt="User avatar: Claudemods" /></a><a href="https://github.com/FatBastard0"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;173957728?v&#x3D;4" width="60px" alt="User avatar: " /></a><a href="https://github.com/Ascent7910"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;118260621?v&#x3D;4" width="60px" alt="User avatar: Max" /></a><a href="https://github.com/DursleyGuy"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;140165544?v&#x3D;4" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/YamiSandman616"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;183505690?u&#x3D;c3bd20157058b6215e28f7568d4f8c4fbbe92838&amp;v&#x3D;4" width="60px" alt="User avatar: Sandman616" /></a><a href="https://github.com/realmuddy"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;30978236?v&#x3D;4" width="60px" alt="User avatar: Phillip Waters" /></a><a href="https://github.com/quaszi"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;51266738?u&#x3D;2e3185214607e51239c5969c866ddd5eb1bdee48&amp;v&#x3D;4" width="60px" alt="User avatar: " /></a><a href="https://github.com/Psyhackological"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;47569716?u&#x3D;66dc5e86731eaf8c6bc78a1bff34420ed2e5402b&amp;v&#x3D;4" width="60px" alt="User avatar: Konrad Konieczny" /></a><!-- sponsors -->
<!-- sponsors --><a href="https://github.com/TriHydera"><img src="https:&#x2F;&#x2F;github.com&#x2F;TriHydera.png" width="60px" alt="User avatar: TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https:&#x2F;&#x2F;github.com&#x2F;jozozovko.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DelDongo"><img src="https:&#x2F;&#x2F;github.com&#x2F;DelDongo.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/markamos"><img src="https:&#x2F;&#x2F;github.com&#x2F;markamos.png" width="60px" alt="User avatar: Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https:&#x2F;&#x2F;github.com&#x2F;dwelfusius.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https:&#x2F;&#x2F;github.com&#x2F;mews-se.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/jdiegmueller"><img src="https:&#x2F;&#x2F;github.com&#x2F;jdiegmueller.png" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https:&#x2F;&#x2F;github.com&#x2F;AlanTristar.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/zepled112"><img src="https:&#x2F;&#x2F;github.com&#x2F;zepled112.png" width="60px" alt="User avatar: wyatt" /></a><a href="https://github.com/altugtekiner"><img src="https:&#x2F;&#x2F;github.com&#x2F;altugtekiner.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/robertsandrock"><img src="https:&#x2F;&#x2F;github.com&#x2F;robertsandrock.png" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/mmomega"><img src="https:&#x2F;&#x2F;github.com&#x2F;mmomega.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/KenichiQaz"><img src="https:&#x2F;&#x2F;github.com&#x2F;KenichiQaz.png" width="60px" alt="User avatar: Stefan" /></a><a href="https://github.com/paulsheets"><img src="https:&#x2F;&#x2F;github.com&#x2F;paulsheets.png" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https:&#x2F;&#x2F;github.com&#x2F;djones369.png" width="60px" alt="User avatar: Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https:&#x2F;&#x2F;github.com&#x2F;anthonymendez.png" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/claudemods"><img src="https:&#x2F;&#x2F;github.com&#x2F;claudemods.png" width="60px" alt="User avatar: Claudemods" /></a><a href="https://github.com/FatBastard0"><img src="https:&#x2F;&#x2F;github.com&#x2F;FatBastard0.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/Ascent7910"><img src="https:&#x2F;&#x2F;github.com&#x2F;Ascent7910.png" width="60px" alt="User avatar: Max" /></a><a href="https://github.com/DursleyGuy"><img src="https:&#x2F;&#x2F;github.com&#x2F;DursleyGuy.png" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/YamiSandman616"><img src="https:&#x2F;&#x2F;github.com&#x2F;YamiSandman616.png" width="60px" alt="User avatar: Sandman616" /></a><a href="https://github.com/realmuddy"><img src="https:&#x2F;&#x2F;github.com&#x2F;realmuddy.png" width="60px" alt="User avatar: Phillip Waters" /></a><a href="https://github.com/quaszi"><img src="https:&#x2F;&#x2F;github.com&#x2F;quaszi.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/Psyhackological"><img src="https:&#x2F;&#x2F;github.com&#x2F;Psyhackological.png" width="60px" alt="User avatar: Konrad Konieczny" /></a><!-- sponsors -->
## 🏅 Thanks to all Contributors
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.

View File

@ -3301,6 +3301,7 @@
"Name": "AppsUseLightTheme",
"Value": "0",
"OriginalValue": "1",
"DefaultState": "false",
"Type": "DWord"
},
{
@ -3308,6 +3309,7 @@
"Name": "SystemUsesLightTheme",
"Value": "0",
"OriginalValue": "1",
"DefaultState": "false",
"Type": "DWord"
}
],
@ -3342,6 +3344,7 @@
"Name": "BingSearchEnabled",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "true",
"Type": "DWord"
}
],
@ -3360,6 +3363,7 @@
"Name": "InitialKeyboardIndicators",
"Value": "2",
"OriginalValue": "0",
"DefaultState": "false",
"Type": "DWord"
},
{
@ -3367,6 +3371,7 @@
"Name": "InitialKeyboardIndicators",
"Value": "2",
"OriginalValue": "0",
"DefaultState": "false",
"Type": "DWord"
}
],
@ -3385,17 +3390,53 @@
"Name": "VerboseStatus",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "false",
"Type": "DWord"
}
],
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/VerboseLogon"
},
"WPFToggleStartMenuRecommendations": {
"Content": "Recommendations in Start Menu",
"Description": "If disabled then you will not see recommendations in the Start Menu. | Enables 'iseducationenvironment' | Relogin Required.",
"category": "Customize Preferences",
"panel": "2",
"Order": "a104_",
"Type": "Toggle",
"registry": [
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\current\\device\\Start",
"Name": "HideRecommendedSection",
"Value": "0",
"OriginalValue": "1",
"DefaultState": "true",
"Type": "DWord"
},
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\current\\device\\Education",
"Name": "IsEducationEnvironment",
"Value": "0",
"OriginalValue": "1",
"DefaultState": "true",
"Type": "DWord"
},
{
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer",
"Name": "HideRecommendedSection",
"Value": "0",
"OriginalValue": "1",
"DefaultState": "true",
"Type": "DWord"
}
],
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/WPFToggleStartMenuRecommendations"
},
"WPFToggleSnapWindow": {
"Content": "Snap Window",
"Description": "If enabled you can align windows by dragging them. | Relogin Required",
"category": "Customize Preferences",
"panel": "2",
"Order": "a104_",
"Order": "a105_",
"Type": "Toggle",
"registry": [
{
@ -3403,6 +3444,7 @@
"Name": "WindowArrangementActive",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "true",
"Type": "String"
}
],
@ -3413,7 +3455,7 @@
"Description": "If enabled then Snap preview is disabled when maximize button is hovered.",
"category": "Customize Preferences",
"panel": "2",
"Order": "a105_",
"Order": "a106_",
"Type": "Toggle",
"registry": [
{
@ -3421,6 +3463,7 @@
"Name": "EnableSnapAssistFlyout",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "true",
"Type": "DWord"
}
],
@ -3441,7 +3484,7 @@
"Description": "If enabled then you will get suggestions to snap other applications in the left over spaces.",
"category": "Customize Preferences",
"panel": "2",
"Order": "a106_",
"Order": "a107_",
"Type": "Toggle",
"registry": [
{
@ -3449,6 +3492,7 @@
"Name": "SnapAssist",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "true",
"Type": "DWord"
}
],
@ -3469,7 +3513,7 @@
"Description": "If Enabled then Cursor movement is affected by the speed of your physical mouse movements.",
"category": "Customize Preferences",
"panel": "2",
"Order": "a107_",
"Order": "a108_",
"Type": "Toggle",
"registry": [
{
@ -3477,6 +3521,7 @@
"Name": "MouseSpeed",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "true",
"Type": "DWord"
},
{
@ -3484,6 +3529,7 @@
"Name": "MouseThreshold1",
"Value": "6",
"OriginalValue": "0",
"DefaultState": "true",
"Type": "DWord"
},
{
@ -3491,6 +3537,7 @@
"Name": "MouseThreshold2",
"Value": "10",
"OriginalValue": "0",
"DefaultState": "true",
"Type": "DWord"
}
],
@ -3501,7 +3548,7 @@
"Description": "If Enabled then Sticky Keys is activated - Sticky keys is an accessibility feature of some graphical user interfaces which assists users who have physical disabilities or help users reduce repetitive strain injury.",
"category": "Customize Preferences",
"panel": "2",
"Order": "a108_",
"Order": "a109_",
"Type": "Toggle",
"registry": [
{
@ -3509,6 +3556,7 @@
"Name": "Flags",
"Value": "510",
"OriginalValue": "58",
"DefaultState": "true",
"Type": "DWord"
}
],
@ -3527,6 +3575,7 @@
"Name": "Hidden",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "false",
"Type": "DWord"
}
],
@ -3555,6 +3604,7 @@
"Name": "HideFileExt",
"Value": "0",
"OriginalValue": "1",
"DefaultState": "false",
"Type": "DWord"
}
],
@ -3583,6 +3633,7 @@
"Name": "SearchboxTaskbarMode",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "true",
"Type": "DWord"
}
],
@ -3601,6 +3652,7 @@
"Name": "ShowTaskViewButton",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "true",
"Type": "DWord"
}
],
@ -3619,6 +3671,7 @@
"Name": "TaskbarDa",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "true",
"Type": "DWord"
}
],
@ -3637,6 +3690,7 @@
"Name": "TaskbarAl",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "true",
"Type": "DWord"
}
],
@ -3655,6 +3709,7 @@
"Name": "DisplayParameters",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "false",
"Type": "DWord"
},
{
@ -3662,6 +3717,7 @@
"Name": "DisableEmoticon",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "false",
"Type": "DWord"
}
],

View File

@ -35,6 +35,9 @@ Function Get-WinUtilToggleStatus {
foreach ($regentry in $ToggleSwitchReg) {
try {
if (!(Test-Path $regentry.Path)) {
New-Item -Path $regentry.Path -Force | Out-Null
}
$regstate = (Get-ItemProperty -path $regentry.Path).$($regentry.Name)
if ($regstate -eq $regentry.Value) {
$count += 1
@ -42,8 +45,23 @@ Function Get-WinUtilToggleStatus {
} else {
Write-Debug "$($regentry.Name) is false (state: $regstate, value: $($regentry.Value), original: $($regentry.OriginalValue))"
}
if (!$regstate) {
switch ($regentry.DefaultState) {
"true" {
$regstate = $regentry.Value
$count += 1
}
"false" {
$regstate = $regentry.OriginalValue
}
default {
Write-Error "Entry for $($regentry.Name) does not exist and no DefaultState is defined."
$regstate = $regentry.OriginalValue
}
}
}
} catch {
Write-Error "An error occurred while accessing registry entry $($regentry.Path): $_"
Write-Error "An unexpected error occurred: $_"
}
}