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:
|
||||
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(
|
||||
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():
|
||||
print(' * preload.js already added. replacing it.')
|
||||
content.seek(0)
|
||||
@ -116,12 +116,12 @@ try:
|
||||
if '/* === INJECTION MARKER === */' in line:
|
||||
break
|
||||
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)
|
||||
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')
|
||||
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(
|
||||
f' ...linking to {os.path.join(".", "resources", "user.css")}')
|
||||
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() {
|
||||
const { Tray, Menu, nativeImage, app } = require('electron'),
|
||||
isMac = process.platform === 'darwin',
|
||||
isWin = process.platform.includes('win'),
|
||||
path = require('path'),
|
||||
store = require(path.join(__dirname, '..', 'store.js'))({
|
||||
config: 'user-preferences',
|
||||
@ -28,12 +29,14 @@ function enhancements() {
|
||||
},
|
||||
});
|
||||
tray = new Tray(
|
||||
isMac
|
||||
? new nativeImage.createFromPath('☃☃☃resources☃☃☃/icons/mac.png').resize({
|
||||
width: 16,
|
||||
height: 16,
|
||||
})
|
||||
: '☃☃☃resources☃☃☃/icons/tray.ico'
|
||||
isWin
|
||||
? '☃☃☃resources☃☃☃/icons/windows.ico'
|
||||
: new nativeImage.createFromPath('☃☃☃resources☃☃☃/icons/tray.png').resize(
|
||||
{
|
||||
width: 16,
|
||||
height: 16,
|
||||
}
|
||||
)
|
||||
);
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user