mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-18 14:27:20 +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
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
import { ipcMain } from "electron";
|
|
import { getMainWindow } from "./windows.js";
|
|
import { startWatcher, stopWatcher } from "../services/watcher.js";
|
|
|
|
let pinned = false;
|
|
|
|
export function registerIpcHandlers() {
|
|
ipcMain.handle("watcher:start", async (_event, dir) => {
|
|
if (!dir || typeof dir !== "string") {
|
|
throw new Error("Invalid directory path");
|
|
}
|
|
await startWatcher(dir);
|
|
return true;
|
|
});
|
|
|
|
ipcMain.handle("watcher:stop", async () => {
|
|
await stopWatcher();
|
|
return true;
|
|
});
|
|
|
|
ipcMain.handle("window:toggle-pin", () => {
|
|
const mainWindow = getMainWindow();
|
|
pinned = !pinned;
|
|
mainWindow?.setAlwaysOnTop(pinned, "floating");
|
|
return pinned;
|
|
});
|
|
|
|
ipcMain.handle("window:close", () => {
|
|
const mainWindow = getMainWindow();
|
|
mainWindow?.close();
|
|
});
|
|
|
|
ipcMain.handle("window:minimize", () => {
|
|
const mainWindow = getMainWindow();
|
|
mainWindow?.minimize();
|
|
});
|
|
|
|
ipcMain.handle("window:maximize", () => {
|
|
const mainWindow = getMainWindow();
|
|
if (!mainWindow) return false;
|
|
if (mainWindow.isMaximized()) {
|
|
mainWindow.unmaximize();
|
|
} else {
|
|
mainWindow.maximize();
|
|
}
|
|
return mainWindow.isMaximized();
|
|
});
|
|
|
|
ipcMain.handle("window:is-pinned", () => {
|
|
return pinned;
|
|
});
|
|
}
|