From 2c1031865f0811683ad2fdc827309c1c321c720a Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Sun, 14 Jul 2024 18:50:40 -0500 Subject: [PATCH 01/30] Sponsors Easter Egg --- functions/private/Invoke-WinUtilSponsors.ps1 | 45 ++++++++++++++++++++ functions/private/Show-CustomDialog.ps1 | 23 +++++++--- scripts/main.ps1 | 27 ++++++++++++ xaml/inputXML.xaml | 1 + 4 files changed, 90 insertions(+), 6 deletions(-) create mode 100644 functions/private/Invoke-WinUtilSponsors.ps1 diff --git a/functions/private/Invoke-WinUtilSponsors.ps1 b/functions/private/Invoke-WinUtilSponsors.ps1 new file mode 100644 index 00000000..cf75dc27 --- /dev/null +++ b/functions/private/Invoke-WinUtilSponsors.ps1 @@ -0,0 +1,45 @@ +Function Invoke-WinUtilSponsors { + <# + .SYNOPSIS + Lists Sponsors from ChrisTitusTech + .DESCRIPTION + Lists Sponsors from ChrisTitusTech + .EXAMPLE + Invoke-WinUtilSponsors + .NOTES + This function is used to list sponsors from ChrisTitusTech + #> + try { + # Define the URL and headers + $url = "https://github.com/sponsors/ChrisTitusTech" + $headers = @{ + "User-Agent" = "Chrome/58.0.3029.110" + } + + # Fetch the webpage content + try { + $html = Invoke-RestMethod -Uri $url -Headers $headers + } catch { + Write-Output $_.Exception.Message + exit + } + + # Use regex to extract the content between "Current sponsors" and "Past sponsors" + $currentSponsorsPattern = '(?s)(?<=Current sponsors).*?(?=Past sponsors)' + $currentSponsorsHtml = [regex]::Match($html, $currentSponsorsPattern).Value + + # Use regex to extract the sponsor usernames from the alt attributes in the "Current Sponsors" section + $sponsorPattern = '(?<=alt="@)[^"]+' + $sponsors = [regex]::Matches($currentSponsorsHtml, $sponsorPattern) | ForEach-Object { $_.Value } + + # Exclude "ChrisTitusTech" from the sponsors + $sponsors = $sponsors | Where-Object { $_ -ne "ChrisTitusTech" } + + # Return the sponsors + return $sponsors + } + catch { + Write-Error "An error occurred while fetching or processing the sponsors: $_" + return $null + } +} \ No newline at end of file diff --git a/functions/private/Show-CustomDialog.ps1 b/functions/private/Show-CustomDialog.ps1 index dc6eb0de..236a3d62 100644 --- a/functions/private/Show-CustomDialog.ps1 +++ b/functions/private/Show-CustomDialog.ps1 @@ -24,6 +24,9 @@ function Show-CustomDialog { .PARAMETER IconSize The Size to use for Icon inside the custom dialog window. + .PARAMETER EnableScroll + A flag indicating whether to enable scrolling if the content exceeds the window size. + .EXAMPLE Show-CustomDialog -Message "This is a custom dialog with a message and an image above." -Width 300 -Height 200 @@ -34,7 +37,8 @@ function Show-CustomDialog { [int]$Height = 200, [int]$FontSize = 10, [int]$HeaderFontSize = 14, - [int]$IconSize = 25 + [int]$IconSize = 25, + [bool]$EnableScroll = $false ) Add-Type -AssemblyName PresentationFramework @@ -246,11 +250,18 @@ $cttLogoPath = @" $messageTextBlock.Inlines.Add((New-Object Windows.Documents.Run($Message))) } - - # Add the TextBlock to the Grid - $grid.Children.Add($messageTextBlock) - [Windows.Controls.Grid]::SetRow($messageTextBlock, 1) # Set the row to the second row (0-based index) - + # Create a ScrollViewer if EnableScroll is true + if ($EnableScroll) { + $scrollViewer = New-Object System.Windows.Controls.ScrollViewer + $scrollViewer.VerticalScrollBarVisibility = 'Auto' + $scrollViewer.HorizontalScrollBarVisibility = 'Disabled' + $scrollViewer.Content = $messageTextBlock + $grid.Children.Add($scrollViewer) + [Windows.Controls.Grid]::SetRow($scrollViewer, 1) # Set the row to the second row (0-based index) + } else { + $grid.Children.Add($messageTextBlock) + [Windows.Controls.Grid]::SetRow($messageTextBlock, 1) # Set the row to the second row (0-based index) + } # Add OK button $okButton = New-Object Windows.Controls.Button diff --git a/scripts/main.ps1 b/scripts/main.ps1 index e17b7225..0c83c54c 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -505,5 +505,32 @@ Version : Current sponsors for ChrisTitusTech: +"@ + $authorInfo += "`n" + try { + # Call the function to get the sponsors + $sponsors = Invoke-WinUtilSponsors + + # Append the sponsors to the authorInfo + $sponsors | ForEach-Object { $authorInfo += "$_`n" } + } + catch { + $authorInfo += "An error occurred while fetching or processing the sponsors: $_`n" + } + + $FontSize = $sync.configs.themes.$ctttheme.CustomDialogFontSize + $HeaderFontSize = $sync.configs.themes.$ctttheme.CustomDialogFontSizeHeader + $IconSize = $sync.configs.themes.$ctttheme.CustomDialogIconSize + $Width = $sync.configs.themes.$ctttheme.CustomDialogWidth + $Height = $sync.configs.themes.$ctttheme.CustomDialogHeight + Show-CustomDialog -Message $authorInfo -Width $Width -Height $Height -FontSize $FontSize -HeaderFontSize $HeaderFontSize -IconSize $IconSize -EnableScroll $true +}) $sync["Form"].ShowDialog() | out-null Stop-Transcript diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml index 4648924f..3c0eaf8f 100644 --- a/xaml/inputXML.xaml +++ b/xaml/inputXML.xaml @@ -697,6 +697,7 @@ + From c68b8d0f75b4d3c6dcedff200bcb0de40092098d Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Sun, 14 Jul 2024 23:51:06 +0000 Subject: [PATCH 02/30] Compile Winutil --- winutil.ps1 | 100 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 92 insertions(+), 8 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index 483d5e12..54d6179e 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -8,7 +8,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech - Version : 24.07.13 + Version : 24.07.14 #> param ( [switch]$Debug, @@ -45,7 +45,7 @@ Add-Type -AssemblyName System.Windows.Forms # Variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "24.07.13" +$sync.version = "24.07.14" $sync.configs = @{} $sync.ProcessRunning = $false @@ -2282,6 +2282,51 @@ function Invoke-WinUtilSnapWindow { Write-Warning $psitem.Exception.StackTrace } } +Function Invoke-WinUtilSponsors { + <# + .SYNOPSIS + Lists Sponsors from ChrisTitusTech + .DESCRIPTION + Lists Sponsors from ChrisTitusTech + .EXAMPLE + Invoke-WinUtilSponsors + .NOTES + This function is used to list sponsors from ChrisTitusTech + #> + try { + # Define the URL and headers + $url = "https://github.com/sponsors/ChrisTitusTech" + $headers = @{ + "User-Agent" = "Chrome/58.0.3029.110" + } + + # Fetch the webpage content + try { + $html = Invoke-RestMethod -Uri $url -Headers $headers + } catch { + Write-Output $_.Exception.Message + exit + } + + # Use regex to extract the content between "Current sponsors" and "Past sponsors" + $currentSponsorsPattern = '(?s)(?<=Current sponsors).*?(?=Past sponsors)' + $currentSponsorsHtml = [regex]::Match($html, $currentSponsorsPattern).Value + + # Use regex to extract the sponsor usernames from the alt attributes in the "Current Sponsors" section + $sponsorPattern = '(?<=alt="@)[^"]+' + $sponsors = [regex]::Matches($currentSponsorsHtml, $sponsorPattern) | ForEach-Object { $_.Value } + + # Exclude "ChrisTitusTech" from the sponsors + $sponsors = $sponsors | Where-Object { $_ -ne "ChrisTitusTech" } + + # Return the sponsors + return $sponsors + } + catch { + Write-Error "An error occurred while fetching or processing the sponsors: $_" + return $null + } +} Function Invoke-WinUtilStickyKeys { <# .SYNOPSIS @@ -2828,6 +2873,9 @@ function Show-CustomDialog { .PARAMETER IconSize The Size to use for Icon inside the custom dialog window. + .PARAMETER EnableScroll + A flag indicating whether to enable scrolling if the content exceeds the window size. + .EXAMPLE Show-CustomDialog -Message "This is a custom dialog with a message and an image above." -Width 300 -Height 200 @@ -2838,7 +2886,8 @@ function Show-CustomDialog { [int]$Height = 200, [int]$FontSize = 10, [int]$HeaderFontSize = 14, - [int]$IconSize = 25 + [int]$IconSize = 25, + [bool]$EnableScroll = $false ) Add-Type -AssemblyName PresentationFramework @@ -3050,11 +3099,18 @@ $cttLogoPath = @" $messageTextBlock.Inlines.Add((New-Object Windows.Documents.Run($Message))) } - - # Add the TextBlock to the Grid - $grid.Children.Add($messageTextBlock) - [Windows.Controls.Grid]::SetRow($messageTextBlock, 1) # Set the row to the second row (0-based index) - + # Create a ScrollViewer if EnableScroll is true + if ($EnableScroll) { + $scrollViewer = New-Object System.Windows.Controls.ScrollViewer + $scrollViewer.VerticalScrollBarVisibility = 'Auto' + $scrollViewer.HorizontalScrollBarVisibility = 'Disabled' + $scrollViewer.Content = $messageTextBlock + $grid.Children.Add($scrollViewer) + [Windows.Controls.Grid]::SetRow($scrollViewer, 1) # Set the row to the second row (0-based index) + } else { + $grid.Children.Add($messageTextBlock) + [Windows.Controls.Grid]::SetRow($messageTextBlock, 1) # Set the row to the second row (0-based index) + } # Add OK button $okButton = New-Object Windows.Controls.Button @@ -12820,6 +12876,7 @@ $inputXML = ' + @@ -15296,5 +15353,32 @@ Version : Current sponsors for ChrisTitusTech: +"@ + $authorInfo += "`n" + try { + # Call the function to get the sponsors + $sponsors = Invoke-WinUtilSponsors + + # Append the sponsors to the authorInfo + $sponsors | ForEach-Object { $authorInfo += "$_`n" } + } + catch { + $authorInfo += "An error occurred while fetching or processing the sponsors: $_`n" + } + + $FontSize = $sync.configs.themes.$ctttheme.CustomDialogFontSize + $HeaderFontSize = $sync.configs.themes.$ctttheme.CustomDialogFontSizeHeader + $IconSize = $sync.configs.themes.$ctttheme.CustomDialogIconSize + $Width = $sync.configs.themes.$ctttheme.CustomDialogWidth + $Height = $sync.configs.themes.$ctttheme.CustomDialogHeight + Show-CustomDialog -Message $authorInfo -Width $Width -Height $Height -FontSize $FontSize -HeaderFontSize $HeaderFontSize -IconSize $IconSize -EnableScroll $true +}) $sync["Form"].ShowDialog() | out-null Stop-Transcript From 1e7b73df332cd3391ff362ee21be44649fd3aac5 Mon Sep 17 00:00:00 2001 From: Real-MullaC Date: Mon, 15 Jul 2024 01:59:55 +0100 Subject: [PATCH 03/30] Update Install-WinUtilProgramChoco.ps1 (#2307) --- functions/private/Install-WinUtilProgramChoco.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/private/Install-WinUtilProgramChoco.ps1 b/functions/private/Install-WinUtilProgramChoco.ps1 index 115030e8..43e42d79 100644 --- a/functions/private/Install-WinUtilProgramChoco.ps1 +++ b/functions/private/Install-WinUtilProgramChoco.ps1 @@ -85,7 +85,7 @@ function Install-WinUtilProgramChoco { # Cleanup leftovers files if(Test-Path -Path $installOutputFilePath){ Remove-Item -Path $installOutputFilePath } - if(Test-Path -Path $installOutputFilePath){ Remove-Item -Path $uninstallOutputFilePath } + if(Test-Path -Path $uninstallOutputFilePath){ Remove-Item -Path $uninstallOutputFilePath } return; } From 7294064aaa11b91c49ed36fcc07c61d465da13b8 Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Mon, 15 Jul 2024 01:00:22 +0000 Subject: [PATCH 04/30] Compile Winutil --- winutil.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index 54d6179e..bd19e205 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -8,7 +8,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech - Version : 24.07.14 + Version : 24.07.15 #> param ( [switch]$Debug, @@ -45,7 +45,7 @@ Add-Type -AssemblyName System.Windows.Forms # Variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "24.07.14" +$sync.version = "24.07.15" $sync.configs = @{} $sync.ProcessRunning = $false @@ -953,7 +953,7 @@ function Install-WinUtilProgramChoco { # Cleanup leftovers files if(Test-Path -Path $installOutputFilePath){ Remove-Item -Path $installOutputFilePath } - if(Test-Path -Path $installOutputFilePath){ Remove-Item -Path $uninstallOutputFilePath } + if(Test-Path -Path $uninstallOutputFilePath){ Remove-Item -Path $uninstallOutputFilePath } return; } From 5b7f0a0edf3d28e525c6920fc559fa75a5cc9f14 Mon Sep 17 00:00:00 2001 From: Real-MullaC Date: Mon, 15 Jul 2024 02:00:52 +0100 Subject: [PATCH 05/30] Update applications.json (#2313) --- config/applications.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/applications.json b/config/applications.json index c2926d03..c27f9c8d 100644 --- a/config/applications.json +++ b/config/applications.json @@ -2886,5 +2886,13 @@ "description": "Shotcut is a free, open source, cross-platform video editor.", "link": "https://shotcut.org/", "winget": "Meltytech.Shotcut" + }, + "Fork": { + "category": "Development", + "choco": "git-fork", + "content": "Fork", + "description": "Fork - a fast and friendly git client.", + "link": "https://git-fork.com/", + "winget": "Fork.Fork" } } From af36d76e65a42575392965c278b75bf57283036a Mon Sep 17 00:00:00 2001 From: Real-MullaC Date: Mon, 15 Jul 2024 02:01:09 +0100 Subject: [PATCH 06/30] Hidden File Tweaks (#2320) * Main * Fixes previous issues * Change the ordering of Some Toggle for Consistency --------- Co-authored-by: Mr.k --- config/tweaks.json | 16 ++++++--- functions/private/Get-WinUtilToggleStatus.ps1 | 11 ++++++ .../private/Invoke-WinUtilHiddenFiles.ps1 | 34 +++++++++++++++++++ functions/public/Invoke-WPFToggle.ps1 | 1 + 4 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 functions/private/Invoke-WinUtilHiddenFiles.ps1 diff --git a/config/tweaks.json b/config/tweaks.json index afae0216..80c4c680 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -3067,12 +3067,20 @@ "Order": "a108_", "Type": "Toggle" }, + "WPFToggleHiddenFiles": { + "Content": "Show Hidden Files", + "Description": "If Enabled then Hidden Files will be shown.", + "category": "Customize Preferences", + "panel": "2", + "Order": "a200_", + "Type": "Toggle" + }, "WPFToggleShowExt": { "Content": "Show File Extensions", "Description": "If enabled then File extensions (e.g., .txt, .jpg) are visible.", "category": "Customize Preferences", "panel": "2", - "Order": "a200_", + "Order": "a201_", "Type": "Toggle" }, "WPFToggleTaskbarSearch": { @@ -3080,7 +3088,7 @@ "Description": "If Enabled Search Button will be on the taskbar.", "category": "Customize Preferences", "panel": "2", - "Order": "a201_", + "Order": "a202_", "Type": "Toggle" }, "WPFToggleTaskView": { @@ -3088,7 +3096,7 @@ "Description": "If Enabled then Task View Button in Taskbar will be shown.", "category": "Customize Preferences", "panel": "2", - "Order": "a202_", + "Order": "a203_", "Type": "Toggle" }, "WPFToggleTaskbarWidgets": { @@ -3096,7 +3104,7 @@ "Description": "If Enabled then Widgets Button in Taskbar will be shown.", "category": "Customize Preferences", "panel": "2", - "Order": "a203_", + "Order": "a204_", "Type": "Toggle" }, "WPFOOSUbutton": { diff --git a/functions/private/Get-WinUtilToggleStatus.ps1 b/functions/private/Get-WinUtilToggleStatus.ps1 index 05db4d43..c7f0a8a9 100644 --- a/functions/private/Get-WinUtilToggleStatus.ps1 +++ b/functions/private/Get-WinUtilToggleStatus.ps1 @@ -125,6 +125,17 @@ Function Get-WinUtilToggleStatus { return $true } } + + if ($ToggleSwitch -eq "WPFToggleHiddenFiles") { + $HiddenFiles = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').Hidden + if($HiddenFiles -eq 0){ + return $false + } + else{ + return $true + } + } + if ($ToggleSwitch -eq "WPFToggleTaskbarWidgets") { $TaskbarWidgets = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskBarDa if($TaskbarWidgets -eq 0) { diff --git a/functions/private/Invoke-WinUtilHiddenFiles.ps1 b/functions/private/Invoke-WinUtilHiddenFiles.ps1 new file mode 100644 index 00000000..81b3d6bb --- /dev/null +++ b/functions/private/Invoke-WinUtilHiddenFiles.ps1 @@ -0,0 +1,34 @@ +function Invoke-WinUtilHiddenFiles { + <# + + .SYNOPSIS + Enable/Disable Hidden Files + + .PARAMETER Enabled + Indicates whether to enable or disable Hidden Files + + #> + Param($Enabled) + Try{ + if ($Enabled -eq $false){ + Write-Host "Enabling Hidden Files" + $value = 1 + } + else { + Write-Host "Disabling Hidden Files" + $value = 0 + } + $Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" + Set-ItemProperty -Path $Path -Name Hidden -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 + } +} diff --git a/functions/public/Invoke-WPFToggle.ps1 b/functions/public/Invoke-WPFToggle.ps1 index 9d923edb..4bb4caa4 100644 --- a/functions/public/Invoke-WPFToggle.ps1 +++ b/functions/public/Invoke-WPFToggle.ps1 @@ -30,5 +30,6 @@ function Invoke-WPFToggle { "WPFToggleTaskbarWidgets" {Invoke-WinUtilTaskbarWidgets $(Get-WinUtilToggleStatus WPFToggleTaskbarWidgets)} "WPFToggleTaskbarSearch" {Invoke-WinUtilTaskbarSearch $(Get-WinUtilToggleStatus WPFToggleTaskbarSearch)} "WPFToggleTaskView" {Invoke-WinUtilTaskView $(Get-WinUtilToggleStatus WPFToggleTaskView)} + "WPFToggleHiddenFiles" {Invoke-WinUtilHiddenFiles $(Get-WinUtilToggleStatus WPFToggleHiddenFiles)} } } From e5ba3896063d4bdd4a973329a7768f1ac7dfaebe Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Mon, 15 Jul 2024 01:01:39 +0000 Subject: [PATCH 07/30] Compile Winutil --- winutil.ps1 | 102 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 86 insertions(+), 16 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index bd19e205..7e532a86 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -715,6 +715,17 @@ Function Get-WinUtilToggleStatus { return $true } } + + if ($ToggleSwitch -eq "WPFToggleHiddenFiles") { + $HiddenFiles = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').Hidden + if($HiddenFiles -eq 0){ + return $false + } + else{ + return $true + } + } + if ($ToggleSwitch -eq "WPFToggleTaskbarWidgets") { $TaskbarWidgets = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskBarDa if($TaskbarWidgets -eq 0) { @@ -2029,6 +2040,40 @@ function Invoke-WinUtilGPU { } return $true } +function Invoke-WinUtilHiddenFiles { + <# + + .SYNOPSIS + Enable/Disable Hidden Files + + .PARAMETER Enabled + Indicates whether to enable or disable Hidden Files + + #> + Param($Enabled) + Try{ + if ($Enabled -eq $false){ + Write-Host "Enabling Hidden Files" + $value = 1 + } + else { + Write-Host "Disabling Hidden Files" + $value = 0 + } + $Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" + Set-ItemProperty -Path $Path -Name Hidden -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-WinUtilMouseAcceleration { <# @@ -5041,6 +5086,7 @@ function Invoke-WPFToggle { "WPFToggleTaskbarWidgets" {Invoke-WinUtilTaskbarWidgets $(Get-WinUtilToggleStatus WPFToggleTaskbarWidgets)} "WPFToggleTaskbarSearch" {Invoke-WinUtilTaskbarSearch $(Get-WinUtilToggleStatus WPFToggleTaskbarSearch)} "WPFToggleTaskView" {Invoke-WinUtilTaskView $(Get-WinUtilToggleStatus WPFToggleTaskView)} + "WPFToggleHiddenFiles" {Invoke-WinUtilHiddenFiles $(Get-WinUtilToggleStatus WPFToggleHiddenFiles)} } } function Invoke-WPFTweakPS7{ @@ -8488,6 +8534,14 @@ $sync.configs.applications = '{ "description": "Shotcut is a free, open source, cross-platform video editor.", "link": "https://shotcut.org/", "winget": "Meltytech.Shotcut" + }, + "WPFInstallFork": { + "category": "Development", + "choco": "git-fork", + "content": "Fork", + "description": "Fork - a fast and friendly git client.", + "link": "https://git-fork.com/", + "winget": "Fork.Fork" } }' | convertfrom-json $sync.configs.dns = '{ @@ -12091,12 +12145,20 @@ $sync.configs.tweaks = '{ "Order": "a108_", "Type": "Toggle" }, + "WPFToggleHiddenFiles": { + "Content": "Show Hidden Files", + "Description": "If Enabled then Hidden Files will be shown.", + "category": "Customize Preferences", + "panel": "2", + "Order": "a200_", + "Type": "Toggle" + }, "WPFToggleShowExt": { "Content": "Show File Extensions", "Description": "If enabled then File extensions (e.g., .txt, .jpg) are visible.", "category": "Customize Preferences", "panel": "2", - "Order": "a200_", + "Order": "a201_", "Type": "Toggle" }, "WPFToggleTaskbarSearch": { @@ -12104,7 +12166,7 @@ $sync.configs.tweaks = '{ "Description": "If Enabled Search Button will be on the taskbar.", "category": "Customize Preferences", "panel": "2", - "Order": "a201_", + "Order": "a202_", "Type": "Toggle" }, "WPFToggleTaskView": { @@ -12112,7 +12174,7 @@ $sync.configs.tweaks = '{ "Description": "If Enabled then Task View Button in Taskbar will be shown.", "category": "Customize Preferences", "panel": "2", - "Order": "a202_", + "Order": "a203_", "Type": "Toggle" }, "WPFToggleTaskbarWidgets": { @@ -12120,7 +12182,7 @@ $sync.configs.tweaks = '{ "Description": "If Enabled then Widgets Button in Taskbar will be shown.", "category": "Customize Preferences", "panel": "2", - "Order": "a203_", + "Order": "a204_", "Type": "Toggle" }, "WPFOOSUbutton": { @@ -13112,6 +13174,10 @@ $inputXML = ' + + + + @@ -13509,14 +13575,14 @@ $inputXML = ' - - - - + + + + @@ -13811,10 +13877,6 @@ $inputXML = ' - - - - @@ -13823,6 +13885,10 @@ $inputXML = ' + + + + @@ -14106,10 +14172,6 @@ $inputXML = ' - - - - @@ -14122,6 +14184,10 @@ $inputXML = ' + + + + @@ -14531,6 +14597,10 @@ $inputXML = ' + + + + @@ -13843,6 +13883,10 @@ $inputXML = ' + + + + @@ -14197,14 +14241,14 @@ $inputXML = ' - - - - + + + + @@ -14485,6 +14529,10 @@ $inputXML = ' + + + + From 7904380c8ba35ccd6657e828d88e45a8123ee235 Mon Sep 17 00:00:00 2001 From: Martin Wiethan <47688561+Marterich@users.noreply.github.com> Date: Mon, 15 Jul 2024 03:06:00 +0200 Subject: [PATCH 13/30] Fix Compile Errors on PowerShell 5 (#2322) * Fixed Extraction of JSON Object Names * Update Comment to reflect the code Co-authored-by: Mr.k --------- Co-authored-by: Mr.k --- Compile.ps1 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Compile.ps1 b/Compile.ps1 index a8bf570d..e5399475 100644 --- a/Compile.ps1 +++ b/Compile.ps1 @@ -56,12 +56,10 @@ Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach- # Replace every XML Special Character so it'll render correctly in final build # Only do so if json files has content to be displayed (for example the applications, tweaks, features json files) - # Some Type Convertion using Casting and Cleaning Up of the convertion result using 'Replace' Method + # Make an Array List containing every name at first level of Json File $jsonAsObject = $json | convertfrom-json - $firstLevelJsonList = ([System.String]$jsonAsObject).split('=;') | ForEach-Object { - $_.Replace('=}','').Replace('@{','').Replace(' ','') - } - + $firstLevelJsonList = [System.Collections.ArrayList]::new() + $jsonAsObject.PSObject.Properties.Name | ForEach-Object {$null = $firstLevelJsonList.Add($_)} # Note: # Avoid using HTML Entity Codes, for example '”' (stands for "Right Double Quotation Mark"), # Use **HTML decimal/hex codes instead**, as using HTML Entity Codes will result in XML parse Error when running the compiled script. From 54ad3198dd89df617ab199ca14155b448ac0b4dc Mon Sep 17 00:00:00 2001 From: Jakub Kusal Date: Mon, 15 Jul 2024 03:06:55 +0200 Subject: [PATCH 14/30] Add application: Lenovo Legion Toolkit (#2324) Co-authored-by: Chris Titus --- config/applications.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/applications.json b/config/applications.json index 1afdb0f6..a7cf5310 100644 --- a/config/applications.json +++ b/config/applications.json @@ -2895,6 +2895,14 @@ "link": "https://shotcut.org/", "winget": "Meltytech.Shotcut" }, + "LenovoLegionToolkit": { + "category": "Utilities", + "choco": "na", + "content": "Lenovo Legion Toolkit", + "description": "Lenovo Legion Toolkit (LLT) is a open-source utility created for Lenovo Legion (and similar) series laptops, that allows changing a couple of features that are only available in Lenovo Vantage or Legion Zone. It runs no background services, uses less memory, uses virtually no CPU, and contains no telemetry. Just like Lenovo Vantage, this application is Windows only.", + "link": "https://github.com/BartoszCichecki/LenovoLegionToolkit", + "winget": "BartoszCichecki.LenovoLegionToolkit" + }, "Pulsar-Edit": { "category": "Development", "choco": "pulsar", From 324575693505efc0437ef643ed28228bb46c4a74 Mon Sep 17 00:00:00 2001 From: CodingWonders <101426328+CodingWonders@users.noreply.github.com> Date: Mon, 15 Jul 2024 03:07:20 +0200 Subject: [PATCH 15/30] Remove Edge leftovers from WOW6432Node (#2328) --- functions/public/Invoke-WPFMicrowin.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/functions/public/Invoke-WPFMicrowin.ps1 b/functions/public/Invoke-WPFMicrowin.ps1 index 3d4f0a9d..1427f096 100644 --- a/functions/public/Invoke-WPFMicrowin.ps1 +++ b/functions/public/Invoke-WPFMicrowin.ps1 @@ -311,6 +311,19 @@ public class PowerManagement { reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "Pinned" /f >$null 2>&1 reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "LayoutCycle" /f >$null 2>&1 Write-Host "Edge icon removed from taskbar" + if (Test-Path "HKLM:\zSOFTWARE\WOW6432Node") + { + # Remove leftovers of 64-bit installations + # --- + # Remove registry values first... + reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" /va /f > $null 2>&1 + reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update" /va /f > $null 2>&1 + reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" /va /f > $null 2>&1 + # ...then the registry keys + reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" /f > $null 2>&1 + reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update" /f > $null 2>&1 + reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" /f > $null 2>&1 + } } reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f From 1d01b7490f0dde5de8b915655ddf5ced5273cb4e Mon Sep 17 00:00:00 2001 From: MyDrift Date: Mon, 15 Jul 2024 03:07:43 +0200 Subject: [PATCH 16/30] fixed end task with right click (#2331) --- config/tweaks.json | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/config/tweaks.json b/config/tweaks.json index 7f833a74..ea19f27c 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -2294,14 +2294,30 @@ "panel": "1", "Order": "a006_", "InvokeScript": [ - " - Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDeveloperSettings\" -Name \"TaskbarEndTask\" -Type \"DWord\" -Value \"1\" - " + "$path = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDeveloperSettings\" + $name = \"TaskbarEndTask\" + $value = 1 + + # Ensure the registry key exists + if (-not (Test-Path $path)) { + New-Item -Path $path -Force | Out-Null + } + + # Set the property, creating it if it doesn't exist + New-ItemProperty -Path $path -Name $name -PropertyType DWord -Value $value -Force | Out-Null" ], "UndoScript": [ - " - Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDeveloperSettings\" -Name \"TaskbarEndTask\" -Type \"DWord\" -Value \"0\" - " + "$path = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDeveloperSettings\" + $name = \"TaskbarEndTask\" + $value = 0 + + # Ensure the registry key exists + if (-not (Test-Path $path)) { + New-Item -Path $path -Force | Out-Null + } + + # Set the property, creating it if it doesn't exist + New-ItemProperty -Path $path -Name $name -PropertyType DWord -Value $value -Force | Out-Null" ] }, "WPFTweaksPowershell7": { From 8df9a7c590a9839e4edf6fb4c8f624582cbe017f Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Mon, 15 Jul 2024 01:08:08 +0000 Subject: [PATCH 17/30] Compile Winutil --- winutil.ps1 | 61 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index 379e80ee..2674f111 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -4580,6 +4580,19 @@ public class PowerManagement { reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "Pinned" /f >$null 2>&1 reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "LayoutCycle" /f >$null 2>&1 Write-Host "Edge icon removed from taskbar" + if (Test-Path "HKLM:\zSOFTWARE\WOW6432Node") + { + # Remove leftovers of 64-bit installations + # --- + # Remove registry values first... + reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" /va /f > $null 2>&1 + reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update" /va /f > $null 2>&1 + reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" /va /f > $null 2>&1 + # ...then the registry keys + reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" /f > $null 2>&1 + reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update" /f > $null 2>&1 + reg delete "HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" /f > $null 2>&1 + } } reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f @@ -8556,6 +8569,14 @@ $sync.configs.applications = '{ "link": "https://shotcut.org/", "winget": "Meltytech.Shotcut" }, + "WPFInstallLenovoLegionToolkit": { + "category": "Utilities", + "choco": "na", + "content": "Lenovo Legion Toolkit", + "description": "Lenovo Legion Toolkit (LLT) is a open-source utility created for Lenovo Legion (and similar) series laptops, that allows changing a couple of features that are only available in Lenovo Vantage or Legion Zone. It runs no background services, uses less memory, uses virtually no CPU, and contains no telemetry. Just like Lenovo Vantage, this application is Windows only.", + "link": "https://github.com/BartoszCichecki/LenovoLegionToolkit", + "winget": "BartoszCichecki.LenovoLegionToolkit" + }, "WPFInstallPulsar-Edit": { "category": "Development", "choco": "pulsar", @@ -11418,14 +11439,30 @@ $sync.configs.tweaks = '{ "panel": "1", "Order": "a006_", "InvokeScript": [ - " - Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDeveloperSettings\" -Name \"TaskbarEndTask\" -Type \"DWord\" -Value \"1\" - " + "$path = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDeveloperSettings\" + $name = \"TaskbarEndTask\" + $value = 1 + + # Ensure the registry key exists + if (-not (Test-Path $path)) { + New-Item -Path $path -Force | Out-Null + } + + # Set the property, creating it if it doesn''t exist + New-ItemProperty -Path $path -Name $name -PropertyType DWord -Value $value -Force | Out-Null" ], "UndoScript": [ - " - Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDeveloperSettings\" -Name \"TaskbarEndTask\" -Type \"DWord\" -Value \"0\" - " + "$path = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\TaskbarDeveloperSettings\" + $name = \"TaskbarEndTask\" + $value = 0 + + # Ensure the registry key exists + if (-not (Test-Path $path)) { + New-Item -Path $path -Force | Out-Null + } + + # Set the property, creating it if it doesn''t exist + New-ItemProperty -Path $path -Name $name -PropertyType DWord -Value $value -Force | Out-Null" ] }, "WPFTweaksPowershell7": { @@ -14225,6 +14262,10 @@ $inputXML = ' + + + + @@ -14241,14 +14282,14 @@ $inputXML = ' - - - - + + + + From 8cfd47e1b738581c42ee2494db3f1332975058f0 Mon Sep 17 00:00:00 2001 From: Real-MullaC Date: Mon, 15 Jul 2024 02:10:03 +0100 Subject: [PATCH 18/30] Adds Palemoon (#2332) --- config/applications.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/applications.json b/config/applications.json index a7cf5310..b60ad6b7 100644 --- a/config/applications.json +++ b/config/applications.json @@ -2887,6 +2887,14 @@ "link": "https://github.com/xM4ddy/OFGB", "winget": "xM4ddy.OFGB" }, + "PaleMoon": { + "category": "Browsers", + "choco": "paleMoon", + "content": "PaleMoon", + "description":"Pale Moon is an Open Source, Goanna-based web browser available for Microsoft Windows and Linux (with other operating systems in development), focusing on efficiency and ease of use.", + "link": "https://www.palemoon.org/download.shtml", + "winget": "MoonchildProductions.PaleMoon" + }, "Shotcut": { "category": "Multimedia Tools", "choco": "na", From 84ca02a033b811ea17ae5a28c2881912f0c0c6e5 Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Mon, 15 Jul 2024 01:10:26 +0000 Subject: [PATCH 19/30] Compile Winutil --- winutil.ps1 | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index 2674f111..4dcf6dee 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -8561,6 +8561,14 @@ $sync.configs.applications = '{ "link": "https://github.com/xM4ddy/OFGB", "winget": "xM4ddy.OFGB" }, + "WPFInstallPaleMoon": { + "category": "Browsers", + "choco": "paleMoon", + "content": "PaleMoon", + "description": "Pale Moon is an Open Source, Goanna-based web browser available for Microsoft Windows and Linux (with other operating systems in development), focusing on efficiency and ease of use.", + "link": "https://www.palemoon.org/download.shtml", + "winget": "MoonchildProductions.PaleMoon" + }, "WPFInstallShotcut": { "category": "Multimedia Tools", "choco": "na", @@ -13114,6 +13122,10 @@ $inputXML = ' + + + + @@ -13364,14 +13376,14 @@ $inputXML = ' - - - - + + + + @@ -13665,14 +13677,14 @@ $inputXML = ' - - - - + + + + @@ -13975,14 +13987,14 @@ $inputXML = ' - - - - + + + + @@ -14278,14 +14290,14 @@ $inputXML = ' - - - - + + + + From ac9b4fd645c65e453e20b4f0483d689b443aa2aa Mon Sep 17 00:00:00 2001 From: "Mr.k" Date: Mon, 15 Jul 2024 04:11:19 +0300 Subject: [PATCH 20/30] Change the titles for each section from Bold Text to Header 2 in Bug Report Issue Template (#2339) * Change the titles for each section from Bold Text to Header 3 in Bug Report Issue Template * Change the Titles Header from Level 3 to Level 2 in 'Bug Report' Issue Template --- .github/ISSUE_TEMPLATE/bug_report.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 891c6177..43426a8a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,24 +4,23 @@ about: Create a report to help us improve title: '' labels: '' assignees: '' - --- -**Describe the bug** +## Describe the bug A clear and concise description of what the bug is. -**To Reproduce** +## To Reproduce Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error -**Expected behavior** +## Expected behavior A clear and concise description of what you expected to happen. -**Screenshots** +## Screenshots If applicable, add screenshots to help explain your problem. -**Additional context** +## Additional context Add any other context about the problem here. From ff0b3d29cf7c5aa3c92afa171088b28822c02225 Mon Sep 17 00:00:00 2001 From: Martin Wiethan <47688561+Marterich@users.noreply.github.com> Date: Mon, 15 Jul 2024 03:16:38 +0200 Subject: [PATCH 21/30] Optimize badges (#2356) * Switch Readme to show total downloads of all time * Add download counter for specific releases automatically to release --- .github/workflows/pre-release.yaml | 2 ++ .github/workflows/release.yaml | 2 ++ README.md | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index 0cc68253..b1d9e7e4 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -40,6 +40,8 @@ jobs: with: tag_name: ${{ steps.extract_version.outputs.version }} name: Pre-Release ${{ steps.extract_version.outputs.version }} + body: "![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/${{ steps.extract_version.outputs.version }}/winutil.ps1)" + append_body: true files: ./winutil.ps1 prerelease: true env: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6d59bb73..61085b64 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -36,6 +36,8 @@ jobs: with: tag_name: ${{ steps.extract_version.outputs.version }} name: Release ${{ steps.extract_version.outputs.version }} + body: "![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/${{ steps.extract_version.outputs.version }}/winutil.ps1)" + append_body: true files: ./winutil.ps1 prerelease: false make_latest: "true" diff --git a/README.md b/README.md index 71fd1d31..79f13258 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Chris Titus Tech's Windows Utility -[![Version](https://img.shields.io/github/v/release/ChrisTitusTech/winutil?color=7a39fb)](https://github.com/ChrisTitusTech/winutil/releases/latest) -![GitHub Downloads (all assets, latest release)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/latest/total) -[![](https://dcbadge.limes.pink/api/server/https://discord.gg/RUbZUZyByQ)](https://discord.gg/RUbZUZyByQ) +[![Version](https://img.shields.io/github/v/release/ChrisTitusTech/winutil?color=%230567ff&label=Latest%20Release&style=for-the-badge)](https://github.com/ChrisTitusTech/winutil/releases/latest) +![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/winutil.ps1?label=Total%20Downloads&style=for-the-badge) +[![](https://dcbadge.limes.pink/api/server/https://discord.gg/RUbZUZyByQ?theme=default-inverted&style=for-the-badge)](https://discord.gg/RUbZUZyByQ) This utility is a compilation of Windows tasks I perform on each Windows system I use. It is meant to streamline *installs*, debloat with *tweaks*, troubleshoot with *config*, and fix Windows *updates*. I am extremely picky about any contributions to keep this project clean and efficient. From 792a5c4b384b26d40736bc8942ce3d720ce97531 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Sun, 14 Jul 2024 20:44:52 -0500 Subject: [PATCH 22/30] label github page deployment action --- .github/workflows/{ci.yml => github-pages.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{ci.yml => github-pages.yml} (94%) diff --git a/.github/workflows/ci.yml b/.github/workflows/github-pages.yml similarity index 94% rename from .github/workflows/ci.yml rename to .github/workflows/github-pages.yml index 1e853399..815a32ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/github-pages.yml @@ -1,4 +1,4 @@ -name: ci +name: GitHub Pages Deploy on: push: branches: From 904e0ad468a645d09db0c6d369d472707ca217ee Mon Sep 17 00:00:00 2001 From: "Mr.k" Date: Mon, 15 Jul 2024 04:47:40 +0300 Subject: [PATCH 23/30] Add New Windows 11 Specific Toggle - The 'Taskbar Alignment' Toggle (#2347) --- config/tweaks.json | 8 +++++ functions/private/Get-WinUtilToggleStatus.ps1 | 17 +++++++--- .../Invoke-WinUtilTaskbarAlignment.ps1 | 34 +++++++++++++++++++ functions/public/Invoke-WPFToggle.ps1 | 1 + 4 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 functions/private/Invoke-WinUtilTaskbarAlignment.ps1 diff --git a/config/tweaks.json b/config/tweaks.json index ea19f27c..88919728 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -3123,6 +3123,14 @@ "Order": "a204_", "Type": "Toggle" }, + "WPFToggleTaskbarAlignment": { + "Content": "Switch Taskbar Items between Center & Left", + "Description": "[Windows 11] If Enabled then the Taskbar Items will be shown on the Center, otherwise the Taskbar Items will be shown on the Left.", + "category": "Customize Preferences", + "panel": "2", + "Order": "a204_", + "Type": "Toggle" + }, "WPFOOSUbutton": { "Content": "Run OO Shutup 10", "category": "z__Advanced Tweaks - CAUTION", diff --git a/functions/private/Get-WinUtilToggleStatus.ps1 b/functions/private/Get-WinUtilToggleStatus.ps1 index c7f0a8a9..76245f9b 100644 --- a/functions/private/Get-WinUtilToggleStatus.ps1 +++ b/functions/private/Get-WinUtilToggleStatus.ps1 @@ -138,11 +138,20 @@ Function Get-WinUtilToggleStatus { if ($ToggleSwitch -eq "WPFToggleTaskbarWidgets") { $TaskbarWidgets = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskBarDa - if($TaskbarWidgets -eq 0) { + if($TaskbarWidgets -eq 0) { return $false - } - else{ + } + else{ return $true - } + } + } + if ($ToggleSwitch -eq "WPFToggleTaskbarAlignment") { + $TaskbarAlignment = (Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskbarAl + if($TaskbarAlignment -eq 0) { + return $false + } + else{ + return $true + } } } diff --git a/functions/private/Invoke-WinUtilTaskbarAlignment.ps1 b/functions/private/Invoke-WinUtilTaskbarAlignment.ps1 new file mode 100644 index 00000000..0c5e0dfa --- /dev/null +++ b/functions/private/Invoke-WinUtilTaskbarAlignment.ps1 @@ -0,0 +1,34 @@ +function Invoke-WinUtilTaskbarAlignment { + <# + + .SYNOPSIS + Switches between Center & Left Taskbar Alignment + + .PARAMETER Enabled + Indicates whether to make Taskbar Alignment Center or Left + + #> + Param($Enabled) + Try{ + if ($Enabled -eq $false){ + Write-Host "Making Taskbar Alignment to the Center" + $value = 1 + } + else { + Write-Host "Making Taskbar Alignment to the Left" + $value = 0 + } + $Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" + Set-ItemProperty -Path $Path -Name "TaskbarAl" -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 + } +} diff --git a/functions/public/Invoke-WPFToggle.ps1 b/functions/public/Invoke-WPFToggle.ps1 index 4bb4caa4..539878c7 100644 --- a/functions/public/Invoke-WPFToggle.ps1 +++ b/functions/public/Invoke-WPFToggle.ps1 @@ -31,5 +31,6 @@ function Invoke-WPFToggle { "WPFToggleTaskbarSearch" {Invoke-WinUtilTaskbarSearch $(Get-WinUtilToggleStatus WPFToggleTaskbarSearch)} "WPFToggleTaskView" {Invoke-WinUtilTaskView $(Get-WinUtilToggleStatus WPFToggleTaskView)} "WPFToggleHiddenFiles" {Invoke-WinUtilHiddenFiles $(Get-WinUtilToggleStatus WPFToggleHiddenFiles)} + "WPFToggleTaskbarAlignment" {Invoke-WinUtilTaskbarAlignment $(Get-WinUtilToggleStatus WPFToggleTaskbarAlignment)} } } From c9934a53b09d39cfe4998e44d48a3b4b74d0ccfa Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Mon, 15 Jul 2024 01:48:28 +0000 Subject: [PATCH 24/30] Compile Winutil --- winutil.ps1 | 64 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index 4dcf6dee..1b0777a0 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -728,12 +728,21 @@ Function Get-WinUtilToggleStatus { if ($ToggleSwitch -eq "WPFToggleTaskbarWidgets") { $TaskbarWidgets = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskBarDa - if($TaskbarWidgets -eq 0) { + if($TaskbarWidgets -eq 0) { return $false - } - else{ + } + else{ return $true - } + } + } + if ($ToggleSwitch -eq "WPFToggleTaskbarAlignment") { + $TaskbarAlignment = (Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskbarAl + if($TaskbarAlignment -eq 0) { + return $false + } + else{ + return $true + } } } function Get-WinUtilVariables { @@ -2403,6 +2412,40 @@ Function Invoke-WinUtilStickyKeys { Write-Warning $psitem.Exception.StackTrace } } +function Invoke-WinUtilTaskbarAlignment { + <# + + .SYNOPSIS + Switches between Center & Left Taskbar Alignment + + .PARAMETER Enabled + Indicates whether to make Taskbar Alignment Center or Left + + #> + Param($Enabled) + Try{ + if ($Enabled -eq $false){ + Write-Host "Making Taskbar Alignment to the Center" + $value = 1 + } + else { + Write-Host "Making Taskbar Alignment to the Left" + $value = 0 + } + $Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" + Set-ItemProperty -Path $Path -Name "TaskbarAl" -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-WinUtilTaskbarSearch { <# @@ -5106,6 +5149,7 @@ function Invoke-WPFToggle { "WPFToggleTaskbarSearch" {Invoke-WinUtilTaskbarSearch $(Get-WinUtilToggleStatus WPFToggleTaskbarSearch)} "WPFToggleTaskView" {Invoke-WinUtilTaskView $(Get-WinUtilToggleStatus WPFToggleTaskView)} "WPFToggleHiddenFiles" {Invoke-WinUtilHiddenFiles $(Get-WinUtilToggleStatus WPFToggleHiddenFiles)} + "WPFToggleTaskbarAlignment" {Invoke-WinUtilTaskbarAlignment $(Get-WinUtilToggleStatus WPFToggleTaskbarAlignment)} } } function Invoke-WPFTweakPS7{ @@ -12275,6 +12319,14 @@ $sync.configs.tweaks = '{ "Order": "a204_", "Type": "Toggle" }, + "WPFToggleTaskbarAlignment": { + "Content": "Switch Taskbar Items between Center & Left", + "Description": "[Windows 11] If Enabled then the Taskbar Items will be shown on the Center, otherwise the Taskbar Items will be shown on the Left.", + "category": "Customize Preferences", + "panel": "2", + "Order": "a204_", + "Type": "Toggle" + }, "WPFOOSUbutton": { "Content": "Run OO Shutup 10", "category": "z__Advanced Tweaks - CAUTION", @@ -14727,6 +14779,10 @@ $inputXML = ' - - + + From 2e26ae7ef1d35d975335a7a2df0b25774d383dff Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Mon, 15 Jul 2024 15:33:20 +0000 Subject: [PATCH 30/30] =?UTF-8?q?Deploying=20to=20main=20from=20@=20ChrisT?= =?UTF-8?q?itusTech/winutil@0138a766010e6167fdd9f660298ec56407a24939=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d0816b18..be2b2fb0 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,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. -Gregory NavasarkianYusuke SaitoTriHyderaMark AmosJason A. DiegmuellerBrogan BranstetterwyattMetalliDan28Jan WilleOwen +Gregory NavasarkianYusuke SaitoTriHyderaMark AmosJason A. DiegmuellerBrogan BranstetterwyattMetalliDan28Jan WilleOwen ## 🏅 Thanks to all Contributors Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.