:penguin: :bug: Workaround for electron/electron#5050
authorMenci <huanghaorui301@gmail.com>
Fri, 23 Sep 2016 10:07:43 +0000 (18:07 +0800)
committerGitHub <noreply@github.com>
Fri, 23 Sep 2016 10:07:43 +0000 (18:07 +0800)
Chromium only show the Tray icon with libappindicator when the env `XDG_CURRENT_DESKTOP`'s value is `Unity`. But under elementaryOS its value is 'Pantheon'.

Set it to `Unity` before app startup make the tray icon show under elementaryOS.

lib/common/init.js

index b82102cf24d2def9f5a9cb84f95b21070c3796d0..0c2ac80bd8efc97c5dd074a891b235d76a7e5938 100644 (file)
@@ -58,3 +58,8 @@ if (process.platform === 'win32') {
     process.windowsStore = true
   }
 }
+
+// Workaround for electron/electron#5050
+if (process.platform === 'linux' && process.env.XDG_CURRENT_DESKTOP === 'Pantheon') {
+  process.env.XDG_CURRENT_DESKTOP = 'Unity';
+}