Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Commit

Permalink
Fixed unavailable dark mode on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
eko committed Aug 9, 2019
1 parent a6f3409 commit 1217a29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.js
Expand Up @@ -11,7 +11,7 @@ app.dock.hide()

app.on('ready', () => {
global.sharedObject = {
isDarkMode: systemPreferences.isDarkMode()
isDarkMode: 'darwin' == process.platform ? systemPreferences.isDarkMode() : false
}

const envVars = shellEnv.sync()
Expand Down Expand Up @@ -48,7 +48,9 @@ const themeHasChanged = () => {
updateDarkMode()
}

systemPreferences.subscribeNotification('AppleInterfaceThemeChangedNotification', themeHasChanged)
if ('darwin' == process.platform) {
systemPreferences.subscribeNotification('AppleInterfaceThemeChangedNotification', themeHasChanged)
}

app.on('window-all-closed', () => {
app.quit()
Expand Down

0 comments on commit 1217a29

Please sign in to comment.