mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 09:23:19 +01:00
gex: cleanup
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
declare const imports: any;
|
||||
var asusctlGexInstance: any;
|
||||
var extensionInstance: any;
|
||||
//@ts-ignore
|
||||
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||
// const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||
|
||||
// REF: https://gjs.guide/extensions/development/creating.html
|
||||
|
||||
@@ -11,10 +11,10 @@ const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const { QuickToggle, SystemIndicator } = imports.ui.quickSettings;
|
||||
const QuickSettingsMenu = imports.ui.main.panel.statusArea.quickSettings;
|
||||
|
||||
import { AnimeDbus } from './modules/anime_dbus';
|
||||
import { Power } from './modules/power_dbus';
|
||||
import { Supported } from './modules/supported_dbus';
|
||||
import { Platform } from './modules/platform_dbus';
|
||||
import { AnimeDbus } from './modules/dbus/animatrix';
|
||||
import { Power } from './modules/dbus/power';
|
||||
import { Supported } from './modules/dbus/supported';
|
||||
import { Platform } from './modules/dbus/platform';
|
||||
|
||||
const QuickMiniLed = GObject.registerClass(
|
||||
class QuickMiniLed extends QuickToggle {
|
||||
@@ -23,7 +23,7 @@ const QuickMiniLed = GObject.registerClass(
|
||||
title: 'MiniLED',
|
||||
iconName: 'selection-mode-symbolic',
|
||||
toggleMode: true,
|
||||
checked: asusctlGexInstance.dbus_platform.bios.mini_led_mode,
|
||||
checked: extensionInstance.dbus_platform.bios.mini_led_mode,
|
||||
});
|
||||
|
||||
this.label = 'MiniLED';
|
||||
@@ -44,12 +44,12 @@ const QuickMiniLed = GObject.registerClass(
|
||||
}
|
||||
|
||||
_toggleMode() {
|
||||
asusctlGexInstance.dbus_platform.setMiniLedMode(this.checked);
|
||||
extensionInstance.dbus_platform.setMiniLedMode(this.checked);
|
||||
this._sync();
|
||||
}
|
||||
|
||||
_sync() {
|
||||
const checked = asusctlGexInstance.dbus_platform.getMiniLedMode();
|
||||
const checked = extensionInstance.dbus_platform.getMiniLedMode();
|
||||
if (this.checked !== checked)
|
||||
this.set({ checked });
|
||||
// this.set_property('checked', checked);
|
||||
@@ -105,12 +105,12 @@ const QuickPanelOd = GObject.registerClass(
|
||||
}
|
||||
|
||||
_toggleMode() {
|
||||
asusctlGexInstance.dbus_platform.setPanelOd(this.checked);
|
||||
extensionInstance.dbus_platform.setPanelOd(this.checked);
|
||||
this._sync();
|
||||
}
|
||||
|
||||
_sync() {
|
||||
const checked = asusctlGexInstance.dbus_platform.getPanelOd();
|
||||
const checked = extensionInstance.dbus_platform.getPanelOd();
|
||||
if (this.checked !== checked)
|
||||
this.set({ checked });
|
||||
}
|
||||
@@ -174,6 +174,6 @@ class Extension {
|
||||
|
||||
//@ts-ignore
|
||||
function init() {
|
||||
asusctlGexInstance = new Extension();
|
||||
return new Extension();
|
||||
extensionInstance = new Extension();
|
||||
return extensionInstance;
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
declare const global: any, imports: any;
|
||||
declare var asusctlGexInstance: any;
|
||||
declare const imports: any;
|
||||
//@ts-ignore
|
||||
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||
|
||||
import { DbusBase } from '../modules/dbus';
|
||||
import { DeviceState, AnimBooting, Brightness, AnimAwake, AnimSleeping, AnimShutdown } from '../bindings/anime';
|
||||
import { DbusBase } from './base';
|
||||
import { DeviceState, AnimBooting, Brightness, AnimAwake, AnimSleeping, AnimShutdown } from '../../bindings/anime';
|
||||
|
||||
export class AnimeDbus extends DbusBase {
|
||||
deviceState: DeviceState = {
|
||||
@@ -1,8 +1,8 @@
|
||||
declare const global: any, imports: any;
|
||||
declare const imports: any;
|
||||
//@ts-ignore
|
||||
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||
|
||||
import * as Resources from '../modules/resources';
|
||||
import * as Resources from '../resources';
|
||||
|
||||
const { Gio } = imports.gi;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
declare const global: any, imports: any;
|
||||
declare var asusctlGexInstance: any;
|
||||
declare const imports: any;
|
||||
//@ts-ignore
|
||||
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||
|
||||
import * as bios from '../bindings/platform';
|
||||
import { DbusBase } from '../modules/dbus';
|
||||
import * as bios from '../../bindings/platform';
|
||||
import { DbusBase } from './base';
|
||||
|
||||
// TODO: add callbacks for notifications
|
||||
export class Platform extends DbusBase {
|
||||
@@ -1,9 +1,8 @@
|
||||
declare const global: any, imports: any;
|
||||
declare var asusctlGexInstance: any;
|
||||
declare const imports: any;
|
||||
//@ts-ignore
|
||||
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||
|
||||
import { DbusBase } from '../modules/dbus';
|
||||
import { DbusBase } from './base';
|
||||
|
||||
// function getMethods(obj: { [x: string]: { toString: () => string; }; }) {
|
||||
// var result = [];
|
||||
@@ -2,9 +2,9 @@ declare const global: any, imports: any;
|
||||
//@ts-ignore
|
||||
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||
|
||||
import { SupportedFunctions, AdvancedAura } from '../bindings/platform';
|
||||
import { AuraDevice, AuraModeNum, AuraZone } from '../bindings/aura';
|
||||
import { DbusBase } from '../modules/dbus';
|
||||
import { SupportedFunctions, AdvancedAura } from '../../bindings/platform';
|
||||
import { AuraDevice, AuraModeNum, AuraZone } from '../../bindings/aura';
|
||||
import { DbusBase } from './base';
|
||||
|
||||
export class Supported extends DbusBase {
|
||||
// False,
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"lib": ["es2019"],
|
||||
"lib": [
|
||||
"es2019"
|
||||
],
|
||||
"types": [],
|
||||
"target": "es2019",
|
||||
"module": "CommonJS",
|
||||
@@ -10,9 +12,11 @@
|
||||
"strict": true,
|
||||
"allowJs": true
|
||||
},
|
||||
"include": [],
|
||||
"files": [
|
||||
"./src/extension.ts",
|
||||
],
|
||||
"include": [
|
||||
"src/*.ts",
|
||||
"src/**/*.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user