Skip to content

Instantly share code, notes, and snippets.

View LuminescentMoon's full-sized avatar

Luminescent LuminescentMoon

View GitHub Profile
// 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 }