mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-08 18:08:33 +00:00
IDE startup theme based on OS theme (#1160)
* add patch for setting IDE startup theme based on OS theme * Patched the default theme behavior. Signed-off-by: Akos Kitta <a.kitta@arduino.cc> * add custom themes in register Co-authored-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
29
electron/build/patch/backend/main.js
Normal file
29
electron/build/patch/backend/main.js
Normal file
@@ -0,0 +1,29 @@
|
||||
// @ts-check
|
||||
const { setup, log } = require('node-log-rotate');
|
||||
setup({
|
||||
appName: 'Arduino IDE',
|
||||
maxSize: 10 * 1024 * 1024
|
||||
});
|
||||
for (const name of ['log', 'trace', 'info', 'warn', 'error']) {
|
||||
const original = console[name];
|
||||
console[name] = (data => {
|
||||
original(data);
|
||||
log(data);
|
||||
}).bind(console);
|
||||
}
|
||||
|
||||
const { BackendApplicationConfigProvider } = require('@theia/core/lib/node/backend-application-config-provider');
|
||||
const main = require('@theia/core/lib/node/main');
|
||||
BackendApplicationConfigProvider.set({
|
||||
"configDirName": ".arduinoIDE",
|
||||
"singleInstance": true
|
||||
});
|
||||
|
||||
const serverModule = require('./server');
|
||||
const serverAddress = main.start(serverModule());
|
||||
serverAddress.then(function ({ port, address }) {
|
||||
if (process && process.send) {
|
||||
process.send({ port, address });
|
||||
}
|
||||
});
|
||||
module.exports = serverAddress;
|
||||
Reference in New Issue
Block a user