Skip to content

Commit

Permalink
ubuntu fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rkorszun committed Jan 22, 2018
1 parent 80e883d commit 9b3343c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
19 changes: 17 additions & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ try {
// app.on('ready', createWindow);
app.on('ready', () => {
let trayImage = ''
if (process.platform == 'darwin') {
if (process.platform == 'darwin' || process.platform == 'linux') {
trayImage = './assets/tray/osx/icon_tray-normal.png';
}
else if (process.platform == 'win32') {
Expand Down Expand Up @@ -111,6 +111,8 @@ try {
show: false
})



splash = new BrowserWindow({
width: 400,
height: 420,
Expand All @@ -123,14 +125,27 @@ try {
pathname: path.join(__dirname, 'splash.html'),
protocol: 'file',
slashes: true,
icon: __dirname + '/assets/trec-logo.png'
}))

mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file',
slashes: true,
icon: __dirname + '/assets/trec-logo.png'
}))
}))

mainWindow.webContents.executeJavaScript(`
var path = require('path');
module.paths.push(path.resolve('node_modules'));
module.paths.push(path.resolve('../node_modules'));
module.paths.push(path.resolve(__dirname, '..', '..', 'electron', 'node_modules'));
module.paths.push(path.resolve(__dirname, '..', '..', 'electron.asar', 'node_modules'));
module.paths.push(path.resolve(__dirname, '..', '..', 'app', 'node_modules'));
module.paths.push(path.resolve(__dirname, '..', '..', 'app.asar', 'node_modules'));
path = undefined;
`);

splash.once("ready-to-show", () => { splash.show()
})
setTimeout(() => {
Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function pack(plat, arch, cb) {

if (icon) {
DEFAULT_OPTS.icon = icon + (() => {
let extension = '.png';
let extension = '.ico';
if (plat === 'darwin') {
extension = '.icns';
} else if (plat === 'win32') {
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
"test": "karma start ./karma.conf.js",
"pree2e": "webdriver-manager update --standalone false --gecko false --quiet && npm run build",
"e2e": "protractor ./protractor.conf.js",
"postinstall": "electron-rebuild -f -w sqlite3",
"electron-rebuild": "electron-rebuild -f -w sqlite3"
"postinstall": "electron-rebuild -f -w sqlite3,@paulcbetts/system-idle-time",
"electron-rebuild": "electron-rebuild -f -w sqlite3,@paulcbetts/system-idle-time"
},
"dependencies": {
"@paulcbetts/system-idle-time": "git+https://github.com/paulcbetts/node-system-idle-time.git",
"sqlite3": "^3.1.13",
"electron-notifications": "^1.0.0"
"@paulcbetts/system-idle-time": "^1.0.4",
"electron-notifications": "^1.0.0",
"sqlite3": "^3.1.13"
},
"devDependencies": {
"@angular/animations": "^4.4.3",
Expand All @@ -56,7 +56,6 @@
"ionicons": "^3.0.0",
"ngx-loading": "^1.0.8",
"rxjs": "5.4.3",

"zone.js": "0.8.17",
"@angular/compiler": "4.4.3",
"electron-builder": "^19.37.2",
Expand Down
4 changes: 2 additions & 2 deletions src/app/services/timer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class TimerService {

public trayRecording() {
let iconPath = ''
if (process.platform == 'darwin') {
if (process.platform == 'darwin' || process.platform == 'linux') {
iconPath = path.join(__dirname, './assets/tray/osx/icon_tray-recording.png')
}
else if (process.platform == 'win32') {
Expand All @@ -169,7 +169,7 @@ export class TimerService {

public trayDefault() {
let iconPath = ''
if (process.platform == 'darwin') {
if (process.platform == 'darwin' || process.platform == 'linux') {
iconPath = path.join(__dirname, './assets/tray/osx/icon_tray-normal.png')
}
else if (process.platform == 'win32') {
Expand Down

0 comments on commit 9b3343c

Please sign in to comment.