From b4aca729ddae0526b66822698db7066cb09e1682 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 12 Jan 2025 18:00:54 +1100 Subject: bar --- app.tsx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app.tsx (limited to 'app.tsx') diff --git a/app.tsx b/app.tsx new file mode 100644 index 0000000..4f61699 --- /dev/null +++ b/app.tsx @@ -0,0 +1,28 @@ +import { execAsync, GLib, writeFileAsync } from "astal"; +import { App } from "astal/gtk3"; +import AstalHyprland from "gi://AstalHyprland"; +import Bar from "./modules/bar"; + +const loadStyleAsync = async () => { + if (!GLib.file_test(`${SRC}/scss/scheme/_index.scss`, GLib.FileTest.EXISTS)) + await writeFileAsync(`${SRC}/scss/scheme/_index.scss`, '@forward "mocha";'); + App.apply_css(await execAsync(`sass ${SRC}/style.scss`), true); +}; + +App.start({ + instanceName: "caelestia", + icons: "assets/icons", + main() { + loadStyleAsync().catch(console.error); + + AstalHyprland.get_default().monitors.forEach(m => ); + + console.log("Caelestia started"); + }, + requestHandler(request, res) { + if (request === "reload css") loadStyleAsync().catch(console.error); + else return res("Unknown command: " + request); + console.log(`Request handled: ${request}`); + res("OK"); + }, +}); -- cgit v1.2.3-freya