gex: rename gnome-44, add gnome-45

This commit is contained in:
Luke D. Jones
2023-08-31 14:36:01 +12:00
parent cf92526d87
commit 5f6e6ec382
63 changed files with 6178 additions and 4 deletions

View File

@@ -0,0 +1,49 @@
import * as Resources from "../resources";
import Gio from 'gi://Gio';
export class DbusBase {
dbus_proxy: any = null; // type: Gio.DbusProxy
connected = false;
xml_resource = "";
dbus_path = "";
constructor(resource: string, dbus_path: string) {
this.xml_resource = resource;
this.dbus_path = dbus_path;
}
async start() {
//@ts-ignore
log(`Starting ${this.dbus_path} dbus module`);
try {
const xml = Resources.File.DBus(this.xml_resource);
this.dbus_proxy = new Gio.DBusProxy.makeProxyWrapper(xml)(
Gio.DBus.system,
"org.asuslinux.Daemon",
this.dbus_path,
);
this.connected = true;
//@ts-ignore
log(`${this.dbus_path} client started successfully.`);
} catch (e) {
//@ts-ignore
logError(`${this.xml_resource} dbus init failed!`, e);
}
}
async stop() {
//@ts-ignore
log(`Stopping ${this.xml_resource} dbus module`);
if (this.connected) {
this.dbus_proxy.destroy();
this.connected = false;
this.dbus_proxy = null;
}
}
isRunning(): boolean {
return this.connected;
}
}