mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2026-01-04 06:42:48 +00:00
feat: update ags
This commit is contained in:
@@ -1,58 +1,21 @@
|
||||
// Import
|
||||
import { App, Utils } from "./imports.js";
|
||||
// Windows
|
||||
import Bar from "./windows/bar.js";
|
||||
import Cheatsheet from "./windows/cheatsheet.js";
|
||||
import {
|
||||
CornerTopleft,
|
||||
CornerTopright,
|
||||
CornerBottomleft,
|
||||
CornerBottomright,
|
||||
} from "./windows/corners.js";
|
||||
import Indicator from "./windows/osd.js";
|
||||
import Osk from "./windows/osk.js";
|
||||
import Overview from "./windows/overview.js";
|
||||
import Session from "./windows/session.js";
|
||||
import SideLeft from "./windows/sideleft.js";
|
||||
import SideRight from "./windows/sideright.js";
|
||||
import { readFile } from "resource:///com/github/Aylur/ags/utils.js";
|
||||
import App from "resource:///com/github/Aylur/ags/app.js";
|
||||
import { timeout } from "resource:///com/github/Aylur/ags/utils.js";
|
||||
const pkgjson = JSON.parse(readFile(App.configDir + "/package.json"));
|
||||
|
||||
const CLOSE_ANIM_TIME = 150;
|
||||
timeout(1000, () => JSON.stringify(App));
|
||||
|
||||
// Init
|
||||
Utils.exec(`bash -c 'mkdir -p ~/.cache/ags/user'`);
|
||||
// SCSS compilation
|
||||
Utils.exec(`sassc ${App.configDir}/scss/main.scss ${App.configDir}/style.css`);
|
||||
App.resetCss();
|
||||
App.applyCss(`${App.configDir}/style.css`);
|
||||
|
||||
// Config object
|
||||
export default {
|
||||
style: `${App.configDir}/style.css`,
|
||||
stackTraceOnError: true,
|
||||
closeWindowDelay: {
|
||||
// For animations
|
||||
sideright: CLOSE_ANIM_TIME,
|
||||
sideleft: CLOSE_ANIM_TIME,
|
||||
osk: CLOSE_ANIM_TIME,
|
||||
// No anims, but allow menu service update
|
||||
session: 1,
|
||||
overview: 1,
|
||||
cheatsheet: 1,
|
||||
},
|
||||
windows: [
|
||||
//Bar(),
|
||||
...Array.from({ length: 3 }, (_, i) => [
|
||||
CornerTopleft(i),
|
||||
CornerTopright(i),
|
||||
CornerBottomleft(i),
|
||||
CornerBottomright(i),
|
||||
]),
|
||||
//Overview(),
|
||||
Indicator(),
|
||||
//Cheatsheet(),
|
||||
SideRight(),
|
||||
SideLeft(),
|
||||
//Osk(), // On-screen keyboard
|
||||
//Session(),
|
||||
],
|
||||
const v = {
|
||||
ags: `v${pkg.version}`,
|
||||
expected: `v${pkgjson.version}`,
|
||||
};
|
||||
|
||||
function mismatch() {
|
||||
print(`my config expects ${v.expected}, but your ags is ${v.ags}`);
|
||||
App.connect("config-parsed", (app) => app.Quit());
|
||||
return {};
|
||||
}
|
||||
|
||||
export default v.ags === v.expected
|
||||
? (await import("./js/main.js")).default
|
||||
: mismatch();
|
||||
|
||||
Reference in New Issue
Block a user