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