Update samy.functions.ps1
This commit is contained in:
@@ -150,16 +150,37 @@ function Initialize-NuGetProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# If nothing selected, you decide the default.
|
# If user checked the master box but no suboptions were chosen, pick a sensible default
|
||||||
# I usually default to "all", since the master checkbox implies intent.
|
|
||||||
if ($selected.Count -eq 0) {
|
if ($selected.Count -eq 0) {
|
||||||
$selected = @('window','taskbar','menus')
|
$selected = @('window','taskbar','menus')
|
||||||
}
|
}
|
||||||
|
|
||||||
# If you already have a single function that disables everything:
|
# --- Window animations (min/max) ---
|
||||||
# you can just call it when any suboption is selected.
|
if ($selected -contains 'window') {
|
||||||
# OR implement per-suboption logic if you want true granularity.
|
$k = "HKCU:\Control Panel\Desktop\WindowMetrics"
|
||||||
Disable-Animations
|
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
|
Write-LogHybrid "Disable Animations applied. Selected: $($selected -join ', ')" Success Tweaks -LogToEvent
|
||||||
Send-Text $Context "Disable Animations applied: $($selected -join ', ')"
|
Send-Text $Context "Disable Animations applied: $($selected -join ', ')"
|
||||||
|
|||||||
Reference in New Issue
Block a user