libre-webui 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/electron/main.js CHANGED
@@ -9,11 +9,33 @@
9
9
  * http://www.apache.org/licenses/LICENSE-2.0
10
10
  */
11
11
 
12
- const { app, BrowserWindow, shell, Menu, dialog, nativeTheme } = require('electron');
12
+ const { app, BrowserWindow, shell, Menu, dialog, nativeTheme, nativeImage } = require('electron');
13
13
  const path = require('path');
14
14
  const http = require('http');
15
15
  const { spawn } = require('child_process');
16
16
 
17
+ // Get icon path for Linux (icons are in extraResources for production)
18
+ const getIconPath = () => {
19
+ const isDev = process.env.NODE_ENV === 'development' || !app.isPackaged;
20
+ if (isDev) {
21
+ return path.join(__dirname, 'assets', 'icons', '256x256.png');
22
+ }
23
+ return path.join(process.resourcesPath, 'icons', '256x256.png');
24
+ };
25
+
26
+ // Set app icon for Linux About dialog
27
+ if (process.platform === 'linux') {
28
+ app.whenReady().then(() => {
29
+ const iconPath = getIconPath();
30
+ app.setAboutPanelOptions({
31
+ applicationName: 'Libre WebUI',
32
+ applicationVersion: app.getVersion(),
33
+ copyright: 'Copyright © 2025 Kroonen AI, Inc.',
34
+ iconPath: iconPath,
35
+ });
36
+ });
37
+ }
38
+
17
39
  // Prevent multiple instances (fixes fork bomb issue)
18
40
  const gotTheLock = app.requestSingleInstanceLock();
19
41
  if (!gotTheLock) {
@@ -60,12 +82,20 @@ function createSplashWindow() {
60
82
 
61
83
  // Create the main application window
62
84
  function createMainWindow() {
85
+ // Get icon for Linux
86
+ let windowIcon;
87
+ if (process.platform === 'linux') {
88
+ const iconPath = getIconPath();
89
+ windowIcon = nativeImage.createFromPath(iconPath);
90
+ }
91
+
63
92
  mainWindow = new BrowserWindow({
64
93
  width: 1400,
65
94
  height: 900,
66
95
  minWidth: 800,
67
96
  minHeight: 600,
68
97
  show: false,
98
+ icon: windowIcon,
69
99
  titleBarStyle: 'hiddenInset',
70
100
  trafficLightPosition: { x: 12, y: 12 },
71
101
  backgroundColor: nativeTheme.shouldUseDarkColors ? '#1a1a1a' : '#ffffff',