ags(bar,scripts,i18n): added i18n system(wip), changed some bar stuff and started doing control center
This commit is contained in:
@@ -1,17 +1,30 @@
|
||||
import { monitorFile, Process } from "astal";
|
||||
import { astalInstanceName } from "../app";
|
||||
import { getUserDirs } from "./user";
|
||||
|
||||
const monitoringPaths = [ "./scripts", "./widget", "./app.ts", "env.d.ts" ];
|
||||
const monitoringPaths = [ "./scripts", "./window", "./app.ts", "env.d.ts" ];
|
||||
|
||||
function restartInstance(instanceName?: string) {
|
||||
Process.exec_async(`ags run`, () => {});
|
||||
Process.exec_async(`astal -q ${ instanceName ? instanceName : "astal" }`, () => {});
|
||||
interface InstanceProps {
|
||||
instanceName?: string;
|
||||
log?: boolean;
|
||||
}
|
||||
|
||||
monitoringPaths.map((path: string) => {
|
||||
monitorFile(
|
||||
path,
|
||||
() => {
|
||||
restartInstance("astal");
|
||||
}
|
||||
export function restartInstance(props: InstanceProps = { instanceName: "astal", log: false }): void {
|
||||
Process.exec_async(`astal -q ${props.instanceName}`, () => {});
|
||||
Process.exec_async(`ags run ${ props.log && `--log-file
|
||||
${ getUserDirs().cache}/ags-${ astalInstanceName || "astal" }.log` }`.replaceAll('\n', ' ').trim(),
|
||||
() => {}
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
export function monitorPaths(): void {
|
||||
monitoringPaths.map((path: string) => {
|
||||
monitorFile(
|
||||
path,
|
||||
() => restartInstance({
|
||||
instanceName: astalInstanceName || "astal",
|
||||
log: true
|
||||
})
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user