Skip to content

Commit

Permalink
Manually set icon path on linux platforms (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
anubh-v authored Sep 16, 2020
1 parent 71b977b commit bd608cf
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import * as path from 'path';
import * as url from 'url';
import { getAccessToken } from './oauth';

const ICON_PATH = path.join(__dirname, 'dist/favicon.512x512.png');

let win: BrowserWindow = null;
const args = process.argv.slice(1),
serve = args.some(val => val === '--serve');
Expand Down Expand Up @@ -33,11 +35,8 @@ ipcMain.on('github-oauth', (event, clearAuthState, repoPermissionLevel) => {

function createWindow() {

const electronScreen = screen;
const size = screen.getPrimaryDisplay().workAreaSize;

// Create the browser window.
win = new BrowserWindow({
const windowOptions = {
x: 0,
y: 0,
width: size.width,
Expand All @@ -46,7 +45,15 @@ function createWindow() {
nodeIntegration: true,
allowRunningInsecureContent: !isDevMode,
},
});
};

if (process.platform === 'linux') {
// app icon needs to be set manually on Linux platforms
windowOptions['icon'] = ICON_PATH;
}

// Create the browser window.
win = new BrowserWindow(windowOptions);

nativeTheme.themeSource = 'light';

Expand Down

0 comments on commit bd608cf

Please sign in to comment.