mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-18 06:17:21 +00:00
- ModuleManager: Central tracking for installed marketplace modules - DataAnalyzerWidget: Real-time CPU/RAM/Battery/Storage widget (unlocked by Data Analyzer module) - BottomNavBar: Navigation bar for Projects/Chat/Marketplace/Settings - RootShell: Real root command execution utility - TerminalActivity: Full root shell with neofetch, sysinfo, real Linux commands - Terminal Pro module: Adds aliases (ll, la, h), command history - ArcadeActivity + SnakeGame: Pixel Arcade module unlocks retro games - fade_in/fade_out animations for smooth transitions
92 lines
2 KiB
JavaScript
92 lines
2 KiB
JavaScript
import { BrowserWindow } from "electron";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
let mainWindow = null;
|
|
let overlayWindow = null;
|
|
|
|
export function getMainWindow() {
|
|
return mainWindow;
|
|
}
|
|
|
|
export function getOverlayWindow() {
|
|
return overlayWindow;
|
|
}
|
|
|
|
export function getRendererUrl(entryFile = "desktop-main.html") {
|
|
if (process.env.VITE_DEV_SERVER_URL) {
|
|
return `${process.env.VITE_DEV_SERVER_URL}/${entryFile}`;
|
|
}
|
|
return `file://${path.join(__dirname, "../dist/desktop", entryFile)}`;
|
|
}
|
|
|
|
export function createMainWindow() {
|
|
mainWindow = new BrowserWindow({
|
|
width: 1280,
|
|
height: 800,
|
|
minWidth: 800,
|
|
minHeight: 600,
|
|
frame: false,
|
|
titleBarStyle: "hidden",
|
|
backgroundColor: "#030712",
|
|
show: false,
|
|
webPreferences: {
|
|
preload: path.join(__dirname, "preload.js"),
|
|
contextIsolation: true,
|
|
nodeIntegration: false,
|
|
},
|
|
});
|
|
|
|
mainWindow.loadURL(getRendererUrl("desktop-main.html"));
|
|
|
|
mainWindow.once("ready-to-show", () => {
|
|
mainWindow.show();
|
|
});
|
|
|
|
mainWindow.on("closed", () => {
|
|
mainWindow = null;
|
|
});
|
|
|
|
return mainWindow;
|
|
}
|
|
|
|
export function createOverlayWindow() {
|
|
overlayWindow = new BrowserWindow({
|
|
width: 380,
|
|
height: 320,
|
|
transparent: true,
|
|
frame: false,
|
|
alwaysOnTop: true,
|
|
resizable: true,
|
|
focusable: true,
|
|
skipTaskbar: true,
|
|
backgroundColor: "#00000000",
|
|
webPreferences: {
|
|
preload: path.join(__dirname, "preload.js"),
|
|
contextIsolation: true,
|
|
nodeIntegration: false,
|
|
},
|
|
});
|
|
|
|
overlayWindow.setAlwaysOnTop(true, "floating");
|
|
overlayWindow.loadURL(getRendererUrl("desktop-overlay.html"));
|
|
|
|
overlayWindow.on("closed", () => {
|
|
overlayWindow = null;
|
|
});
|
|
|
|
return overlayWindow;
|
|
}
|
|
|
|
export function toggleMainVisibility() {
|
|
if (!mainWindow) return;
|
|
if (mainWindow.isVisible()) {
|
|
mainWindow.hide();
|
|
} else {
|
|
mainWindow.show();
|
|
mainWindow.focus();
|
|
}
|
|
}
|