Linux fixes
This commit is contained in:
12
package.json
12
package.json
@@ -30,7 +30,7 @@
|
||||
"devDependencies": {
|
||||
"cross-env": "^6.0.3",
|
||||
"electron": "^6.1.0",
|
||||
"electron-builder": "^21.2.0",
|
||||
"electron-builder": "^20.44.4",
|
||||
"extract-text-webpack-plugin": "^3.0.2",
|
||||
"typescript": "^3.6.4",
|
||||
"webpack-browser-plugin": "^1.0.20"
|
||||
@@ -71,19 +71,17 @@
|
||||
"node_modules/**/*",
|
||||
"src/helpers.js",
|
||||
"src/renderer/**/*",
|
||||
"public/detect_linux.sh",
|
||||
"public/install_linux.sh"
|
||||
"public/detect_linux.sh"
|
||||
],
|
||||
"linux": {
|
||||
"category": "Utility",
|
||||
"target": "AppImage",
|
||||
"icon": "./build/icon.icns"
|
||||
"target": "AppImage"
|
||||
},
|
||||
"mac": {
|
||||
"category": "public.app-category.utilities",
|
||||
"icon": "./build/icon.icns",
|
||||
"target": "dmg",
|
||||
"darkModeSupport": true
|
||||
"darkModeSupport": true,
|
||||
"icon": "./build/icon.icns"
|
||||
},
|
||||
"win": {
|
||||
"icon": "./build/icon.ico",
|
||||
|
||||
@@ -39,9 +39,11 @@ const StateIPC = require('../src/renderer/ipc/StateIPC');
|
||||
const SystemIPC = require('../src/renderer/ipc/SystemIPC');
|
||||
const UpgradeIPC = require('../src/renderer/ipc/UpgradeIPC');
|
||||
|
||||
const platform = os.platform();
|
||||
|
||||
const dimensions = {
|
||||
height: ((os.platform() === 'darwin') ? 346 : 326),
|
||||
width: 428 + ((os.platform() === 'win32') ? 40 : (os.platform() === 'darwin') ? 190 : 200),
|
||||
height: ((platform === 'darwin') ? 346 : (platform === 'win32') ? 326 : 300),
|
||||
width: 428 + ((platform === 'win32') ? 40 : (platform === 'darwin') ? 190 : 200),
|
||||
};
|
||||
|
||||
let isShutdown = false;
|
||||
@@ -80,9 +82,9 @@ const createWindow = () => {
|
||||
loadUiSettings();
|
||||
|
||||
let extra = {};
|
||||
if (os.platform() === 'linux') {
|
||||
if (platform === 'linux') {
|
||||
extra = {
|
||||
icon: path.join(__dirname, '../', 'icon.png'),
|
||||
icon: path.join(__dirname, '../build/', 'logo.png'),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,9 +102,12 @@ const createWindow = () => {
|
||||
webSecurity: !process.env.ELECTRON_START_URL
|
||||
}
|
||||
});
|
||||
if (platform === 'linux') {
|
||||
mainWindow.setMenuBarVisibility(false);
|
||||
} else {
|
||||
mainWindow.removeMenu();
|
||||
|
||||
if ((os.platform() === 'darwin') && launchHidden) {
|
||||
}
|
||||
if ((platform === 'darwin') && launchHidden) {
|
||||
app.dock.hide();
|
||||
}
|
||||
|
||||
@@ -132,8 +137,8 @@ const createWindow = () => {
|
||||
MountsIPC.unmountAllDrives();
|
||||
});
|
||||
|
||||
const appPath = (os.platform() === 'win32') ? path.resolve(path.join(app.getAppPath(), '..\\..\\repertory-ui.exe')) :
|
||||
(os.platform() === 'darwin') ? path.resolve(path.join(path.dirname(app.getAppPath()), '../MacOS/repertory-ui')) :
|
||||
const appPath = (platform === 'win32') ? path.resolve(path.join(app.getAppPath(), '..\\..\\repertory-ui.exe')) :
|
||||
(platform === 'darwin') ? path.resolve(path.join(path.dirname(app.getAppPath()), '../MacOS/repertory-ui')) :
|
||||
process.env.APPIMAGE;
|
||||
|
||||
const autoLauncher = new AutoLaunch({
|
||||
@@ -177,7 +182,7 @@ const createWindow = () => {
|
||||
}
|
||||
]);
|
||||
|
||||
const image = nativeImage.createFromPath(path.join(__dirname, (os.platform() === 'darwin') ? '../build/logo_mac.png' : '../build/logo.png'));
|
||||
const image = nativeImage.createFromPath(path.join(__dirname, (platform === 'darwin') ? '../build/logo_mac.png' : '../build/logo.png'));
|
||||
mainWindowTray = new Tray(image);
|
||||
|
||||
autoLauncher
|
||||
@@ -199,7 +204,7 @@ const getMainWindow = () => {
|
||||
};
|
||||
|
||||
const loadUiSettings = () => {
|
||||
const settingFile = path.join(helpers.resolvePath(Constants.DATA_LOCATIONS[os.platform()]), 'ui.json');
|
||||
const settingFile = path.join(helpers.resolvePath(Constants.DATA_LOCATIONS[platform]), 'ui.json');
|
||||
try {
|
||||
if (fs.statSync(settingFile).isFile()) {
|
||||
const settings = JSON.parse(fs.readFileSync(settingFile, 'utf8'));
|
||||
@@ -228,9 +233,9 @@ const setIsInstalling = installing => {
|
||||
const setTrayImage = driveInUse => {
|
||||
let image;
|
||||
if (driveInUse) {
|
||||
image = nativeImage.createFromPath(path.join(__dirname, os.platform() === 'darwin' ? '../build/logo_both_mac.png' : '../build/logo_both.png'));
|
||||
image = nativeImage.createFromPath(path.join(__dirname, platform === 'darwin' ? '../build/logo_both_mac.png' : '../build/logo_both.png'));
|
||||
} else {
|
||||
image = nativeImage.createFromPath(path.join(__dirname, os.platform() === 'darwin' ? '../build/logo_mac.png' : '../build/logo.png'));
|
||||
image = nativeImage.createFromPath(path.join(__dirname, platform === 'darwin' ? '../build/logo_mac.png' : '../build/logo.png'));
|
||||
}
|
||||
mainWindowTray.setImage(image);
|
||||
};
|
||||
@@ -238,8 +243,10 @@ const setTrayImage = driveInUse => {
|
||||
const setWindowVisibility = show => {
|
||||
if (show) {
|
||||
mainWindow.show();
|
||||
if (os.platform() === 'darwin') {
|
||||
if (platform === 'darwin') {
|
||||
app.dock.show();
|
||||
} else if (platform === 'linux') {
|
||||
mainWindow.setSize(dimensions.width, dimensions.height);
|
||||
}
|
||||
|
||||
if (mainWindow.isMinimized()) {
|
||||
@@ -248,7 +255,7 @@ const setWindowVisibility = show => {
|
||||
mainWindow.focus();
|
||||
} else {
|
||||
mainWindow.hide();
|
||||
if (os.platform() === 'darwin') {
|
||||
if (platform === 'darwin') {
|
||||
app.dock.hide();
|
||||
}
|
||||
}
|
||||
@@ -271,9 +278,6 @@ const standardIPCReply = (event, channel, data, error) => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
app.on('before-quit', function () {
|
||||
isQuiting = true;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user