-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (19 loc) · 676 Bytes
/
Copy pathindex.js
File metadata and controls
23 lines (19 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const electron = require('electron');
const {app, ipcMain} = electron;
const path = require('path');
const TimerTray = require('./app/timer_tray');
const MainWindow = require('./app/main_window')
let mainWindow;
let tray;
app.on('ready', ()=> {
if(process.platform === 'darwin') {app.dock.hide();};
mainWindow = new MainWindow('./src/index.html');
const iconName = process.platform === 'win32' ? 'windows-icon.png' : 'iconTemplate.png';
const iconPath = path.join(__dirname, `./src/assets/${iconName}`);
tray = new TimerTray(iconPath, mainWindow);
});
if(process.platform == 'darwin'){
ipcMain.on('update-timer', (event, timeLeft)=>{
tray.setTitle(timeLeft);
});
}