detecting system theme for alacritty config from within PowerShell

This commit is contained in:
Baipyrus 2024-08-26 21:45:26 +02:00
parent b85fb033f8
commit 04015fbeb9

View File

@ -43,3 +43,14 @@ if ($settings.proxyEnable -and (!$env:http_proxy))
} elseif ((!$settings.proxyEnable) -and $env:http_proxy)
{ UnsetProxy;
}
# Get theme personalization settings
$settings = Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize'
# Read the content of the Alacritty config file
$alacritty = "$env:APPDATA\alacritty\alacritty.toml"
$content = Get-Content -Path $alacritty
# Determine current theme
$theme = $settings.AppsUseLightTheme