winutil/functions/private/Get-WinUtilToggleStatus.ps1
Chris Titus bf271b89e9
Test 2024 01 15 (#1456)
* File Converter

* Adding wiki directory where we can start storing all the wikis for now (#1405)

* change logseq url and add .net 8 (#1385)

* Update applications.json

Add Official logseq url 
Add .net runtime 8.0

* compile with new logseq and .net 8 runtime

* add thorium avx2

* Compile Winutil

* Anoter one of those huge PRs
- Fix version inefficiency the version is already stored in sync, no need to slow down loading by one extra replace.
- Created custom dialog and About message
- Create a menu with Import/Export values
	- press on teh Settings cog in the right upper corner and save all the checkboxes
	- then you can either load them or load and run automatically
- Made Import Export load accross the whole app
- Optimized the way checkbox controls are looked up, it is 20% faster now
- Added a switch to load all the boxes from a config file
	- example: .winutil.ps1 -Config "C:UsersasdfDesktop\111.json"
- Added a switch to run all the action in unattended mode by passing -Run siwthc
	- example: .winutil.ps1 -Config "C:UsersasdfDesktop\111.json" -Run
	- This will run all the tweaks and install all the apps

* Fixing a couple of bugs and blur fonts, also menu now closes when focus is lost

* Remove Cider Music Player (#1400)

* Update winutil.ps1

* Update applications.json

* Compile Winutil

* Checking in wiki files. Once you get wiki going you will be able to just copy this content to the wiki. Or leave it as-is, which maybe better because than the community could edit it

* Adding microwin usage error wiki

* fixing link the the new wiki location

* Adding automation section to the readme

* Fixing doc errors

* Adding conda and a couple or tools used by scientists, also fixing a nesty bug with winget if you don't specify scope=machine tools like python will not work correctly

* fix application mismatch

* Update applications.json

---------

Co-authored-by: Cristian Negulescu <cristian@clamsen.com>
Co-authored-by: Chris Titus <dfm.titus@gmail.com>
Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
Co-authored-by: KonTy <KonTy@github.com>
Co-authored-by: Tommi Pöntinen <98650216+hamburgerghini1@users.noreply.github.com>
Co-authored-by: Chris Titus <contact@christitus.com>

* Compile Winutil

* remove files application (#1408)

* Update README.md (#1421)

* Compile Winutil

* Update links, descriptions + add choco id for twinkle tray (#1426)

* update twinkle tray

* update wingetui

* update wisetoys link

* update floorp link

* Compile Winutil

* Add some useful programs and fix an app's url (#1427)

* fix the link for strawberry music player

The existing one opens a python library

* feat: add some useful apps

* changed the link in the wrong place

* Compile Winutil

* Added new toggle tweak button (#1434)

* add new ToggleSwitch

* add new function to disable/enable toggle button

* add new name of the button for the given toggle

* added new toggle tweak

* Compile Winutil

* Feat: Add Microsoft Power BI program (#1438)

* Compile Winutil

* Fix Fredium App Link (#1440)

* Update applications.json (#1448)

Updated the link to Prism Launcher to point to the correct url

* Compile Winutil

* fix for bug with selecting presets and toggle switches (#1447)

* Update Invoke-WPFPresets.ps1

* Update Invoke-WPFPresets.ps1

* Compile Winutil

* Update winutil.ps1

---------

Co-authored-by: KonTy <9524513+KonTy@users.noreply.github.com>
Co-authored-by: Cristian Negulescu <cristian@clamsen.com>
Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
Co-authored-by: KonTy <KonTy@github.com>
Co-authored-by: Tommi Pöntinen <98650216+hamburgerghini1@users.noreply.github.com>
Co-authored-by: Munkk <152475628+munkk01@users.noreply.github.com>
Co-authored-by: DeveloperDurp <developerdurp@durp.info>
Co-authored-by: OmriOn <76548146+OmriOn@users.noreply.github.com>
Co-authored-by: Keshav S <55992029+Keshav13142@users.noreply.github.com>
Co-authored-by: Vuk Lekić <vuklekic22@gmail.com>
Co-authored-by: André Gonzalez <lopescg@gmail.com>
Co-authored-by: playgroundsskiff <149293245+playgroundsskiff@users.noreply.github.com>
Co-authored-by: BusterBean <73446417+BusterBean@users.noreply.github.com>
2024-01-25 14:44:51 -06:00

83 lines
2.7 KiB
PowerShell

Function Get-WinUtilToggleStatus {
<#
.SYNOPSIS
Pulls the registry keys for the given toggle switch and checks whether the toggle should be checked or unchecked
.PARAMETER ToggleSwitch
The name of the toggle to check
.OUTPUTS
Boolean to set the toggle's status to
#>
Param($ToggleSwitch)
if($ToggleSwitch -eq "WPFToggleDarkMode"){
$app = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').AppsUseLightTheme
$system = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').SystemUsesLightTheme
if($app -eq 0 -and $system -eq 0){
return $true
}
else{
return $false
}
}
if($ToggleSwitch -eq "WPFToggleBingSearch"){
$bingsearch = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Search').BingSearchEnabled
if($bingsearch -eq 0){
return $false
}
else{
return $true
}
}
if($ToggleSwitch -eq "WPFToggleNumLock"){
$numlockvalue = (Get-ItemProperty -path 'HKCU:\Control Panel\Keyboard').InitialKeyboardIndicators
if($numlockvalue -eq 2){
return $true
}
else{
return $false
}
}
if($ToggleSwitch -eq "WPFToggleVerboseLogon"){
$VerboseStatusvalue = (Get-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System').VerboseStatus
if($VerboseStatusvalue -eq 1){
return $true
}
else{
return $false
}
}
if($ToggleSwitch -eq "WPFToggleShowExt"){
$hideextvalue = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').HideFileExt
if($hideextvalue -eq 0){
return $true
}
else{
return $false
}
}
if($ToggleSwitch -eq "WPFToggleSnapFlyout"){
$hidesnap = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').EnableSnapAssistFlyout
if($hidesnap -eq 0){
return $false
}
else{
return $true
}
}
if($ToggleSwitch -eq "WPFToggleMouseAcceleration"){
$MouseSpeed = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseSpeed
$MouseThreshold1 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold1
$MouseThreshold2 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold2
if($MouseSpeed -eq 1 -and $MouseThreshold1 -eq 6 -and $MouseThreshold2 -eq 10){
return $true
}
else{
return $false
}
}
}