Skip to content

Open-source and local-first Slack and Notion alternative that puts you in control of your data

Add colanode icon

Hakan Shehufd9b945dc5af
diff --git a/apps/desktop/assets/colanode_logo_black.icns b/apps/desktop/assets/colanode_logo_black.icns
new file mode 100644
index 00000000..139a5d82
Binary files /dev/null and b/apps/desktop/assets/colanode_logo_black.icns differ
diff --git a/apps/desktop/assets/colanode_logo_black.ico b/apps/desktop/assets/colanode_logo_black.ico
new file mode 100644
index 00000000..f496dd62
Binary files /dev/null and b/apps/desktop/assets/colanode_logo_black.ico differ
diff --git a/apps/desktop/assets/colanode_logo_black.png b/apps/desktop/assets/colanode_logo_black.png
new file mode 100644
index 00000000..cf122fdf
Binary files /dev/null and b/apps/desktop/assets/colanode_logo_black.png differ
diff --git a/apps/desktop/assets/colanode_logo_white.png b/apps/desktop/assets/colanode_logo_white.png
new file mode 100644
index 00000000..0ab319a1
Binary files /dev/null and b/apps/desktop/assets/colanode_logo_white.png differ
diff --git a/apps/desktop/forge.config.ts b/apps/desktop/forge.config.ts
index 3dcbf888..bebef8e1 100644
--- a/apps/desktop/forge.config.ts
+++ b/apps/desktop/forge.config.ts
@@ -11,6 +11,9 @@ import fs from 'fs/promises';
const config: ForgeConfig = {
packagerConfig: {
name: 'Colanode',
+ executableName: 'Colanode',
+ icon: 'assets/colanode_logo_black',
+ appBundleId: 'com.colanode.desktop',
asar: true,
ignore: [
/^\/src/,
diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts
index c6aadd80..bd3b77dc 100644
--- a/apps/desktop/src/main.ts
+++ b/apps/desktop/src/main.ts
@@ -16,9 +16,13 @@ import { commandService } from '@/main/services/command-service';
import { bootstrapper } from '@/main/bootstrapper';
import started from 'electron-squirrel-startup';
import { logService } from '@/main/services/log-service';
+import { getAppIconPath } from '@/main/utils';
const logger = logService.createLogger('main');
+app.setName('Colanode');
+app.setAppUserModelId('com.colanode.desktop');
+
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
if (started) {
app.quit();
@@ -30,6 +34,7 @@ const createWindow = () => {
// Create the browser window.
const mainWindow = new BrowserWindow({
fullscreen: true,
+ icon: getAppIconPath(),
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
},
diff --git a/apps/desktop/src/main/services/asset-service.ts b/apps/desktop/src/main/services/asset-service.ts
index 58a3e1da..438df9d7 100644
--- a/apps/desktop/src/main/services/asset-service.ts
+++ b/apps/desktop/src/main/services/asset-service.ts
@@ -4,7 +4,8 @@ import fs from 'fs';
import unzipper from 'unzipper';
import { EmojiData } from '@/shared/types/emojis';
import { IconData } from '@/shared/types/icons';
-import { logService } from './log-service';
+import { logService } from '@/main/services/log-service';
+import { getAssetsSourcePath } from '@/main/utils';
type AssetsVersion = {
date: string;
@@ -34,7 +35,7 @@ class AssetService {
return path.join(this.assetsDir, url);
}
- return path.join(this.getAssetsSourcePath(), url);
+ return path.join(getAssetsSourcePath(), url);
}
public getEmojiData(): EmojiData {
@@ -70,7 +71,7 @@ class AssetService {
private async updateEmojis(): Promise<void> {
this.logger.debug('Updating emojis');
- const emojisZipPath = path.join(this.getAssetsSourcePath(), 'emojis.zip');
+ const emojisZipPath = path.join(getAssetsSourcePath(), 'emojis.zip');
const emojisDir = path.join(this.assetsDir, 'emojis');
if (fs.existsSync(emojisDir)) {
fs.rmSync(emojisDir, { recursive: true });
@@ -86,7 +87,7 @@ class AssetService {
private async updateIcons(): Promise<void> {
this.logger.debug('Updating icons');
- const iconsZipPath = path.join(this.getAssetsSourcePath(), 'icons.zip');
+ const iconsZipPath = path.join(getAssetsSourcePath(), 'icons.zip');
const iconsDir = path.join(this.assetsDir, 'icons');
if (fs.existsSync(iconsDir)) {
fs.rmSync(iconsDir, { recursive: true });
@@ -133,14 +134,6 @@ class AssetService {
})
);
}
-
- private getAssetsSourcePath(): string {
- if (app.isPackaged) {
- return path.join(process.resourcesPath, 'assets');
- }
-
- return path.resolve(__dirname, '../../assets');
- }
}
export const assetService = new AssetService();
diff --git a/apps/desktop/src/main/utils.ts b/apps/desktop/src/main/utils.ts
index b6882495..171ec838 100644
--- a/apps/desktop/src/main/utils.ts
+++ b/apps/desktop/src/main/utils.ts
@@ -40,6 +40,18 @@ export const getAccountAvatarsDirectoryPath = (accountId: string): string => {
return path.join(appPath, 'avatars', accountId);
};
+export const getAssetsSourcePath = (): string => {
+ if (app.isPackaged) {
+ return path.join(process.resourcesPath, 'assets');
+ }
+
+ return path.resolve(__dirname, '../../assets');
+};
+
+export const getAppIconPath = (): string => {
+ return path.join(getAssetsSourcePath(), 'colanode_logo_black.png');
+};
+
export const hasInsertChanges = (result: InsertResult[]): boolean => {
if (result.length === 0) {
return false;