mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-07 22:19:02 +00:00
use png for tray on linux
This commit is contained in:
parent
156b4061b0
commit
422be7410a
@ -104,10 +104,10 @@ try:
|
|||||||
with open(os.path.join(filepath, 'app', 'ENHANCER_VERSION.txt'), 'w', encoding='UTF-8') as write:
|
with open(os.path.join(filepath, 'app', 'ENHANCER_VERSION.txt'), 'w', encoding='UTF-8') as write:
|
||||||
write.write(enhancer_version)
|
write.write(enhancer_version)
|
||||||
|
|
||||||
if os.path.isfile(os.path.join(filepath, "app", "renderer", "preload.js")):
|
if os.path.isfile(os.path.join(filepath, 'app', 'renderer', 'preload.js')):
|
||||||
print(
|
print(
|
||||||
f' ...adding preload.js to {os.path.join(filepath, "app","renderer","preload.js")}')
|
f' ...adding preload.js to {os.path.join(filepath, "app","renderer","preload.js")}')
|
||||||
with open(os.path.join(filepath, "app", "renderer", "preload.js"), 'r', encoding='UTF-8') as content:
|
with open(os.path.join(filepath, 'app', 'renderer', 'preload.js'), 'r', encoding='UTF-8') as content:
|
||||||
if '/* === INJECTION MARKER === */' in content.read():
|
if '/* === INJECTION MARKER === */' in content.read():
|
||||||
print(' * preload.js already added. replacing it.')
|
print(' * preload.js already added. replacing it.')
|
||||||
content.seek(0)
|
content.seek(0)
|
||||||
@ -116,12 +116,12 @@ try:
|
|||||||
if '/* === INJECTION MARKER === */' in line:
|
if '/* === INJECTION MARKER === */' in line:
|
||||||
break
|
break
|
||||||
original += line
|
original += line
|
||||||
with open(os.path.join(filepath, "app", "renderer", "preload.js"), 'w', encoding='UTF-8') as write:
|
with open(os.path.join(filepath, 'app', 'renderer', 'preload.js'), 'w', encoding='UTF-8') as write:
|
||||||
write.writelines(original)
|
write.writelines(original)
|
||||||
else:
|
else:
|
||||||
with open(os.path.join(filepath, "app", "renderer", "preload.js"), 'a', encoding='UTF-8') as append:
|
with open(os.path.join(filepath, 'app', 'renderer', 'preload.js'), 'a', encoding='UTF-8') as append:
|
||||||
append.write('\n\n')
|
append.write('\n\n')
|
||||||
with open(os.path.join(filepath, "app", "renderer", "preload.js"), 'a', encoding='UTF-8') as append:
|
with open(os.path.join(filepath, 'app', 'renderer', 'preload.js'), 'a', encoding='UTF-8') as append:
|
||||||
print(
|
print(
|
||||||
f' ...linking to {os.path.join(".", "resources", "user.css")}')
|
f' ...linking to {os.path.join(".", "resources", "user.css")}')
|
||||||
with open(os.path.join(__dirname__, 'resources', 'preload.js'), 'r', encoding='UTF-8') as insert:
|
with open(os.path.join(__dirname__, 'resources', 'preload.js'), 'r', encoding='UTF-8') as insert:
|
||||||
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 110 KiB |
@ -17,6 +17,7 @@ let tray;
|
|||||||
function enhancements() {
|
function enhancements() {
|
||||||
const { Tray, Menu, nativeImage, app } = require('electron'),
|
const { Tray, Menu, nativeImage, app } = require('electron'),
|
||||||
isMac = process.platform === 'darwin',
|
isMac = process.platform === 'darwin',
|
||||||
|
isWin = process.platform.includes('win'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
store = require(path.join(__dirname, '..', 'store.js'))({
|
store = require(path.join(__dirname, '..', 'store.js'))({
|
||||||
config: 'user-preferences',
|
config: 'user-preferences',
|
||||||
@ -28,12 +29,14 @@ function enhancements() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
tray = new Tray(
|
tray = new Tray(
|
||||||
isMac
|
isWin
|
||||||
? new nativeImage.createFromPath('☃☃☃resources☃☃☃/icons/mac.png').resize({
|
? '☃☃☃resources☃☃☃/icons/windows.ico'
|
||||||
width: 16,
|
: new nativeImage.createFromPath('☃☃☃resources☃☃☃/icons/tray.png').resize(
|
||||||
height: 16,
|
{
|
||||||
})
|
width: 16,
|
||||||
: '☃☃☃resources☃☃☃/icons/tray.ico'
|
height: 16,
|
||||||
|
}
|
||||||
|
)
|
||||||
);
|
);
|
||||||
const contextMenu = Menu.buildFromTemplate([
|
const contextMenu = Menu.buildFromTemplate([
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user