Skip to content

Commit 9fe7931

Browse files
committed
Add icontheme support for those who want ne colored ones or monochrome ones, see #75
1 parent 61ead18 commit 9fe7931

23 files changed

+59
-11
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
An electron-base client for Google Hangouts Chat, since Google didn't see fit to provide one.
44

55
## CHANGELOG
6+
### 5.27.23-1
7+
8+
Add support for several iconThemes, to match some 'monochrome' desktop themes. 3 values are supported :
9+
10+
* `default` : the good old green ones
11+
* `colored` : the new colored google ones
12+
* `mono` : an attempt at monochrome icon theme
13+
14+
Edit `~/.config/google-hangouts-chat-linux.json` and set `"iconTheme":"colored"` for instance, then **restart**.
15+
16+
No GUI setting for now.
617

718
### 5.27.22-4
819

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ So, **to use electron's Wayland rendering** edit `/usr/share/applciations/google
101101

102102
See full [CHANGELOG](./CHANGELOG.md).
103103

104+
### 5.27.23-1
105+
106+
Add support for several iconThemes, to match some 'monochrome' desktop themes. 3 values are supported :
107+
108+
* `default` : the good old green ones
109+
* `colored` : the new colored google ones
110+
* `mono` : an attempt at monochrome icon theme
111+
112+
Edit `~/.config/google-hangouts-chat-linux.json` and set `"iconTheme":"colored"` for instance, then **restart**.
113+
114+
No GUI setting for now.
115+
104116
### 5.27.22-4
105117

106118
Fix systray notification (favicon name changed on google side) see https://github.com/squalou/google-chat-linux/issues/87

assets/icon/badge-256.png

-6.28 KB
Binary file not shown.

assets/icon/badge-48.png

-1.39 KB
Binary file not shown.

assets/icon/colored/badge-64.png

8.94 KB
Loading

assets/icon/colored/normal-64.png

7.95 KB
Loading

assets/icon/colored/offline-64.png

6.36 KB
Loading
File renamed without changes.
File renamed without changes.
File renamed without changes.

assets/icon/mono/badge-64.png

8.03 KB
Loading

assets/icon/mono/normal-64.png

6.79 KB
Loading

assets/icon/mono/offline-64.png

6.8 KB
Loading

assets/icon/normal-256.png

-4.14 KB
Binary file not shown.

assets/icon/normal-48.png

-1.25 KB
Binary file not shown.

assets/icon/offline-256.png

-4.67 KB
Binary file not shown.

assets/icon/offline-48.png

-3.34 KB
Binary file not shown.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "google-chat-linux",
3-
"version": "5.27.22-4",
3+
"version": "5.27.23-1",
44
"description": "Unofficial alternative Google Chat desktop app",
55
"main": "src/index.js",
66
"scripts": {

src/configs.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const setConfigDefaults = (configuration) => {
1414
configuration.thirdPartyAuthLoginMode = configuration.thirdPartyAuthLoginMode === undefined ? false : configuration.thirdPartyAuthLoginMode;
1515
configuration.useOldUrl = configuration.useOldUrl === undefined ? false : configuration.useOldUrl;
1616
configuration.languages = configuration.languages === undefined ? undefined : configuration.languages;
17+
configuration.iconTheme = configuration.iconTheme === undefined ? 'default' : configuration.iconTheme;
18+
pathsManifest.setIconTheme(configuration.iconTheme)
1719
if (process.platform === 'win32') {
1820
configuration.keepMinimized = true;
1921
}

src/paths.js

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
11
const path = require("path");
22
const { app } = require("electron");
33

4+
let theme = 'default';
5+
const iconPathTemplate = `\`icon/\${theme}/\${iconName}\``;
6+
const evalIconPath = (theme, iconName) => {
7+
return eval(iconPathTemplate);
8+
}
9+
10+
const setIconTheme = (t) => {
11+
theme = t;
12+
}
13+
14+
15+
const normal = () => {
16+
return path.resolve(process.resourcesPath, evalIconPath(theme, "normal-64.png"))
17+
}
18+
const badge = () => {
19+
return path.resolve(process.resourcesPath, evalIconPath(theme, "badge-64.png"))
20+
}
21+
const offline = () => {
22+
return path.resolve(process.resourcesPath, evalIconPath(theme, "offline-64.png"))
23+
}
24+
425
module.exports = {
526
"configsPath": path.resolve(app.getPath("appData"), "google-hangouts-chat-linux.json"),
6-
"NORMAL": path.resolve(process.resourcesPath, "icon/normal-64.png"),
7-
"BADGE": path.resolve(process.resourcesPath, "icon/badge-64.png"),
8-
"OFFLINE": path.resolve(process.resourcesPath, "icon/offline-64.png")
27+
"OVERLAY_NEW_NOTIF": path.resolve(process.resourcesPath, "icon/overlay-new-xs.png"),
28+
normal: normal,
29+
badge: badge,
30+
offline: offline,
31+
setIconTheme: setIconTheme
932
}

src/tray.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const initializeTray = (windowObj) => {
6060
// -> moved things to ipcRenderer preload mechanism in faviconChange.js - thank you ankurk91 :-)
6161
// see https://github.com/ankurk91/google-chat-electron.git
6262
try {
63-
systemTrayIcon = new Tray(pathsManifest.OFFLINE);
63+
systemTrayIcon = new Tray(pathsManifest.offline());
6464
} catch (e) {
6565
console.log(e)
6666
console.log("set Tray icon failed !")
@@ -86,11 +86,11 @@ ipcMain.on('favicon-changed', (evt, href) => {
8686

8787
function iconForType(iconType) {
8888
if (iconType == "NORMAL") {
89-
return pathsManifest.NORMAL;
89+
return pathsManifest.normal();
9090
} else if (iconType == "ATTENTION") {
91-
return pathsManifest.BADGE;
91+
return pathsManifest.badge();
9292
} else {
93-
return pathsManifest.OFFLINE;
93+
return pathsManifest.offline();
9494
}
9595
}
9696

src/window.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ const getBrowserWindowOptions = (config) => {
215215
},
216216
"show": false,
217217
"backgroundColor": "#262727",
218-
"icon": pathsManifest.NORMAL,
218+
"icon": pathsManifest.normal(),
219219
}
220220
}
221221

0 commit comments

Comments
 (0)