winutil/functions/private/Invoke-WinUtilDarkMode.ps1
Chris Titus b1664158f4
Test 2023 10 24 (#1176)
* Compile Winutil

* Update README.md (#1142)

* Update README.md

* Update README.md

Update the README.md to be more precise & clear. Fix up grammatical mistakes, allow users to figure out their issues easier. Fix crediting of IRM execution script.

* Update README.md

* Compile Winutil

* replacing the hard-coded paths for windows dir (#1126)

* Changed version of python for winget to 3.12 (#1137)

* Compile Winutil

* Added Programs to the Install List (#1143)

* Added the checkboxes of what I want to add

* Added duplicati

* Added KDE Connect

* Added OpenVPN Connect

* Added Oracle Virtual Box

* Added Paint.net

* Fixed an error spotted in the KDE Connect package names

* Added the checkboxes into inputXML.xaml

* Added the package details to config\applications.json

* Reverted changes from winutil

---------

Co-authored-by: Chris Titus <contact@christitus.com>

* Compile Winutil

* New Section: Customize  Preferences (inside tweaks section) (#1163)

* convert numlock on startup checkboxs into toggle button

* convert verboselogon checkbox into toggle button

* gui changes : added new section, new style for toggle buttons

* convert showfileextentions checkbox into toggle button

* convert mouse acceleration checkboxs into togglebutton

* manor changes : cleanup, adding tooltips

* fix style of toggle tweaks

added new style 'labelfortweaks' that fix sytle and give mouse hover effect like previous tweaks that are using checkbox style but here for toggle tweaks we are using label and to make other tweaks style 'labelfortweaks' sytle is used. it mimic the style of checkbox style

---------

Co-authored-by: Chris Titus <contact@christitus.com>

* Compile Winutil

* add Thunderbird (#1165)

* Compile Winutil

* Update the screenshot in README w/ dark mode (#1173)

* took a pr on main and pulling it to test (#1175)

* Add Session messenger to the applications list. (#1166)

* Update applications.json

* Update inputXML.xaml

* Compile Winutil

---------

Co-authored-by: charlescgs <135472912+charlescgs@users.noreply.github.com>
Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>

---------

Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
Co-authored-by: aim <aimansadiqrahman@gmail.com>
Co-authored-by: edelvarden <42596339+edelvarden@users.noreply.github.com>
Co-authored-by: dass2608 <139251779+dass2608@users.noreply.github.com>
Co-authored-by: Inventhrice <45127310+Inventhrice@users.noreply.github.com>
Co-authored-by: Padsala Tushal <57517785+padsalatushal@users.noreply.github.com>
Co-authored-by: Antun Nitraj <antnitraj@gmail.com>
Co-authored-by: Meen Beese <meenbeese@tutanota.com>
Co-authored-by: charlescgs <135472912+charlescgs@users.noreply.github.com>
2023-11-14 15:45:48 -06:00

36 lines
1.1 KiB
PowerShell

Function Invoke-WinUtilDarkMode {
<#
.SYNOPSIS
Enables/Disables Dark Mode
.PARAMETER DarkMoveEnabled
Indicates the current dark mode state
#>
Param($DarkMoveEnabled)
Try{
if ($DarkMoveEnabled -eq $false){
Write-Host "Enabling Dark Mode"
$DarkMoveValue = 0
}
else {
Write-Host "Disabling Dark Mode"
$DarkMoveValue = 1
}
$Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
Set-ItemProperty -Path $Path -Name AppsUseLightTheme -Value $DarkMoveValue
Set-ItemProperty -Path $Path -Name SystemUsesLightTheme -Value $DarkMoveValue
}
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
}
}