mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix .desktop + allow to turn this feature off
This commit is contained in:
parent
8ce3c1a480
commit
8159564885
@ -1,10 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const {APP_PNG_ICON_DIR} = require("./resource_dir");
|
const {APP_PNG_ICON_DIR, ELECTRON_APP_ROOT_DIR} = require("./resource_dir");
|
||||||
const log = require("./log");
|
const log = require("./log");
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const config = require('./config');
|
||||||
|
|
||||||
const template = `[Desktop Entry]
|
const template = `[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
@ -19,8 +20,8 @@ Terminal=false
|
|||||||
* Installs .desktop icon into standard ~/.local/share/applications directory.
|
* Installs .desktop icon into standard ~/.local/share/applications directory.
|
||||||
* We overwrite this file during every run as it might have been updated.
|
* We overwrite this file during every run as it might have been updated.
|
||||||
*/
|
*/
|
||||||
async function installLocalAppIcon() {
|
function installLocalAppIcon() {
|
||||||
if (["win32", "darwin"].includes(os.platform())) {
|
if (["win32", "darwin"].includes(os.platform()) || (config.General && config.General.noDesktopIcon)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,9 +56,7 @@ function escapePath(path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getExePath() {
|
function getExePath() {
|
||||||
const appPath = require('electron').app.getAppPath();
|
return path.resolve(ELECTRON_APP_ROOT_DIR, 'trilium');
|
||||||
|
|
||||||
return path.resolve(appPath, 'trilium');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -4,6 +4,8 @@ const fs = require('fs');
|
|||||||
|
|
||||||
const RESOURCE_DIR = path.resolve(__dirname, "../..");
|
const RESOURCE_DIR = path.resolve(__dirname, "../..");
|
||||||
|
|
||||||
|
// where "trilium" executable is
|
||||||
|
const ELECTRON_APP_ROOT_DIR = path.resolve(RESOURCE_DIR, "../..");
|
||||||
const DB_INIT_DIR = path.resolve(RESOURCE_DIR, "db");
|
const DB_INIT_DIR = path.resolve(RESOURCE_DIR, "db");
|
||||||
const APP_PNG_ICON_DIR = path.resolve(RESOURCE_DIR, "src/public/images/app-icons/png");
|
const APP_PNG_ICON_DIR = path.resolve(RESOURCE_DIR, "src/public/images/app-icons/png");
|
||||||
|
|
||||||
@ -23,5 +25,6 @@ module.exports = {
|
|||||||
RESOURCE_DIR,
|
RESOURCE_DIR,
|
||||||
MIGRATIONS_DIR,
|
MIGRATIONS_DIR,
|
||||||
DB_INIT_DIR,
|
DB_INIT_DIR,
|
||||||
|
ELECTRON_APP_ROOT_DIR,
|
||||||
APP_PNG_ICON_DIR
|
APP_PNG_ICON_DIR
|
||||||
};
|
};
|
Loading…
x
Reference in New Issue
Block a user