mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
gex: rename gnome-44, add gnome-45
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
declare const imports: any;
|
||||
|
||||
import { AnimeDbus } from "../dbus/animatrix";
|
||||
|
||||
const { GObject } = imports.gi;
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
|
||||
export const MenuToggleAnimePower = GObject.registerClass(
|
||||
class MenuToggleAnimePower extends PopupMenu.PopupSwitchMenuItem {
|
||||
private _dbus_anime: AnimeDbus;
|
||||
public toggle_callback = () => {};
|
||||
|
||||
constructor(dbus_anime: AnimeDbus) {
|
||||
super(
|
||||
"AniMatrix Display Power", dbus_anime.deviceState.display_enabled
|
||||
);
|
||||
this._dbus_anime = dbus_anime;
|
||||
this.label = "AniMatrix Display Power";
|
||||
this._settings = ExtensionUtils.getSettings();
|
||||
|
||||
this.connectObject(
|
||||
"destroy", () => this._settings.run_dispose(),
|
||||
"toggled", () => this._toggleMode(),
|
||||
this);
|
||||
|
||||
this.connect("destroy", () => {
|
||||
this.destroy();
|
||||
});
|
||||
|
||||
this.sync();
|
||||
}
|
||||
|
||||
_toggleMode() {
|
||||
this._dbus_anime.getDeviceState();
|
||||
if (this.state !== this._dbus_anime.deviceState.display_enabled)
|
||||
this._dbus_anime.setEnableDisplay(this.state);
|
||||
this.toggle_callback();
|
||||
}
|
||||
|
||||
sync() {
|
||||
this._dbus_anime.getDeviceState();
|
||||
const checked = this._dbus_anime.deviceState.display_enabled;
|
||||
this.setToggleState(checked);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
export const MenuToggleAnimeBuiltins = GObject.registerClass(
|
||||
class MenuToggleAnimeBuiltins extends PopupMenu.PopupSwitchMenuItem {
|
||||
private _dbus_anime: AnimeDbus;
|
||||
public toggle_callback = () => {};
|
||||
|
||||
constructor(dbus_anime: AnimeDbus) {
|
||||
super(
|
||||
"AniMatrix Powersave Animation", dbus_anime.deviceState.builtin_anims_enabled
|
||||
);
|
||||
this._dbus_anime = dbus_anime;
|
||||
this.label = "AniMatrix Powersave Animation";
|
||||
this._settings = ExtensionUtils.getSettings();
|
||||
|
||||
this.connectObject(
|
||||
"destroy", () => this._settings.run_dispose(),
|
||||
"toggled", () => this._toggleMode(),
|
||||
this);
|
||||
|
||||
this.connect("destroy", () => {
|
||||
this.destroy();
|
||||
});
|
||||
|
||||
this.sync();
|
||||
}
|
||||
|
||||
_toggleMode() {
|
||||
this._dbus_anime.getDeviceState();
|
||||
if (this.state !== this._dbus_anime.deviceState.builtin_anims_enabled)
|
||||
this._dbus_anime.setPowersaveAnim(this.state);
|
||||
this.toggle_callback();
|
||||
}
|
||||
|
||||
sync() {
|
||||
this._dbus_anime.getDeviceState();
|
||||
const checked = this._dbus_anime.deviceState.display_enabled;
|
||||
this.setToggleState(checked);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
declare const imports: any;
|
||||
|
||||
import { Platform } from "../dbus/platform";
|
||||
|
||||
const { GObject, Gio } = imports.gi;
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
|
||||
export const MenuToggleMiniLed = GObject.registerClass(
|
||||
class MenuToggleMiniLed extends PopupMenu.PopupSwitchMenuItem {
|
||||
private _dbus_platform: Platform;
|
||||
public toggle_callback = () => {};
|
||||
|
||||
constructor(dbus_platform: Platform) {
|
||||
super("MiniLED", dbus_platform.bios.mini_led_mode);
|
||||
|
||||
this._dbus_platform = dbus_platform;
|
||||
this.label = "MiniLED";
|
||||
this._settings = ExtensionUtils.getSettings();
|
||||
|
||||
this.connectObject(
|
||||
"destroy", () => this._settings.run_dispose(),
|
||||
"toggled", () => this._toggleMode(),
|
||||
this);
|
||||
|
||||
this.connect("destroy", () => {
|
||||
this.destroy();
|
||||
});
|
||||
|
||||
this.sync();
|
||||
}
|
||||
|
||||
_toggleMode() {
|
||||
this._dbus_platform.getMiniLedMode();
|
||||
const state = this._dbus_platform.bios.mini_led_mode;
|
||||
if (this.state !== state)
|
||||
this._dbus_platform.setMiniLedMode(this.state);
|
||||
this.toggle_callback();
|
||||
}
|
||||
|
||||
sync() {
|
||||
this._dbus_platform.getMiniLedMode();
|
||||
const toggled = this._dbus_platform.bios.mini_led_mode;
|
||||
this.setToggleState(toggled);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
declare const imports: any;
|
||||
|
||||
import { Platform } from "../dbus/platform";
|
||||
|
||||
const { GObject, Gio } = imports.gi;
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
|
||||
export const MenuTogglePanelOd = GObject.registerClass(
|
||||
class MenuTogglePanelOd extends PopupMenu.PopupSwitchMenuItem {
|
||||
private _dbus_platform: Platform;
|
||||
public toggle_callback = () => {};
|
||||
|
||||
constructor(dbus_platform: Platform) {
|
||||
super("Panel Overdrive", dbus_platform.bios.panel_overdrive);
|
||||
|
||||
this._dbus_platform = dbus_platform;
|
||||
this.label = "Panel Overdrive";
|
||||
this._settings = ExtensionUtils.getSettings();
|
||||
|
||||
this.connectObject(
|
||||
"destroy", () => this._settings.run_dispose(),
|
||||
"toggled", () => this._toggleMode(),
|
||||
this);
|
||||
|
||||
this.connect("destroy", () => {
|
||||
this.destroy();
|
||||
});
|
||||
|
||||
this.sync();
|
||||
}
|
||||
|
||||
_toggleMode() {
|
||||
this._dbus_platform.getPanelOd();
|
||||
const state = this._dbus_platform.bios.panel_overdrive;
|
||||
if (this.state !== state)
|
||||
this._dbus_platform.setPanelOd(this.state);
|
||||
this.toggle_callback();
|
||||
}
|
||||
|
||||
sync() {
|
||||
this._dbus_platform.getPanelOd();
|
||||
const toggled = this._dbus_platform.bios.panel_overdrive;
|
||||
this.setToggleState(toggled);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user