blob: 4f616997c8a2d87bc0f8c094127b75ffd00d5c47 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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");
},
});
|