diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-12 18:00:54 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-12 18:00:54 +1100 |
| commit | b4aca729ddae0526b66822698db7066cb09e1682 (patch) | |
| tree | 2a406cca4cfc616dd22ce7c1be61cc20d5db85bc /app.tsx | |
| parent | Initial commit (diff) | |
| download | caelestia-shell-b4aca729ddae0526b66822698db7066cb09e1682.tar.gz caelestia-shell-b4aca729ddae0526b66822698db7066cb09e1682.tar.bz2 caelestia-shell-b4aca729ddae0526b66822698db7066cb09e1682.zip | |
bar
Diffstat (limited to 'app.tsx')
| -rw-r--r-- | app.tsx | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -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 => <Bar monitor={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"); + }, +}); |