summaryrefslogtreecommitdiff
path: root/app.tsx
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-01-12 18:00:54 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-01-12 18:00:54 +1100
commitb4aca729ddae0526b66822698db7066cb09e1682 (patch)
tree2a406cca4cfc616dd22ce7c1be61cc20d5db85bc /app.tsx
parentInitial commit (diff)
downloadcaelestia-shell-b4aca729ddae0526b66822698db7066cb09e1682.tar.gz
caelestia-shell-b4aca729ddae0526b66822698db7066cb09e1682.tar.bz2
caelestia-shell-b4aca729ddae0526b66822698db7066cb09e1682.zip
bar
Diffstat (limited to 'app.tsx')
-rw-r--r--app.tsx28
1 files changed, 28 insertions, 0 deletions
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 => <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");
+ },
+});