From 70533a3998f318f7e157c3baca573c16a6cac252 Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Sun, 31 Mar 2024 17:07:59 +0000 Subject: [PATCH] Compile Winutil --- winutil.ps1 | 56 +++++++++++++++++++++++++++++++++++++++++++ xaml/inputTweaks.xaml | 4 ++++ 2 files changed, 60 insertions(+) diff --git a/winutil.ps1 b/winutil.ps1 index c884492d..09c35693 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -575,6 +575,15 @@ Function Get-WinUtilToggleStatus { return $true } } + if ($ToggleSwitch -eq "WPFToggleTaskbarWidgets") { + $TaskbarWidgets = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskBarDa + if($TaskbarWidgets -eq 0) { + return $false + } + else{ + return $true + } + } } function Get-WinUtilVariables { @@ -1929,6 +1938,40 @@ Function Invoke-WinUtilStickyKeys { Write-Warning $psitem.Exception.StackTrace } } +function Invoke-WinUtilTaskbarWidgets { + <# + + .SYNOPSIS + Enable/Disable Taskbar Widgets + + .PARAMETER Enabled + Indicates whether to enable or disable Taskbar Widgets + + #> + Param($Enabled) + Try{ + if ($Enabled -eq $false){ + Write-Host "Enabling Taskbar Widgets" + $value = 1 + } + else { + Write-Host "Disabling Taskbar Widgets" + $value = 0 + } + $Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" + Set-ItemProperty -Path $Path -Name TaskbarDa -Value $value + } + Catch [System.Security.SecurityException] { + Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception" + } + Catch [System.Management.Automation.ItemNotFoundException] { + Write-Warning $psitem.Exception.ErrorRecord + } + Catch{ + Write-Warning "Unable to set $Name due to unhandled exception" + Write-Warning $psitem.Exception.StackTrace + } +} function Invoke-WinUtilTweaks { <# @@ -4320,6 +4363,7 @@ function Invoke-WPFToggle { "WPFToggleSnapFlyout" {Invoke-WinUtilSnapFlyout $(Get-WinUtilToggleStatus WPFToggleSnapFlyout)} "WPFToggleMouseAcceleration" {Invoke-WinUtilMouseAcceleration $(Get-WinUtilToggleStatus WPFToggleMouseAcceleration)} "WPFToggleStickyKeys" {Invoke-WinUtilStickyKeys $(Get-WinUtilToggleStatus WPFToggleStickyKeys)} + "WPFToggleTaskbarWidgets" {Invoke-WinUtilTaskbarWidgets $(Get-WinUtilToggleStatus WPFToggleTaskbarWidgets)} } } function Invoke-WPFtweaksbutton { @@ -10182,6 +10226,14 @@ $sync.configs.tweaks = '{ "Order": "a067_", "Type": "Toggle" }, + "WPFToggleTaskbarWidgets": { + "Content": "Taskbar Widgets", + "Description": "If Enabled then Widgets Icon in Taskbar will be shown.", + "category": "Customize Preferences", + "panel": "2", + "Order": "a068_", + "Type": "Toggle" + }, "WPFchangedns": { "Content": "DNS", "category": "z__Advanced Tweaks - CAUTION", @@ -11929,6 +11981,10 @@ $inputXML = ' + +