From 04015fbeb9205293d01c16955c825c43baaf60ec Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Mon, 26 Aug 2024 21:45:26 +0200 Subject: [PATCH] detecting system theme for alacritty config from within PowerShell --- PowerShell/Microsoft.PowerShell_profile.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/PowerShell/Microsoft.PowerShell_profile.ps1 b/PowerShell/Microsoft.PowerShell_profile.ps1 index 4da1a85..a4cae5f 100644 --- a/PowerShell/Microsoft.PowerShell_profile.ps1 +++ b/PowerShell/Microsoft.PowerShell_profile.ps1 @@ -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