From cc0eb205d48b60b6b56928e0b22c941e78ac819a Mon Sep 17 00:00:00 2001 From: Morten Enemark Lund Date: Tue, 4 Jun 2024 03:29:38 +0200 Subject: [PATCH 01/32] Add the pixi package manager * Add the pixi package manager --- config/applications.json | 8 ++++++++ xaml/inputApp.xaml | 3 +++ 2 files changed, 11 insertions(+) diff --git a/config/applications.json b/config/applications.json index 7092acfa..9f6c3a51 100644 --- a/config/applications.json +++ b/config/applications.json @@ -2623,6 +2623,14 @@ "link": "https://docs.conda.io/projects/miniconda", "winget": "Anaconda.Miniconda3" }, + "WPFInstallpixi": { + "category": "Development", + "choco": "pixi", + "content": "Pixi", + "description": "Pixi is a fast software package manager built on top of the existing conda ecosystem. Spins up development environments quickly on Windows, macOS and Linux. Pixi supports Python, R, C/C++, Rust, Ruby, and many other languages.", + "link": "https://pixi.sh", + "winget": "prefix-dev.pixi" + }, "WPFInstalltemurin": { "category": "Development", "choco": "temurin", diff --git a/xaml/inputApp.xaml b/xaml/inputApp.xaml index 55c0cb33..0a7cd4b9 100644 --- a/xaml/inputApp.xaml +++ b/xaml/inputApp.xaml @@ -206,6 +206,9 @@ + + + From 8dc8f18a8f409d43c7bec8e9af401cb926c40a88 Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Tue, 4 Jun 2024 01:30:04 +0000 Subject: [PATCH 02/32] Compile Winutil --- winutil.ps1 | 25 ++++++++++++++++++------- xaml/inputApp.xaml | 16 ++++++++-------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index 12041c30..b3fd35e6 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -10,7 +10,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech - Version : 24.05.11 + Version : 24.06.04 #> param ( [switch]$Debug, @@ -47,7 +47,7 @@ Add-Type -AssemblyName System.Windows.Forms # Variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "24.05.11" +$sync.version = "24.06.04" $sync.configs = @{} $sync.ProcessRunning = $false @@ -7840,6 +7840,14 @@ $sync.configs.applications = '{ "link": "https://docs.conda.io/projects/miniconda", "winget": "Anaconda.Miniconda3" }, + "WPFInstallpixi": { + "category": "Development", + "choco": "pixi", + "content": "Pixi", + "description": "Pixi is a fast software package manager built on top of the existing conda ecosystem. Spins up development environments quickly on Windows, macOS and Linux. Pixi supports Python, R, C/C++, Rust, Ruby, and many other languages.", + "link": "https://pixi.sh", + "winget": "prefix-dev.pixi" + }, "WPFInstalltemurin": { "category": "Development", "choco": "temurin", @@ -12769,6 +12777,9 @@ $inputXML = ' + + + @@ -12968,12 +12979,12 @@ $inputXML = ' - - - + Text="Scratch" + Margin="2" + IsReadOnly="False" + ToolTip="Alt Path For Scratch Directory" + Grid.Column="0" + VerticalAlignment="Center" + Foreground="{LabelboxForegroundColor}"> + + + Date: Tue, 4 Jun 2024 01:43:16 +0000 Subject: [PATCH 09/32] Compile Winutil --- winutil.ps1 | 78 ++++++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index d1518838..e0b9df25 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -3465,7 +3465,7 @@ function Invoke-WPFGetIso { return } - $sync.BusyMessage.Visibility="Visible" + $sync.BusyMessage.Visibility="Visible" $sync.BusyText.Text="N Busy" @@ -3476,10 +3476,6 @@ function Invoke-WPFGetIso { Write-Host "\/ \/|_| \___||_| \___/ \/ \/ |_||_| |_| " $oscdimgPath = Join-Path $env:TEMP 'oscdimg.exe' - if( ! (Test-Path $oscdimgPath -PathType Leaf) ) { - $oscdimgPath = Join-Path '.\releases\' 'oscdimg.exe' -} - $oscdImgFound = [bool] (Get-Command -ErrorAction Ignore -Type Application oscdimg.exe) -or (Test-Path $oscdimgPath -PathType Leaf) Write-Host "oscdimg.exe on system: $oscdImgFound" @@ -4094,26 +4090,27 @@ public class PowerManagement { $desktopDir = "$($scratchDir)\Windows\Users\Default\Desktop" New-Item -ItemType Directory -Force -Path "$desktopDir" dism /English /image:$($scratchDir) /set-profilepath:"$($scratchDir)\Windows\Users\Default" - $command = "powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'irm https://christitus.com/win | iex'" - $shortcutPath = "$desktopDir\WinUtil.lnk" - $shell = New-Object -ComObject WScript.Shell - $shortcut = $shell.CreateShortcut($shortcutPath) - if (Test-Path -Path "$env:TEMP\cttlogo.png") - { - $pngPath = "$env:TEMP\cttlogo.png" - $icoPath = "$env:TEMP\cttlogo.ico" - ConvertTo-Icon -bitmapPath $pngPath -iconPath $icoPath - Write-Host "ICO file created at: $icoPath" - Copy-Item "$env:TEMP\cttlogo.png" "$($scratchDir)\Windows\cttlogo.png" -force - Copy-Item "$env:TEMP\cttlogo.ico" "$($scratchDir)\Windows\cttlogo.ico" -force - $shortcut.IconLocation = "c:\Windows\cttlogo.ico" - } + # $command = "powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'irm https://christitus.com/win | iex'" + # $shortcutPath = "$desktopDir\WinUtil.lnk" + # $shell = New-Object -ComObject WScript.Shell + # $shortcut = $shell.CreateShortcut($shortcutPath) - $shortcut.TargetPath = "powershell.exe" - $shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -Command `"$command`"" - $shortcut.Save() - Write-Host "Shortcut to winutil created at: $shortcutPath" + # if (Test-Path -Path "$env:TEMP\cttlogo.png") + # { + # $pngPath = "$env:TEMP\cttlogo.png" + # $icoPath = "$env:TEMP\cttlogo.ico" + # ConvertTo-Icon -bitmapPath $pngPath -iconPath $icoPath + # Write-Host "ICO file created at: $icoPath" + # Copy-Item "$env:TEMP\cttlogo.png" "$($scratchDir)\Windows\cttlogo.png" -force + # Copy-Item "$env:TEMP\cttlogo.ico" "$($scratchDir)\Windows\cttlogo.ico" -force + # $shortcut.IconLocation = "c:\Windows\cttlogo.ico" + # } + + # $shortcut.TargetPath = "powershell.exe" + # $shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -Command `"$command`"" + # $shortcut.Save() + # Write-Host "Shortcut to winutil created at: $shortcutPath" # *************************** Automation black *************************** Write-Host "Copy checkinstall.cmd into the ISO" @@ -13895,20 +13892,29 @@ $inputXML = ' - - + Text="Scratch" + Margin="2" + IsReadOnly="False" + ToolTip="Alt Path For Scratch Directory" + Grid.Column="0" + VerticalAlignment="Center" + Foreground="{LabelboxForegroundColor}"> + + + Date: Mon, 3 Jun 2024 18:53:39 -0700 Subject: [PATCH 10/32] Tweaks page overhaul: * Toggle page overhaul: * Modern toggles + Tweak: Disable Copilot + Tweak: Set hibernation to default (fix issue https://github.com/ChrisTitusTech/winutil/issues/1399) * Merge branch 'test-2024-04-20-2' into TweaksToggles --- config/themes.json | 3 ++ config/tweaks.json | 83 +++++++++++++++++++++++++++++++ functions/private/Get-TabXaml.ps1 | 5 +- xaml/inputXML.xaml | 78 ++++++++++++++++++++--------- 4 files changed, 142 insertions(+), 27 deletions(-) diff --git a/config/themes.json b/config/themes.json index fb23ca95..f61c09ef 100644 --- a/config/themes.json +++ b/config/themes.json @@ -23,6 +23,7 @@ "ButtonBackgroundMouseoverColor": "#C2C2C2", "ButtonBackgroundSelectedColor": "#F0F0F0", "ButtonForegroundColor": "#000000", + "ToggleButtonOnColor": "#2e77ff", "ButtonBorderThickness": "1", "ButtonMargin": "1", "ButtonCornerRadius": "2", @@ -53,6 +54,7 @@ "ButtonBackgroundMouseoverColor": "#A55A64", "ButtonBackgroundSelectedColor": "#FF5733", "ButtonForegroundColor": "#9CCC65", + "ToggleButtonOnColor": "#2e77ff", "ButtonBorderThickness": "1", "ButtonMargin": "1", "ButtonCornerRadius": "2", @@ -83,6 +85,7 @@ "ButtonBackgroundMouseoverColor": "#FF5733", "ButtonBackgroundSelectedColor": "#FF5733", "ButtonForegroundColor": "#9CCC65", + "ToggleButtonOnColor": "#2e77ff", "ButtonBorderThickness": "1", "ButtonMargin": "1", "ButtonCornerRadius": "2", diff --git a/config/tweaks.json b/config/tweaks.json index 8829b8a3..8ff735ee 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -58,6 +58,53 @@ "powercfg.exe /hibernate on" ] }, + "WPFToggleTweaksLaptopHybernation": { + "Content": "Set Hibernation as default (good for laptops)", + "Description": "Most modern laptops have connected stadby enabled which drains the battery, this sets hibernation as default which will not drain the battery. See issue https://github.com/ChrisTitusTech/winutil/issues/1399", + "category": "Essential Tweaks", + "panel": "1", + "Order": "a011_", + "registry": [ + { + "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Power\\PowerSettings\\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0", + "OriginalValue": "1", + "Name": "Attributes", + "Value": "2", + "Type": "DWord" + }, + { + "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Power\\PowerSettings\\abfc2519-3608-4c2a-94ea-171b0ed546ab\\94ac6d29-73ce-41a6-809f-6363ba21b47e", + "OriginalValue": "0", + "Name": "Attributes ", + "Value": "2", + "Type": "DWord" + } + ], + "InvokeScript": [ + " + Write-Host \"Turn on Hibernation\" + Start-Process -FilePath powercfg -ArgumentList \"/hibernate on\" -NoNewWindow -Wait + + # Set hibernation as the default action + Start-Process -FilePath powercfg -ArgumentList \"/change standby-timeout-ac 60\" -NoNewWindow -Wait + Start-Process -FilePath powercfg -ArgumentList \"/change standby-timeout-dc 60\" -NoNewWindow -Wait + Start-Process -FilePath powercfg -ArgumentList \"/change monitor-timeout-ac 10\" -NoNewWindow -Wait + Start-Process -FilePath powercfg -ArgumentList \"/change monitor-timeout-dc 1\" -NoNewWindow -Wait + " + ], + "UndoScript": [ + " + Write-Host \"Turn off Hibernation\" + Start-Process -FilePath powercfg -ArgumentList \"/hibernate off\" -NoNewWindow -Wait + + # Set standby to detault values + Start-Process -FilePath powercfg -ArgumentList \"/change standby-timeout-ac 15\" -NoNewWindow -Wait + Start-Process -FilePath powercfg -ArgumentList \"/change standby-timeout-dc 15\" -NoNewWindow -Wait + Start-Process -FilePath powercfg -ArgumentList \"/change monitor-timeout-ac 15\" -NoNewWindow -Wait + Start-Process -FilePath powercfg -ArgumentList \"/change monitor-timeout-dc 15\" -NoNewWindow -Wait + " + ] + }, "WPFTweaksHome": { "Content": "Disable Homegroup", "Description": "Disables HomeGroup - HomeGroup is a password-protected home networking service that lets you share your stuff with other PCs that are currently running and connected to your network.", @@ -114,6 +161,42 @@ } ] }, + "WPFTweaksCopilotOff": { + "Content": "Disable Copilot", + "Description": "Copilot off", + "category": "Essential Tweaks", + "panel": "1", + "Order": "a011_", + "registry": [ + { + + "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsCopilot", + "Name": "TurnOffWindowsCopilot", + "Type": "DWord", + "Value": "1", + "OriginalValue": "0p" + }, + { + "Path": "HKCU:\\Software\\Policies\\Microsoft\\Windows\\WindowsCopilot", + "Name": "TurnOffWindowsCopilot", + "Type": "DWord", + "Value": "1", + "OriginalValue": "0" + } + ], + "InvokeScript": [ + " + Write-Host \"Remove Popilot\" + dism /online /remove-package /package-name:Microsoft.Windows.Copilot + " + ], + "UndoScript": [ + " + Write-Host \"Why???\" + Write-Host \"Remove Popilot\" + " + ] + }, "WPFTweaksServices": { "Content": "Set Services to Manual", "Description": "Turns a bunch of system services to manual that don't need to be running all the time. This is pretty harmless as if the service is needed, it will simply start on demand.", diff --git a/functions/private/Get-TabXaml.ps1 b/functions/private/Get-TabXaml.ps1 index c4bccb9e..135039e1 100644 --- a/functions/private/Get-TabXaml.ps1 +++ b/functions/private/Get-TabXaml.ps1 @@ -91,9 +91,8 @@ function Get-TabXaml { } $appInfo = $organizedData[$panel][$category][$appName] if ("Toggle" -eq $appInfo.Type) { - $blockXml += "`n" - $blockXml += "`n" - $blockXml += "`n" + $blockXml += "`n`n" } elseif ("Combobox" -eq $appInfo.Type) { $blockXml += "`n