This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Work-around for this Electron bug: https://github.com/electron/electron/issues/19468 | |
import { execSync } from 'child_process' | |
import { app } from 'electron' | |
function setWindowsAppTheme(light: boolean) { | |
try { | |
execSync( | |
`REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize /v AppsUseLightTheme /t REG_DWORD /d ${ light ? 1 : 0 } /f`, | |
{ windowsHide: true } |