diff --git a/src/browser/index.jsx b/src/browser/index.jsx index f98c35bd..671c683b 100644 --- a/src/browser/index.jsx +++ b/src/browser/index.jsx @@ -486,6 +486,21 @@ var showUnreadBadgeOSX = function(unreadCount, mentionCount) { }); } +var showUnreadBadgeLinux = function(unreadCount, mentionCount) { + /*if (mentionCount > 0) { + remote.app.dock.setBadge(mentionCount.toString()); + } else if (unreadCount > 0) { + remote.app.dock.setBadge('•'); + } else { + remote.app.dock.setBadge(''); + }*/ + + electron.ipcRenderer.send('update-unread', { + unreadCount: unreadCount, + mentionCount: mentionCount + }); +} + var showUnreadBadge = function(unreadCount, mentionCount) { switch (process.platform) { case 'win32': @@ -494,6 +509,10 @@ var showUnreadBadge = function(unreadCount, mentionCount) { case 'darwin': showUnreadBadgeOSX(unreadCount, mentionCount); break; + case 'linux': + console.log(unreadCount); + showUnreadBadgeLinux(unreadCount, mentionCount); + break; default: } } diff --git a/src/main.js b/src/main.js index c0b33f19..e6e978b9 100644 --- a/src/main.js +++ b/src/main.js @@ -63,6 +63,12 @@ const trayImages = function() { unread: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/MenuIconUnreadTemplate.png')), mention: nativeImage.createFromPath(path.resolve(__dirname, 'resources/osx/MenuIconMentionTemplate.png')) }; + case 'linux': + return { + normal: nativeImage.createFromPath(path.resolve(__dirname, 'resources/linux/light/MenuIconTemplate.png')), + unread: nativeImage.createFromPath(path.resolve(__dirname, 'resources/linux/light/MenuIconUnreadTemplate.png')), + mention: nativeImage.createFromPath(path.resolve(__dirname, 'resources/linux/light/MenuIconMentionTemplate.png')) + }; default: return {}; } @@ -73,7 +79,7 @@ function shouldShowTrayIcon() { if (process.platform === 'win32') { return true; } - if (process.platform === 'darwin' && config.showTrayIcon === true) { + if (['darwin', 'linux'].includes(process.platform) && config.showTrayIcon === true) { return true; } return false; diff --git a/src/resources/linux/light/MenuIconMentionTemplate.png b/src/resources/linux/light/MenuIconMentionTemplate.png new file mode 100644 index 00000000..69706004 Binary files /dev/null and b/src/resources/linux/light/MenuIconMentionTemplate.png differ diff --git a/src/resources/linux/light/MenuIconTemplate.png b/src/resources/linux/light/MenuIconTemplate.png new file mode 100644 index 00000000..4bb5133c Binary files /dev/null and b/src/resources/linux/light/MenuIconTemplate.png differ diff --git a/src/resources/linux/light/MenuIconUnreadTemplate.png b/src/resources/linux/light/MenuIconUnreadTemplate.png new file mode 100644 index 00000000..ffc7de90 Binary files /dev/null and b/src/resources/linux/light/MenuIconUnreadTemplate.png differ