From ab4d1124dc94cb0a868c5a7a548858139abf2265 Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sun, 21 Dec 2025 20:00:28 -0500 Subject: [PATCH] Update samy.functions.ps1 --- samy.functions.ps1 | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/samy.functions.ps1 b/samy.functions.ps1 index e8ff7f1..3d52fd7 100644 --- a/samy.functions.ps1 +++ b/samy.functions.ps1 @@ -150,16 +150,37 @@ function Initialize-NuGetProvider { } } - # If nothing selected, you decide the default. - # I usually default to "all", since the master checkbox implies intent. + # If user checked the master box but no suboptions were chosen, pick a sensible default if ($selected.Count -eq 0) { $selected = @('window','taskbar','menus') } - # If you already have a single function that disables everything: - # you can just call it when any suboption is selected. - # OR implement per-suboption logic if you want true granularity. - Disable-Animations + # --- Window animations (min/max) --- + if ($selected -contains 'window') { + $k = "HKCU:\Control Panel\Desktop\WindowMetrics" + New-Item -Path $k -Force | Out-Null + Set-ItemProperty -Path $k -Name "MinAnimate" -Value "0" -Type String + } + + # --- Taskbar animations --- + if ($selected -contains 'taskbar') { + $k = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" + New-Item -Path $k -Force | Out-Null + New-ItemProperty -Path $k -Name "TaskbarAnimations" -PropertyType DWord -Value 0 -Force | Out-Null + } + + # --- Menus feel instant (lower delay) --- + if ($selected -contains 'menus') { + $k = "HKCU:\Control Panel\Desktop" + New-Item -Path $k -Force | Out-Null + Set-ItemProperty -Path $k -Name "MenuShowDelay" -Value "50" -Type String + } + + # Explorer restart helps taskbar changes apply faster + if ($selected -contains 'taskbar') { + Stop-Process -Name explorer -Force -ErrorAction SilentlyContinue + Start-Process explorer.exe + } Write-LogHybrid "Disable Animations applied. Selected: $($selected -join ', ')" Success Tweaks -LogToEvent Send-Text $Context "Disable Animations applied: $($selected -join ', ')"