Files
colorshell/ags/scripts/reload-handler.ts
T

18 lines
461 B
TypeScript

import { Gio, monitorFile, Process } from "astal";
const monitoringPaths = [ "./scripts", "./widget", "./app.ts", "env.d.ts" ];
function restartInstance(instanceName?: string) {
Process.exec_async(`ags run`, () => {});
Process.exec_async(`astal -q ${ instanceName ? instanceName : "astal" }`, () => {});
}
monitoringPaths.map((path: string) => {
monitorFile(
path,
() => {
restartInstance("astal");
}
)
})