mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-06-28 00:54:47 -05:00
05 16 23 testing (#881)
* Fix power profile (#766) (#767) * Fix power profile query * fix syntax * fix * Update Invoke-WPFUltimatePerformance.ps1 * Update winutil.ps1 * power profile fix * add reset network with netsh (#768) * add verbose logon (#773) * add verbose logon Enable or disable verbose sign in status messages. Verbose status messages may be helpful when you are troubleshooting slow startup, shutdown, logon, or logoff behavior. * compress-into-one-checkbox * compile winutil.ps1 * Update README.md (#774) * Update README.md * Update README.md * Adding 3 programs to the install tab (#789) * Prism Launcher - Custom FOSS minecraft launcher * Gsudo - Command line program that allows you to elevate a program as admin. * WingetUI - Graphical front end for winget, chochlatey and scoop Co-authored-by: Chris Titus <contact@christitus.com> * add undoscript feature + implement it on every tweaks (#776) * add undoscript feature + implement it on right click menu - add undoscript feature - add undo for right click menu to go back to windows 11 default right click menu by implementing undoscript feature * undoscript for WPFMiscTweaksDisplay * undoscript for WPFEssTweaksRemoveEdge * undoscript for WPFEssTweaksRemoveCortana * undoscript for WPFEssTweaksStorage * Update Invoke-WinUtilTweaks.ps1 thanks to @DeveloperDurp * compile * Fix packages name (#815) * fix-winrar_package_name * fix-vc++_package_name * fix #687 * implement check for admin (#818) check if script is running as admin or not and if not then it attempt to relaunch with admin privilege. * add "NetFx4Extended-ASPNET45" under dotnet features (#831) * add-docker-desktop (#834) Co-authored-by: Chris Titus <contact@christitus.com> * Fix 'Get Installed' for multiple-dependency apps (#835) * Update winutil.ps1 (#858) fix typos * Fixing AcceptEULA on Autologin * Program Update: Replace Origin with EA App #544 (#875) * New Theme support, initial functions. (#878) * Fix power profile (#766) * Fix power profile query * fix syntax * fix * Update Invoke-WPFUltimatePerformance.ps1 * Update winutil.ps1 * power profile fix * Adding Nomacs Opensource free and fast Image viewer * Adding theme support Later when this is tested well, we can do one of 2 things. 1. Pass theme on a command line so people with bad vision will have an option to have a better (more visible theme) 2. Create a drop down with themes and a save button which would save it ti some local config file * Fix for the compile script --------- Co-authored-by: Chris Titus <contact@christitus.com> * Dark Mode Enable * auto detect theme --------- Co-authored-by: Padsala Tushal <57517785+padsalatushal@users.noreply.github.com> Co-authored-by: Taken <taken@mairimashita.org> Co-authored-by: Yurin Doctrine <bayramyurgidenn@gmail.com> Co-authored-by: Aaron <54756786+AaronVickers@users.noreply.github.com> Co-authored-by: Sahil Jassal <56100355+shljsl75891@users.noreply.github.com> Co-authored-by: supplefrog <78985073+supplefrog@users.noreply.github.com> Co-authored-by: KonTy <9524513+KonTy@users.noreply.github.com>
This commit is contained in:
@ -26,8 +26,12 @@ Function Invoke-WinUtilCurrentSystem {
|
||||
|
||||
$filter = Get-WinUtilVariables -Type Checkbox | Where-Object {$psitem -like "WPFInstall*"}
|
||||
$sync.GetEnumerator() | Where-Object {$psitem.Key -in $filter} | ForEach-Object {
|
||||
if($sync.configs.applications.$($psitem.Key).winget -in $sync.InstalledPrograms.Id){
|
||||
Write-Output $psitem.name
|
||||
$dependencies = $($sync.configs.applications.$($psitem.Key).winget -split ";")
|
||||
|
||||
Foreach ($dependency in $dependencies) {
|
||||
if($dependency -in $sync.InstalledPrograms.Id){
|
||||
Write-Output $psitem.name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,19 +15,16 @@ function Invoke-WinUtilTweaks {
|
||||
Registry = "OriginalValue"
|
||||
ScheduledTask = "OriginalState"
|
||||
Service = "OriginalType"
|
||||
ScriptType = "UndoScript"
|
||||
}
|
||||
|
||||
}
|
||||
Else{
|
||||
$Values = @{
|
||||
Registry = "Value"
|
||||
ScheduledTask = "State"
|
||||
Service = "StartupType"
|
||||
}
|
||||
}
|
||||
|
||||
if($sync.configs.tweaks.$CheckBox.registry){
|
||||
$sync.configs.tweaks.$CheckBox.registry | ForEach-Object {
|
||||
Set-WinUtilRegistry -Name $psitem.Name -Path $psitem.Path -Type $psitem.Type -Value $psitem.$($values.registry)
|
||||
ScriptType = "InvokeScript"
|
||||
}
|
||||
}
|
||||
if($sync.configs.tweaks.$CheckBox.ScheduledTask){
|
||||
@ -40,6 +37,17 @@ function Invoke-WinUtilTweaks {
|
||||
Set-WinUtilService -Name $psitem.Name -StartupType $psitem.$($values.Service)
|
||||
}
|
||||
}
|
||||
if($sync.configs.tweaks.$CheckBox.registry){
|
||||
$sync.configs.tweaks.$CheckBox.registry | ForEach-Object {
|
||||
Set-WinUtilRegistry -Name $psitem.Name -Path $psitem.Path -Type $psitem.Type -Value $psitem.$($values.registry)
|
||||
}
|
||||
}
|
||||
if($sync.configs.tweaks.$CheckBox.$($values.ScriptType)){
|
||||
$sync.configs.tweaks.$CheckBox.$($values.ScriptType) | ForEach-Object {
|
||||
$Scriptblock = [scriptblock]::Create($psitem)
|
||||
Invoke-WinUtilScript -ScriptBlock $scriptblock -Name $CheckBox
|
||||
}
|
||||
}
|
||||
|
||||
if(!$undo){
|
||||
if($sync.configs.tweaks.$CheckBox.appx){
|
||||
@ -47,11 +55,6 @@ function Invoke-WinUtilTweaks {
|
||||
Remove-WinUtilAPPX -Name $psitem
|
||||
}
|
||||
}
|
||||
if($sync.configs.tweaks.$CheckBox.InvokeScript){
|
||||
$sync.configs.tweaks.$CheckBox.InvokeScript | ForEach-Object {
|
||||
$Scriptblock = [scriptblock]::Create($psitem)
|
||||
Invoke-WinUtilScript -ScriptBlock $scriptblock -Name $CheckBox
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
48
functions/private/Set-WinUtilUiTheme.ps1
Normal file
48
functions/private/Set-WinUtilUiTheme.ps1
Normal file
@ -0,0 +1,48 @@
|
||||
function Set-WinUtilUITheme {
|
||||
<#
|
||||
|
||||
.DESCRIPTION
|
||||
This function will set theme to the XAML file
|
||||
|
||||
.EXAMPLE
|
||||
|
||||
Set-WinUtilUITheme -inputXAML $inputXAML
|
||||
|
||||
#>
|
||||
param
|
||||
(
|
||||
[Parameter(Mandatory=$true, Position=0)]
|
||||
[string] $inputXML,
|
||||
[Parameter(Mandatory=$false, Position=1)]
|
||||
[string] $themeName = 'matrix'
|
||||
)
|
||||
|
||||
try {
|
||||
# Convert the JSON to a PowerShell object
|
||||
$themes = $sync.configs.themes
|
||||
# Select the specified theme
|
||||
$selectedTheme = $themes.$themeName
|
||||
|
||||
if ($selectedTheme) {
|
||||
# Loop through all key-value pairs in the selected theme
|
||||
foreach ($property in $selectedTheme.PSObject.Properties) {
|
||||
$key = $property.Name
|
||||
$value = $property.Value
|
||||
# Add curly braces around the key
|
||||
$formattedKey = "{$key}"
|
||||
# Replace the key with the value in the input XML
|
||||
$inputXML = $inputXML.Replace($formattedKey, $value)
|
||||
}
|
||||
}
|
||||
else {
|
||||
Write-Host "Theme '$themeName' not found."
|
||||
}
|
||||
|
||||
}
|
||||
catch {
|
||||
Write-Warning "Unable to apply theme"
|
||||
Write-Warning $psitem.Exception.StackTrace
|
||||
}
|
||||
|
||||
return $inputXML;
|
||||
}
|
Reference in New Issue
Block a user