From 0a69c23288b7f3518609ed5e1105debd37564bf0 Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Sun, 3 Dec 2023 20:44:01 +0000 Subject: [PATCH] Fluke/dbus refactor --- .gitignore | 1 + CHANGELOG.md | 5 +- Cargo.lock | 30 +- Cargo.toml | 6 +- Makefile | 6 +- asusctl/examples/aura-zoned-breathe.rs | 2 +- asusctl/src/aura_cli.rs | 6 +- asusctl/src/cli_opts.rs | 21 +- .../src/{profiles_cli.rs => fan_curve_cli.rs} | 23 +- asusctl/src/main.rs | 264 ++- asusd-user/src/daemon.rs | 16 +- asusd-user/src/lib.rs | 2 - asusd/Cargo.toml | 1 - asusd/src/config.rs | 19 +- asusd/src/ctrl_anime/mod.rs | 14 - asusd/src/ctrl_anime/trait_impls.rs | 150 +- asusd/src/ctrl_aura/controller.rs | 219 +- asusd/src/ctrl_aura/trait_impls.rs | 295 ++- asusd/src/ctrl_fancurves.rs | 295 +++ asusd/src/ctrl_platform.rs | 438 +++- asusd/src/ctrl_power.rs | 297 --- asusd/src/ctrl_profiles/config.rs | 60 - asusd/src/ctrl_profiles/controller.rs | 171 -- asusd/src/ctrl_profiles/mod.rs | 4 - asusd/src/ctrl_profiles/trait_impls.rs | 332 --- asusd/src/ctrl_supported.rs | 49 - asusd/src/daemon.rs | 47 +- asusd/src/lib.rs | 105 +- bindings/dbus-xml/org-asuslinux-anime-4.xml | 86 +- bindings/dbus-xml/org-asuslinux-aura-4.xml | 98 +- ...e-4.xml => org-asuslinux-fan-curves-4.xml} | 54 +- .../dbus-xml/org-asuslinux-platform-4.xml | 81 +- bindings/dbus-xml/org-asuslinux-power-4.xml | 20 - .../dbus-xml/org-asuslinux-supported-4.xml | 12 - bindings/ts/anime.ts | 1 + bindings/ts/aura.ts | 3 +- bindings/ts/platform.ts | 70 +- bindings/ts/profiles.ts | 21 +- data/asusd.rules | 3 - data/asusd.service | 10 +- desktop-extensions/gnome-44/.eslintrc.cjs | 25 - desktop-extensions/gnome-44/LICENSE | 373 --- desktop-extensions/gnome-44/README.md | 21 - desktop-extensions/gnome-44/esbuild.js | 65 - desktop-extensions/gnome-44/package-lock.json | 2002 ----------------- desktop-extensions/gnome-44/package.json | 40 - ...shell.extensions.asusctl-gnome.gschema.xml | 21 - desktop-extensions/gnome-44/src/bindings | 1 - desktop-extensions/gnome-44/src/extension.ts | 112 - desktop-extensions/gnome-44/src/metadata.json | 11 - .../gnome-44/src/modules/dbus/animatrix.ts | 119 - .../gnome-44/src/modules/dbus/aura.ts | 284 --- .../gnome-44/src/modules/dbus/base.ts | 52 - .../gnome-44/src/modules/dbus/platform.ts | 202 -- .../gnome-44/src/modules/dbus/power.ts | 99 - .../gnome-44/src/modules/dbus/supported.ts | 106 - .../gnome-44/src/modules/helpers.ts | 15 - .../src/modules/indicators/mini_led.ts | 28 - .../src/modules/menu_toggles/anime.ts | 86 - .../src/modules/menu_toggles/mini_led.ts | 46 - .../src/modules/menu_toggles/panel_od.ts | 46 - .../gnome-44/src/modules/quick_menus/aura.ts | 86 - .../modules/quick_menus/laptop_features.ts | 179 -- .../src/modules/quick_toggles/anime_power.ts | 56 - .../src/modules/quick_toggles/mini_led.ts | 54 - .../src/modules/quick_toggles/panel_od.ts | 54 - .../gnome-44/src/modules/resources.ts | 20 - .../gnome-44/src/modules/sliders/charge.ts | 60 - desktop-extensions/gnome-44/tsconfig.json | 22 - desktop-extensions/gnome-44/yarn.lock | 940 -------- desktop-extensions/gnome-45/.eslintrc.cjs | 34 +- desktop-extensions/gnome-45/.prettierignore | 13 + desktop-extensions/gnome-45/.prettierrc.json | 9 + desktop-extensions/gnome-45/esbuild.js | 64 +- desktop-extensions/gnome-45/package-lock.json | 1053 +++++++-- desktop-extensions/gnome-45/package.json | 25 +- ...shell.extensions.asusctl-gnome.gschema.xml | 3 + desktop-extensions/gnome-45/src/extension.ts | 210 +- .../gnome-45/src/modules/dbus/animatrix.ts | 219 +- .../gnome-45/src/modules/dbus/aura.ts | 544 ++--- .../gnome-45/src/modules/dbus/base.ts | 49 - .../gnome-45/src/modules/dbus/platform.ts | 202 -- .../gnome-45/src/modules/dbus/power.ts | 99 - .../gnome-45/src/modules/dbus/supported.ts | 107 - .../gnome-45/src/modules/dbus_proxy.ts | 64 + .../gnome-45/src/modules/helpers.ts | 22 +- .../src/modules/indicators/gpu_status.ts | 22 - .../src/modules/indicators/mini_led.ts | 23 - .../src/modules/menu_toggles/anime.ts | 79 - .../src/modules/menu_toggles/mini_led.ts | 40 - .../src/modules/menu_toggles/panel_od.ts | 41 - .../gnome-45/src/modules/quick_menus/aura.ts | 132 +- .../modules/quick_menus/laptop_features.ts | 335 +-- .../src/modules/quick_toggles/anime_power.ts | 53 - .../src/modules/quick_toggles/mini_led.ts | 50 - .../src/modules/quick_toggles/panel_od.ts | 49 - .../gnome-45/src/modules/resources.ts | 20 - .../gnome-45/src/modules/rog_indicator.ts | 26 + .../gnome-45/src/modules/rog_menu_toggle.ts | 50 + .../gnome-45/src/modules/rog_quick_toggle.ts | 64 + .../gnome-45/src/modules/rog_slider_100pc.ts | 75 + .../gnome-45/src/modules/sliders/charge.ts | 56 - desktop-extensions/gnome-45/tsconfig.json | 27 +- desktop-extensions/gnome-45/yarn.lock | 980 ++++++-- rog-anime/src/data.rs | 4 +- rog-anime/src/usb.rs | 56 +- rog-aura/src/aura_detection.rs | 18 +- rog-aura/src/builtin_modes.rs | 110 +- rog-aura/src/power.rs | 6 +- rog-aura/src/usb.rs | 48 +- rog-control-center/src/app.rs | 13 +- rog-control-center/src/main.rs | 10 +- .../src/pages/fan_curve_page.rs | 59 +- rog-control-center/src/pages/system_page.rs | 28 +- rog-control-center/src/system_state.rs | 226 +- rog-control-center/src/tray.rs | 140 +- rog-control-center/src/update_and_notify.rs | 144 +- rog-control-center/src/widgets/anime_power.rs | 3 +- .../src/widgets/app_settings.rs | 6 +- rog-control-center/src/widgets/aura_modes.rs | 4 +- rog-control-center/src/widgets/aura_power.rs | 7 +- rog-control-center/src/widgets/fan_graph.rs | 20 +- rog-control-center/src/widgets/mod.rs | 4 +- rog-control-center/src/widgets/rog_bios.rs | 190 +- rog-control-center/src/widgets/side_panel.rs | 6 +- rog-dbus/Cargo.toml | 1 + rog-dbus/src/lib.rs | 71 +- rog-dbus/src/zbus_anime.rs | 85 +- rog-dbus/src/{zbus_led.rs => zbus_aura.rs} | 81 +- .../{zbus_profile.rs => zbus_fan_curves.rs} | 59 +- rog-dbus/src/zbus_platform.rs | 36 +- rog-dbus/src/zbus_power.rs | 46 - rog-dbus/src/zbus_supported.rs | 33 - rog-platform/Cargo.toml | 5 +- rog-platform/src/cpu.rs | 258 +++ rog-platform/src/error.rs | 14 + rog-platform/src/hid_raw.rs | 40 +- rog-platform/src/lib.rs | 2 +- rog-platform/src/platform.rs | 176 +- rog-platform/src/supported.rs | 150 -- rog-profiles/Cargo.toml | 1 + rog-profiles/src/error.rs | 14 + rog-profiles/src/lib.rs | 189 +- 143 files changed, 5421 insertions(+), 10343 deletions(-) rename asusctl/src/{profiles_cli.rs => fan_curve_cli.rs} (71%) create mode 100644 asusd/src/ctrl_fancurves.rs delete mode 100644 asusd/src/ctrl_power.rs delete mode 100644 asusd/src/ctrl_profiles/config.rs delete mode 100644 asusd/src/ctrl_profiles/controller.rs delete mode 100644 asusd/src/ctrl_profiles/mod.rs delete mode 100644 asusd/src/ctrl_profiles/trait_impls.rs delete mode 100644 asusd/src/ctrl_supported.rs rename bindings/dbus-xml/{org-asuslinux-profile-4.xml => org-asuslinux-fan-curves-4.xml} (54%) delete mode 100644 bindings/dbus-xml/org-asuslinux-power-4.xml delete mode 100644 bindings/dbus-xml/org-asuslinux-supported-4.xml delete mode 100644 desktop-extensions/gnome-44/.eslintrc.cjs delete mode 100644 desktop-extensions/gnome-44/LICENSE delete mode 100644 desktop-extensions/gnome-44/README.md delete mode 100644 desktop-extensions/gnome-44/esbuild.js delete mode 100644 desktop-extensions/gnome-44/package-lock.json delete mode 100644 desktop-extensions/gnome-44/package.json delete mode 100644 desktop-extensions/gnome-44/schemas/org.gnome.shell.extensions.asusctl-gnome.gschema.xml delete mode 120000 desktop-extensions/gnome-44/src/bindings delete mode 100644 desktop-extensions/gnome-44/src/extension.ts delete mode 100644 desktop-extensions/gnome-44/src/metadata.json delete mode 100644 desktop-extensions/gnome-44/src/modules/dbus/animatrix.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/dbus/aura.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/dbus/base.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/dbus/platform.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/dbus/power.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/dbus/supported.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/helpers.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/indicators/mini_led.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/menu_toggles/anime.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/menu_toggles/mini_led.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/menu_toggles/panel_od.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/quick_menus/aura.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/quick_menus/laptop_features.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/quick_toggles/anime_power.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/quick_toggles/mini_led.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/quick_toggles/panel_od.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/resources.ts delete mode 100644 desktop-extensions/gnome-44/src/modules/sliders/charge.ts delete mode 100644 desktop-extensions/gnome-44/tsconfig.json delete mode 100644 desktop-extensions/gnome-44/yarn.lock create mode 100644 desktop-extensions/gnome-45/.prettierignore create mode 100644 desktop-extensions/gnome-45/.prettierrc.json delete mode 100644 desktop-extensions/gnome-45/src/modules/dbus/base.ts delete mode 100644 desktop-extensions/gnome-45/src/modules/dbus/platform.ts delete mode 100644 desktop-extensions/gnome-45/src/modules/dbus/power.ts delete mode 100644 desktop-extensions/gnome-45/src/modules/dbus/supported.ts create mode 100644 desktop-extensions/gnome-45/src/modules/dbus_proxy.ts delete mode 100644 desktop-extensions/gnome-45/src/modules/indicators/gpu_status.ts delete mode 100644 desktop-extensions/gnome-45/src/modules/indicators/mini_led.ts delete mode 100644 desktop-extensions/gnome-45/src/modules/menu_toggles/anime.ts delete mode 100644 desktop-extensions/gnome-45/src/modules/menu_toggles/mini_led.ts delete mode 100644 desktop-extensions/gnome-45/src/modules/menu_toggles/panel_od.ts delete mode 100644 desktop-extensions/gnome-45/src/modules/quick_toggles/anime_power.ts delete mode 100644 desktop-extensions/gnome-45/src/modules/quick_toggles/mini_led.ts delete mode 100644 desktop-extensions/gnome-45/src/modules/quick_toggles/panel_od.ts delete mode 100644 desktop-extensions/gnome-45/src/modules/resources.ts create mode 100644 desktop-extensions/gnome-45/src/modules/rog_indicator.ts create mode 100644 desktop-extensions/gnome-45/src/modules/rog_menu_toggle.ts create mode 100644 desktop-extensions/gnome-45/src/modules/rog_quick_toggle.ts create mode 100644 desktop-extensions/gnome-45/src/modules/rog_slider_100pc.ts delete mode 100644 desktop-extensions/gnome-45/src/modules/sliders/charge.ts rename rog-dbus/src/{zbus_led.rs => zbus_aura.rs} (54%) rename rog-dbus/src/{zbus_profile.rs => zbus_fan_curves.rs} (56%) delete mode 100644 rog-dbus/src/zbus_power.rs delete mode 100644 rog-dbus/src/zbus_supported.rs create mode 100644 rog-platform/src/cpu.rs delete mode 100644 rog-platform/src/supported.rs diff --git a/.gitignore b/.gitignore index 266d0fb4..44ee480c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ node-modules bindings/ts/*.d.ts bindings/ts/*.js.map desktop-extensions/gnome*/dist +desktop-extensions/gnome*/@types/gir-generated desktop-extensions/gnome*/node_modules desktop-extensions/gnome*/schemas/gschemas.compiled desktop-extensions/gnome*/*.zip diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d44ea38..ae39f8aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - SetOffWhenLidClosed, also add asusctl CLI option - Anime: add brightness_on_battery config option - Platform: add `post_animation_sound`, kernel 6.7+ requires patch +- Add changing of CPU energy perfromance preference in relation to throttle_thermal_policy. This means that the CPU correctly behaves according to throttle_thermal_policy (and platform profile use is *removed*) +- Add setting of throttle_thermal_policy on power plug/unplug ### Changed - asusd: remove set_image_brightness for anime @@ -31,8 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Ensure builtin animations run instead of custom animations if option is set ### Breaking -- DBUS stuff. Again. - - Platform dbus refactored to Properties as it makes more sense than a pile of functions +- DBUS stuff. Again. All of it. ## [v4.7.2] ### Added diff --git a/Cargo.lock b/Cargo.lock index 330b3acb..a2201628 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -198,7 +198,7 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "asusctl" -version = "4.7.2" +version = "5.0.0-RC1" dependencies = [ "asusd", "cargo-husky", @@ -217,7 +217,7 @@ dependencies = [ [[package]] name = "asusd" -version = "4.7.2" +version = "5.0.0-RC1" dependencies = [ "async-trait", "cargo-husky", @@ -230,7 +230,6 @@ dependencies = [ "logind-zbus", "rog_anime", "rog_aura", - "rog_dbus", "rog_platform", "rog_profiles", "serde", @@ -242,7 +241,7 @@ dependencies = [ [[package]] name = "asusd-user" -version = "4.7.2" +version = "5.0.0-RC1" dependencies = [ "cargo-husky", "config-traits", @@ -785,7 +784,7 @@ dependencies = [ [[package]] name = "config-traits" -version = "4.7.2" +version = "5.0.0-RC1" dependencies = [ "cargo-husky", "log", @@ -838,7 +837,7 @@ dependencies = [ [[package]] name = "cpuctl" -version = "4.7.2" +version = "5.0.0-RC1" [[package]] name = "cpufeatures" @@ -962,7 +961,7 @@ dependencies = [ [[package]] name = "dmi_id" -version = "4.7.2" +version = "5.0.0-RC1" dependencies = [ "log", "udev", @@ -2685,7 +2684,7 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "rog-control-center" -version = "4.7.2" +version = "5.0.0-RC1" dependencies = [ "asusd", "cargo-husky", @@ -2718,7 +2717,7 @@ dependencies = [ [[package]] name = "rog_anime" -version = "4.7.2" +version = "5.0.0-RC1" dependencies = [ "cargo-husky", "dmi_id", @@ -2735,7 +2734,7 @@ dependencies = [ [[package]] name = "rog_aura" -version = "4.7.2" +version = "5.0.0-RC1" dependencies = [ "cargo-husky", "dmi_id", @@ -2749,8 +2748,9 @@ dependencies = [ [[package]] name = "rog_dbus" -version = "4.7.2" +version = "5.0.0-RC1" dependencies = [ + "asusd", "cargo-husky", "rog_anime", "rog_aura", @@ -2761,14 +2761,13 @@ dependencies = [ [[package]] name = "rog_platform" -version = "4.7.2" +version = "5.0.0-RC1" dependencies = [ "cargo-husky", "concat-idents", "inotify", "log", "rog_aura", - "rog_profiles", "rusb", "serde", "serde_derive", @@ -2779,10 +2778,11 @@ dependencies = [ [[package]] name = "rog_profiles" -version = "4.7.2" +version = "5.0.0-RC1" dependencies = [ "cargo-husky", "log", + "rog_platform", "serde", "serde_derive", "typeshare", @@ -2792,7 +2792,7 @@ dependencies = [ [[package]] name = "rog_simulators" -version = "4.7.2" +version = "5.0.0-RC1" dependencies = [ "glam", "log", diff --git a/Cargo.toml b/Cargo.toml index c07a451d..d46e1ff5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,11 +4,11 @@ default-members = ["asusctl", "asusd", "asusd-user", "cpuctl", "rog-control-cent resolver = "2" [workspace.package] -version = "4.7.2" +version = "5.0.0-RC1" [workspace.dependencies] async-trait = "^0.1" -tokio = { version = "^1.23.0", features = ["macros", "rt-multi-thread"]} +tokio = { version = "^1.23.0", features = ["macros", "sync", "rt-multi-thread"]} concat-idents = "^1.1" dirs = "^4.0" smol = "^1.3" @@ -48,7 +48,7 @@ lto = "fat" debug = false opt-level = 3 panic = "abort" -codegen-units = 1 +#codegen-units = 1 [profile.dev] debug = true diff --git a/Makefile b/Makefile index 1ab0dd4b..057a611a 100644 --- a/Makefile +++ b/Makefile @@ -122,12 +122,10 @@ bindings: typeshare ./rog-platform/src/ --lang=typescript --output-file=bindings/ts/platform.ts introspect: + gdbus introspect --system -d org.asuslinux.Daemon -o /org/asuslinux/Platform -x > bindings/dbus-xml/org-asuslinux-platform-4.xml gdbus introspect --system -d org.asuslinux.Daemon -o /org/asuslinux/Aura -x > bindings/dbus-xml/org-asuslinux-aura-4.xml gdbus introspect --system -d org.asuslinux.Daemon -o /org/asuslinux/Anime -x > bindings/dbus-xml/org-asuslinux-anime-4.xml - gdbus introspect --system -d org.asuslinux.Daemon -o /org/asuslinux/Platform -x > bindings/dbus-xml/org-asuslinux-platform-4.xml - gdbus introspect --system -d org.asuslinux.Daemon -o /org/asuslinux/Power -x > bindings/dbus-xml/org-asuslinux-power-4.xml - gdbus introspect --system -d org.asuslinux.Daemon -o /org/asuslinux/Profile -x > bindings/dbus-xml/org-asuslinux-profile-4.xml - gdbus introspect --system -d org.asuslinux.Daemon -o /org/asuslinux/Supported -x > bindings/dbus-xml/org-asuslinux-supported-4.xml + gdbus introspect --system -d org.asuslinux.Daemon -o /org/asuslinux/FanCurves -x > bindings/dbus-xml/org-asuslinux-fan-curves-4.xml xmlstarlet ed -L -O -d '//interface[@name="org.freedesktop.DBus.Introspectable"]' bindings/dbus-xml/org-asuslinux-* xmlstarlet ed -L -O -d '//interface[@name="org.freedesktop.DBus.Properties"]' bindings/dbus-xml/org-asuslinux-* xmlstarlet ed -L -O -d '//interface[@name="org.freedesktop.DBus.Peer"]' bindings/dbus-xml/org-asuslinux-* diff --git a/asusctl/examples/aura-zoned-breathe.rs b/asusctl/examples/aura-zoned-breathe.rs index 1fc7b306..c0c27907 100644 --- a/asusctl/examples/aura-zoned-breathe.rs +++ b/asusctl/examples/aura-zoned-breathe.rs @@ -62,7 +62,7 @@ fn main() -> Result<(), Box> { seq.next_state(&layout); let packets = seq.create_packets(); - client.proxies().led().direct_addressing_raw(packets)?; + client.proxies().aura().direct_addressing_raw(packets)?; std::thread::sleep(std::time::Duration::from_millis(33)); } } diff --git a/asusctl/src/aura_cli.rs b/asusctl/src/aura_cli.rs index c86486bd..8e204b84 100644 --- a/asusctl/src/aura_cli.rs +++ b/asusctl/src/aura_cli.rs @@ -59,14 +59,14 @@ pub struct AuraPowerStates { #[derive(Options)] pub struct LedBrightness { - level: Option, + level: Option, } impl LedBrightness { - pub fn new(level: Option) -> Self { + pub fn new(level: Option) -> Self { LedBrightness { level } } - pub fn level(&self) -> Option { + pub fn level(&self) -> Option { self.level } } diff --git a/asusctl/src/cli_opts.rs b/asusctl/src/cli_opts.rs index 03305f83..bcb7e279 100644 --- a/asusctl/src/cli_opts.rs +++ b/asusctl/src/cli_opts.rs @@ -1,8 +1,9 @@ use gumdrop::Options; +use rog_platform::platform::PlatformPolicy; use crate::anime_cli::AnimeCommand; use crate::aura_cli::{LedBrightness, LedPowerCommand1, LedPowerCommand2, SetAuraBuiltin}; -use crate::profiles_cli::{FanCurveCommand, ProfileCommand}; +use crate::fan_curve_cli::FanCurveCommand; #[derive(Default, Options)] pub struct CliStart { @@ -44,6 +45,24 @@ pub enum CliCommand { Bios(BiosCommand), } +#[derive(Debug, Clone, Options)] +pub struct ProfileCommand { + #[options(help = "print help message")] + pub help: bool, + + #[options(help = "toggle to next profile in list")] + pub next: bool, + + #[options(help = "list available profiles")] + pub list: bool, + + #[options(help = "get profile")] + pub profile_get: bool, + + #[options(meta = "", help = "set the active profile")] + pub profile_set: Option, +} + #[derive(Options)] pub struct LedModeCommand { #[options(help = "print help message")] diff --git a/asusctl/src/profiles_cli.rs b/asusctl/src/fan_curve_cli.rs similarity index 71% rename from asusctl/src/profiles_cli.rs rename to asusctl/src/fan_curve_cli.rs index 43c8f1f2..59a8b456 100644 --- a/asusctl/src/profiles_cli.rs +++ b/asusctl/src/fan_curve_cli.rs @@ -1,24 +1,7 @@ use gumdrop::Options; +use rog_platform::platform::PlatformPolicy; use rog_profiles::fan_curve_set::CurveData; -use rog_profiles::{FanCurvePU, Profile}; - -#[derive(Debug, Clone, Options)] -pub struct ProfileCommand { - #[options(help = "print help message")] - pub help: bool, - - #[options(help = "toggle to next profile in list")] - pub next: bool, - - #[options(help = "list available profiles")] - pub list: bool, - - #[options(help = "get profile")] - pub profile_get: bool, - - #[options(meta = "", help = "set the active profile")] - pub profile_set: Option, -} +use rog_profiles::FanCurvePU; #[derive(Debug, Clone, Options)] pub struct FanCurveCommand { @@ -35,7 +18,7 @@ pub struct FanCurveCommand { meta = "", help = "profile to modify fan-curve for. Shows data if no options provided" )] - pub mod_profile: Option, + pub mod_profile: Option, #[options( meta = "", diff --git a/asusctl/src/main.rs b/asusctl/src/main.rs index 8d98e241..c0955eff 100644 --- a/asusctl/src/main.rs +++ b/asusctl/src/main.rs @@ -5,18 +5,20 @@ use std::process::Command; use std::thread::sleep; use anime_cli::{AnimeActions, AnimeCommand}; +use asusd::ctrl_aura::trait_impls::AURA_ZBUS_NAME; +use asusd::ctrl_fancurves::FAN_CURVE_ZBUS_NAME; use aura_cli::{LedPowerCommand1, LedPowerCommand2}; use dmi_id::DMIID; +use fan_curve_cli::FanCurveCommand; use gumdrop::{Opt, Options}; -use profiles_cli::{FanCurveCommand, ProfileCommand}; use rog_anime::usb::get_anime_type; use rog_anime::{AnimTime, AnimeDataBuffer, AnimeDiagonal, AnimeGif, AnimeImage, AnimeType, Vec2}; use rog_aura::power::KbAuraPowerState; -use rog_aura::usb::{AuraDevRog1, AuraDevTuf, AuraDevice, AuraPowerDev}; +use rog_aura::usb::{AuraDevRog1, AuraDevTuf, AuraPowerDev}; use rog_aura::{self, AuraEffect}; use rog_dbus::RogDbusClientBlocking; -use rog_platform::platform::GpuMode; -use rog_platform::supported::*; +use rog_platform::error::PlatformError; +use rog_platform::platform::{GpuMode, PlatformPolicy, Properties}; use rog_profiles::error::ProfileError; use crate::aura_cli::{AuraPowerStates, LedBrightness}; @@ -25,7 +27,7 @@ use crate::cli_opts::*; mod anime_cli; mod aura_cli; mod cli_opts; -mod profiles_cli; +mod fan_curve_cli; fn main() { let args: Vec = args().skip(1).collect(); @@ -44,37 +46,36 @@ fn main() { }; if let Ok((dbus, _)) = RogDbusClientBlocking::new().map_err(|e| { - print_error_help(&e, None); + check_service("asusd"); + println!("\nError: {e}\n"); + print_info(); }) { - if let Ok(supported) = dbus - .proxies() - .supported() - .supported_functions() - .map_err(|e| { - print_error_help(&e, None); - }) - { - if parsed.version { - println!("asusctl v{}", env!("CARGO_PKG_VERSION")); - println!(); - print_info(); - } + let supported_properties = dbus.proxies().platform().supported_properties().unwrap(); + let supported_interfaces = dbus.proxies().platform().supported_interfaces().unwrap(); - if let Err(err) = do_parsed(&parsed, &supported, &dbus) { - print_error_help(&*err, Some(&supported)); - } + if parsed.version { + println!("asusctl v{}", env!("CARGO_PKG_VERSION")); + println!(); + print_info(); + } + + if let Err(err) = do_parsed(&parsed, &supported_interfaces, &supported_properties, &dbus) { + print_error_help(&*err, &supported_interfaces, &supported_properties); } } } -fn print_error_help(err: &dyn std::error::Error, supported: Option<&SupportedFunctions>) { +fn print_error_help( + err: &dyn std::error::Error, + supported_interfaces: &[String], + supported_properties: &[Properties], +) { check_service("asusd"); println!("\nError: {}\n", err); print_info(); - if let Some(supported) = supported { - println!(); - println!("Supported laptop functions:\n\n{}", supported); - } + println!(); + println!("Supported interfaces:\n\n{:#?}\n", supported_interfaces); + println!("Supported properties:\n\n{:#?}\n", supported_properties); } fn print_info() { @@ -105,20 +106,21 @@ fn check_service(name: &str) -> bool { fn do_parsed( parsed: &CliStart, - supported: &SupportedFunctions, + supported_interfaces: &[String], + supported_properties: &[Properties], dbus: &RogDbusClientBlocking<'_>, ) -> Result<(), Box> { match &parsed.command { - Some(CliCommand::LedMode(mode)) => handle_led_mode(dbus, &supported.keyboard_led, mode)?, - Some(CliCommand::LedPow1(pow)) => handle_led_power1(dbus, &supported.keyboard_led, pow)?, - Some(CliCommand::LedPow2(pow)) => handle_led_power2(dbus, &supported.keyboard_led, pow)?, - Some(CliCommand::Profile(cmd)) => handle_profile(dbus, &supported.platform_profile, cmd)?, + Some(CliCommand::LedMode(mode)) => handle_led_mode(dbus, supported_interfaces, mode)?, + Some(CliCommand::LedPow1(pow)) => handle_led_power1(dbus, supported_interfaces, pow)?, + Some(CliCommand::LedPow2(pow)) => handle_led_power2(dbus, supported_interfaces, pow)?, + Some(CliCommand::Profile(cmd)) => handle_throttle_profile(dbus, supported_properties, cmd)?, Some(CliCommand::FanCurve(cmd)) => { - handle_fan_curve(dbus, &supported.platform_profile, cmd)?; + handle_fan_curve(dbus, supported_interfaces, cmd)?; } Some(CliCommand::Graphics(_)) => do_gfx(), - Some(CliCommand::Anime(cmd)) => handle_anime(dbus, &supported.anime_ctrl, cmd)?, - Some(CliCommand::Bios(cmd)) => handle_bios_option(dbus, &supported.rog_bios_ctrl, cmd)?, + Some(CliCommand::Anime(cmd)) => handle_anime(dbus, cmd)?, + Some(CliCommand::Bios(cmd)) => handle_platform_properties(dbus, supported_properties, cmd)?, None => { if (!parsed.show_supported && parsed.kbd_bright.is_none() @@ -132,15 +134,14 @@ fn do_parsed( if let Some(cmdlist) = CliStart::command_list() { let commands: Vec = cmdlist.lines().map(|s| s.to_owned()).collect(); for command in commands.iter().filter(|command| { - if !supported.keyboard_led.dev_id.is_old_style() - && !supported.keyboard_led.dev_id.is_tuf_style() + let dev_type = dbus.proxies().aura().device_type().unwrap(); + if !dev_type.is_old_style() + && !dev_type.is_tuf_style() && command.trim().starts_with("led-pow-1") { return false; } - if !supported.keyboard_led.dev_id.is_new_style() - && command.trim().starts_with("led-pow-2") - { + if !dev_type.is_new_style() && command.trim().starts_with("led-pow-2") { return false; } true @@ -159,31 +160,34 @@ fn do_parsed( if let Some(brightness) = &parsed.kbd_bright { match brightness.level() { None => { - let level = dbus.proxies().led().led_brightness()?; - println!("Current keyboard led brightness: {}", level); + let level = dbus.proxies().aura().brightness()?; + println!("Current keyboard led brightness: {level:?}"); } Some(level) => dbus .proxies() - .led() - .set_brightness(::from(level))?, + .aura() + .set_brightness(rog_aura::LedBrightness::from(level))?, } } if parsed.next_kbd_bright { - dbus.proxies().led().next_led_brightness()?; + let brightness = dbus.proxies().aura().brightness()?; + dbus.proxies().aura().set_brightness(brightness.next())?; } if parsed.prev_kbd_bright { - dbus.proxies().led().prev_led_brightness()?; + let brightness = dbus.proxies().aura().brightness()?; + dbus.proxies().aura().set_brightness(brightness.prev())?; } - if parsed.show_supported { - println!("Supported laptop functions:\n\n{}", supported); - } + // TODO: + // if parsed.show_supported { + // println!("Supported laptop functions:\n\n{}", supported); + // } if let Some(chg_limit) = parsed.chg_limit { dbus.proxies() - .charge() + .platform() .set_charge_control_end_threshold(chg_limit)?; } @@ -200,7 +204,6 @@ fn do_gfx() { fn handle_anime( dbus: &RogDbusClientBlocking<'_>, - _supported: &AnimeSupportedFunctions, cmd: &AnimeCommand, ) -> Result<(), Box> { if (cmd.command.is_none() @@ -375,12 +378,14 @@ fn handle_anime( return Ok(()); } - dbus.proxies().anime().set_builtin_animations( - builtins.boot, - builtins.awake, - builtins.sleep, - builtins.shutdown, - )?; + dbus.proxies() + .anime() + .set_builtin_animations(rog_anime::Animations { + boot: builtins.boot, + awake: builtins.awake, + sleep: builtins.sleep, + shutdown: builtins.shutdown, + })?; } } } @@ -398,9 +403,14 @@ fn verify_brightness(brightness: f32) { fn handle_led_mode( dbus: &RogDbusClientBlocking<'_>, - supported: &LedSupportedFunctions, + supported: &[String], mode: &LedModeCommand, ) -> Result<(), Box> { + if !supported.contains(&AURA_ZBUS_NAME.to_string()) { + println!("This laptop does not support power options"); + return Err(PlatformError::NotSupported.into()); + } + if mode.command.is_none() && !mode.prev_mode && !mode.next_mode { if !mode.help { println!("Missing arg or command\n"); @@ -411,7 +421,8 @@ fn handle_led_mode( if let Some(cmdlist) = LedModeCommand::command_list() { let commands: Vec = cmdlist.lines().map(|s| s.to_owned()).collect(); for command in commands.iter().filter(|command| { - for mode in &supported.basic_modes { + let modes = dbus.proxies().aura().supported_modes().unwrap(); + for mode in &modes { if command .trim() .starts_with(&<&str>::from(mode).to_lowercase()) @@ -419,9 +430,10 @@ fn handle_led_mode( return true; } } - if !supported.basic_zones.is_empty() && command.trim().starts_with("multi") { - return true; - } + // TODO + // if !supported.basic_zones.is_empty() && command.trim().starts_with("multi") { + // return true; + // } false }) { println!("{}", command); @@ -437,17 +449,31 @@ fn handle_led_mode( return Ok(()); } if mode.next_mode { - dbus.proxies().led().next_led_mode()?; + let mode = dbus.proxies().aura().led_mode()?; + let modes = dbus.proxies().aura().supported_modes()?; + let mut pos = modes.iter().position(|m| *m == mode).unwrap() + 1; + if pos >= modes.len() { + pos = 0; + } + dbus.proxies().aura().set_led_mode(modes[pos])?; } else if mode.prev_mode { - dbus.proxies().led().prev_led_mode()?; + let mode = dbus.proxies().aura().led_mode()?; + let modes = dbus.proxies().aura().supported_modes()?; + let mut pos = modes.iter().position(|m| *m == mode).unwrap(); + if pos == 0 { + pos = modes.len() - 1; + } else { + pos -= 1; + } + dbus.proxies().aura().set_led_mode(modes[pos])?; } else if let Some(mode) = mode.command.as_ref() { if mode.help_requested() { println!("{}", mode.self_usage()); return Ok(()); } dbus.proxies() - .led() - .set_led_mode(&::from(mode))?; + .aura() + .set_led_mode_data(::from(mode))?; } Ok(()) @@ -455,9 +481,18 @@ fn handle_led_mode( fn handle_led_power1( dbus: &RogDbusClientBlocking<'_>, - supported: &LedSupportedFunctions, + supported: &[String], power: &LedPowerCommand1, ) -> Result<(), Box> { + if !supported.contains(&AURA_ZBUS_NAME.to_string()) { + println!("This laptop does not support power options"); + return Err(PlatformError::NotSupported.into()); + } + let dev_type = dbus.proxies().aura().device_type()?; + if !dev_type.is_old_style() && !dev_type.is_tuf_style() { + println!("This option applies only to keyboards 2021+"); + } + if power.awake.is_none() && power.sleep.is_none() && power.boot.is_none() @@ -471,15 +506,12 @@ fn handle_led_power1( return Ok(()); } - if matches!( - supported.dev_id, - AuraDevice::X1854 | AuraDevice::X1869 | AuraDevice::X1866 - ) { + if dev_type.is_old_style() { handle_led_power_1_do_1866(dbus, power)?; return Ok(()); } - if matches!(supported.dev_id, AuraDevice::Tuf) { + if dev_type.is_tuf_style() { handle_led_power_1_do_tuf(dbus, power)?; return Ok(()); } @@ -515,13 +547,13 @@ fn handle_led_power_1_do_1866( old_rog: enabled, ..Default::default() }; - dbus.proxies().led().set_led_power(data, true)?; + dbus.proxies().aura().set_led_power((data, true))?; let data = AuraPowerDev { old_rog: disabled, ..Default::default() }; - dbus.proxies().led().set_led_power(data, false)?; + dbus.proxies().aura().set_led_power((data, false))?; Ok(()) } @@ -552,22 +584,31 @@ fn handle_led_power_1_do_tuf( tuf: enabled, ..Default::default() }; - dbus.proxies().led().set_led_power(data, true)?; + dbus.proxies().aura().set_led_power((data, true))?; let data = AuraPowerDev { tuf: disabled, ..Default::default() }; - dbus.proxies().led().set_led_power(data, false)?; + dbus.proxies().aura().set_led_power((data, false))?; Ok(()) } fn handle_led_power2( dbus: &RogDbusClientBlocking<'_>, - supported: &LedSupportedFunctions, + supported: &[String], power: &LedPowerCommand2, ) -> Result<(), Box> { + if !supported.contains(&AURA_ZBUS_NAME.to_string()) { + println!("This laptop does not support power options"); + return Err(PlatformError::NotSupported.into()); + } + let dev_type = dbus.proxies().aura().device_type()?; + if !dev_type.is_new_style() { + println!("This option applies only to keyboards 2021+"); + } + if power.command().is_none() { if !power.help { println!("Missing arg or command\n"); @@ -592,10 +633,6 @@ fn handle_led_power2( return Ok(()); } - if !supported.dev_id.is_new_style() { - println!("This option applies only to keyboards with product ID 0x19b6"); - } - let set = |power: &mut KbAuraPowerState, set_to: &AuraPowerStates| { power.boot = set_to.boot; power.awake = set_to.awake; @@ -603,7 +640,7 @@ fn handle_led_power2( power.shutdown = set_to.shutdown; }; - let mut enabled = dbus.proxies().led().led_power()?; + let mut enabled = dbus.proxies().aura().led_power()?; if let Some(cmd) = &power.command { match cmd { aura_cli::SetAuraZoneEnabled::Keyboard(k) => set(&mut enabled.rog.keyboard, k), @@ -614,18 +651,18 @@ fn handle_led_power2( } } - dbus.proxies().led().set_led_power(enabled, true)?; + dbus.proxies().aura().set_led_power((enabled, true))?; } Ok(()) } -fn handle_profile( +fn handle_throttle_profile( dbus: &RogDbusClientBlocking<'_>, - supported: &PlatformProfileFunctions, + supported: &[Properties], cmd: &ProfileCommand, ) -> Result<(), Box> { - if !supported.platform_profile { + if !supported.contains(&Properties::DgpuDisable) { println!("Profiles not supported by either this kernel or by the laptop."); return Err(ProfileError::NotSupported.into()); } @@ -641,23 +678,27 @@ fn handle_profile( } return Ok(()); } + let current = dbus.proxies().platform().throttle_thermal_policy()?; if cmd.next { - dbus.proxies().profile().next_profile()?; + dbus.proxies() + .platform() + .set_throttle_thermal_policy(current.next())?; } else if let Some(profile) = cmd.profile_set { - dbus.proxies().profile().set_active_profile(profile)?; + dbus.proxies() + .platform() + .set_throttle_thermal_policy(profile)?; } if cmd.list { - let res = dbus.proxies().profile().profiles()?; + let res = PlatformPolicy::list(); for p in &res { println!("{:?}", p); } } if cmd.profile_get { - let res = dbus.proxies().profile().active_profile()?; - println!("Active profile is {:?}", res); + println!("Active profile is {current:?}"); } Ok(()) @@ -665,12 +706,11 @@ fn handle_profile( fn handle_fan_curve( dbus: &RogDbusClientBlocking<'_>, - supported: &PlatformProfileFunctions, + supported: &[String], cmd: &FanCurveCommand, ) -> Result<(), Box> { - if supported.fans.is_empty() { + if !supported.contains(&FAN_CURVE_ZBUS_NAME.to_string()) { println!("Fan-curves not supported by either this kernel or by the laptop."); - println!("This requires kernel 5.17 or the fan curve patch listed in the readme."); return Err(ProfileError::NotSupported.into()); } @@ -697,34 +737,34 @@ fn handle_fan_curve( } if cmd.get_enabled { - let profile = dbus.proxies().profile().active_profile()?; - let curves = dbus.proxies().profile().fan_curve_data(profile)?; + let profile = dbus.proxies().platform().throttle_thermal_policy()?; + let curves = dbus.proxies().fan_curves().fan_curve_data(profile)?; for curve in curves.iter() { println!("{}", String::from(curve)); } } if cmd.default { - dbus.proxies().profile().set_active_curve_to_defaults()?; + dbus.proxies().fan_curves().set_active_curve_to_defaults()?; } if let Some(profile) = cmd.mod_profile { if cmd.enable_fan_curves.is_none() && cmd.data.is_none() { - let data = dbus.proxies().profile().fan_curve_data(profile)?; + let data = dbus.proxies().fan_curves().fan_curve_data(profile)?; let data = toml::to_string(&data)?; println!("\nFan curves for {:?}\n\n{}", profile, data); } if let Some(enabled) = cmd.enable_fan_curves { dbus.proxies() - .profile() + .fan_curves() .set_fan_curves_enabled(profile, enabled)?; } if let Some(enabled) = cmd.enable_fan_curve { if let Some(fan) = cmd.fan { dbus.proxies() - .profile() + .fan_curves() .set_profile_fan_curve_enabled(profile, fan, enabled)?; } else { println!( @@ -737,16 +777,16 @@ fn handle_fan_curve( if let Some(mut curve) = cmd.data.clone() { let fan = cmd.fan.unwrap_or_default(); curve.set_fan(fan); - dbus.proxies().profile().set_fan_curve(profile, curve)?; + dbus.proxies().fan_curves().set_fan_curve(profile, curve)?; } } Ok(()) } -fn handle_bios_option( +fn handle_platform_properties( dbus: &RogDbusClientBlocking<'_>, - supported: &PlatformSupportedFunctions, + supported: &[Properties], cmd: &BiosCommand, ) -> Result<(), Box> { { @@ -763,26 +803,26 @@ fn handle_bios_option( let usage: Vec = BiosCommand::usage().lines().map(|s| s.to_owned()).collect(); for line in usage.iter().filter(|line| { - line.contains("sound") && supported.post_animation_sound - || line.contains("GPU") && supported.gpu_mux - || line.contains("panel") && supported.panel_overdrive + line.contains("sound") && supported.contains(&Properties::PostAnimationSound) + || line.contains("GPU") && supported.contains(&Properties::GpuMuxMode) + || line.contains("panel") && supported.contains(&Properties::PanelOd) }) { println!("{}", line); } } if let Some(opt) = cmd.post_sound_set { - dbus.proxies().rog_bios().set_post_animation_sound(opt)?; + dbus.proxies().platform().set_post_animation_sound(opt)?; } if cmd.post_sound_get { - let res = dbus.proxies().rog_bios().post_animation_sound()?; + let res = dbus.proxies().platform().post_animation_sound()?; println!("Bios POST sound on: {}", res); } if let Some(opt) = cmd.gpu_mux_mode_set { println!("Rebuilding initrd to include drivers"); dbus.proxies() - .rog_bios() + .platform() .set_gpu_mux_mode(GpuMode::from_mux(opt))?; println!( "The mode change is not active until you reboot, on boot the bios will make the \ @@ -790,15 +830,15 @@ fn handle_bios_option( ); } if cmd.gpu_mux_mode_get { - let res = dbus.proxies().rog_bios().gpu_mux_mode()?; + let res = dbus.proxies().platform().gpu_mux_mode()?; println!("Bios GPU MUX: {:?}", res); } if let Some(opt) = cmd.panel_overdrive_set { - dbus.proxies().rog_bios().set_panel_od(opt)?; + dbus.proxies().platform().set_panel_od(opt)?; } if cmd.panel_overdrive_get { - let res = dbus.proxies().rog_bios().panel_od()?; + let res = dbus.proxies().platform().panel_od()?; println!("Panel overdrive on: {}", res); } } diff --git a/asusd-user/src/daemon.rs b/asusd-user/src/daemon.rs index d012de46..fae00c73 100644 --- a/asusd-user/src/daemon.rs +++ b/asusd-user/src/daemon.rs @@ -5,12 +5,11 @@ use std::sync::{Arc, Mutex}; use asusd_user::config::*; use asusd_user::ctrl_anime::{CtrlAnime, CtrlAnimeInner}; -use asusd_user::DBUS_NAME; use config_traits::{StdConfig, StdConfigLoad}; use rog_anime::usb::get_anime_type; use rog_aura::aura_detection::LaptopLedData; use rog_aura::layouts::KeyLayout; -use rog_dbus::RogDbusClientBlocking; +use rog_dbus::{RogDbusClientBlocking, DBUS_NAME}; use smol::Executor; use zbus::Connection; @@ -34,15 +33,18 @@ fn main() -> Result<(), Box> { println!("rog-platform v{}", rog_platform::VERSION); let (client, _) = RogDbusClientBlocking::new()?; - let supported = client.proxies().supported().supported_functions()?; - + let supported = client + .proxies() + .platform() + .supported_interfaces() + .unwrap_or_default() + .contains(&"Anime".to_string()); let config = ConfigBase::new().load(); - let executor = Executor::new(); let early_return = Arc::new(AtomicBool::new(false)); // Set up the anime data and run loop/thread - if supported.anime_ctrl.0 { + if supported { if let Some(cfg) = config.active_anime { let anime_type = get_anime_type()?; let anime_config = ConfigAnime::new().set_name(cfg).load(); @@ -100,7 +102,7 @@ fn main() -> Result<(), Box> { client .proxies() - .led() + .aura() .direct_addressing_raw(packets) .unwrap(); std::thread::sleep(std::time::Duration::from_millis(33)); diff --git a/asusd-user/src/lib.rs b/asusd-user/src/lib.rs index 25a75409..7c7c7816 100644 --- a/asusd-user/src/lib.rs +++ b/asusd-user/src/lib.rs @@ -6,6 +6,4 @@ pub mod ctrl_anime; pub mod zbus_anime; -pub static DBUS_NAME: &str = "org.asuslinux.Daemon"; - pub static VERSION: &str = env!("CARGO_PKG_VERSION"); diff --git a/asusd/Cargo.toml b/asusd/Cargo.toml index 4d4f3068..5c12db49 100644 --- a/asusd/Cargo.toml +++ b/asusd/Cargo.toml @@ -19,7 +19,6 @@ rog_anime = { path = "../rog-anime", features = ["dbus"] } rog_aura = { path = "../rog-aura", features = ["dbus"] } rog_platform = { path = "../rog-platform" } rog_profiles = { path = "../rog-profiles" } -rog_dbus = { path = "../rog-dbus" } dmi_id = { path = "../dmi-id" } futures-lite = "*" diff --git a/asusd/src/config.rs b/asusd/src/config.rs index 8665adf0..b51a2231 100644 --- a/asusd/src/config.rs +++ b/asusd/src/config.rs @@ -1,4 +1,5 @@ use config_traits::{StdConfig, StdConfigLoad2}; +use rog_platform::platform::PlatformPolicy; use serde_derive::{Deserialize, Serialize}; const CONFIG_FILE: &str = "asusd.ron"; @@ -6,13 +7,18 @@ const CONFIG_FILE: &str = "asusd.ron"; #[derive(Deserialize, Serialize, Default, Debug)] pub struct Config { /// Save charge limit for restoring on boot - pub bat_charge_limit: u8, + pub charge_control_end_threshold: u8, pub panel_od: bool, pub mini_led_mode: bool, pub disable_nvidia_powerd_on_battery: bool, pub ac_command: String, pub bat_command: String, - pub post_animation_sound: bool, + /// Restored on boot as well as when power is plugged + #[serde(skip)] + pub platform_policy_to_restore: PlatformPolicy, + pub platform_policy_on_battery: PlatformPolicy, + pub platform_policy_on_ac: PlatformPolicy, + // pub ppt_pl1_spl: Option, pub ppt_pl2_sppt: Option, pub ppt_fppt: Option, @@ -25,8 +31,10 @@ pub struct Config { impl StdConfig for Config { fn new() -> Self { Config { - bat_charge_limit: 100, + charge_control_end_threshold: 100, disable_nvidia_powerd_on_battery: true, + platform_policy_on_battery: PlatformPolicy::Quiet, + platform_policy_on_ac: PlatformPolicy::Performance, ac_command: String::new(), bat_command: String::new(), ..Default::default() @@ -53,13 +61,12 @@ pub struct Config472 { pub disable_nvidia_powerd_on_battery: bool, pub ac_command: String, pub bat_command: String, - pub post_animation_sound: bool, } impl From for Config { fn from(c: Config472) -> Self { Self { - bat_charge_limit: c.bat_charge_limit, + charge_control_end_threshold: c.bat_charge_limit, panel_od: c.panel_od, disable_nvidia_powerd_on_battery: true, ac_command: c.ac_command, @@ -82,7 +89,7 @@ pub struct Config462 { impl From for Config { fn from(c: Config462) -> Self { Self { - bat_charge_limit: c.bat_charge_limit, + charge_control_end_threshold: c.bat_charge_limit, panel_od: c.panel_od, disable_nvidia_powerd_on_battery: true, ac_command: String::new(), diff --git a/asusd/src/ctrl_anime/mod.rs b/asusd/src/ctrl_anime/mod.rs index 14a7f1a1..8aaca9af 100644 --- a/asusd/src/ctrl_anime/mod.rs +++ b/asusd/src/ctrl_anime/mod.rs @@ -16,24 +16,10 @@ use rog_anime::usb::{ }; use rog_anime::{ActionData, AnimeDataBuffer, AnimePacketType, AnimeType}; use rog_platform::hid_raw::HidRaw; -use rog_platform::supported::AnimeSupportedFunctions; use rog_platform::usb_raw::USBRaw; use self::config::{AnimeConfig, AnimeConfigCached}; use crate::error::RogError; -use crate::GetSupported; - -impl GetSupported for CtrlAnime { - type A = AnimeSupportedFunctions; - - fn get_supported() -> Self::A { - if USBRaw::new(0x193b).is_ok() { - AnimeSupportedFunctions(true) - } else { - AnimeSupportedFunctions(HidRaw::new("193b").is_ok()) - } - } -} enum Node { Usb(USBRaw), diff --git a/asusd/src/ctrl_anime/trait_impls.rs b/asusd/src/ctrl_anime/trait_impls.rs index 0351c08f..0bc5b1f5 100644 --- a/asusd/src/ctrl_anime/trait_impls.rs +++ b/asusd/src/ctrl_anime/trait_impls.rs @@ -7,16 +7,17 @@ use log::warn; use logind_zbus::manager::ManagerProxy; use rog_anime::usb::{ pkt_set_brightness, pkt_set_builtin_animations, pkt_set_enable_display, - pkt_set_enable_powersave_anim, AnimAwake, AnimBooting, AnimShutdown, AnimSleeping, Brightness, + pkt_set_enable_powersave_anim, Brightness, }; -use rog_anime::{AnimeDataBuffer, DeviceState}; +use rog_anime::{Animations, AnimeDataBuffer, DeviceState}; use zbus::export::futures_util::lock::Mutex; use zbus::{dbus_interface, CacheProperties, Connection, SignalContext}; use super::CtrlAnime; use crate::error::RogError; -pub(super) const ZBUS_PATH: &str = "/org/asuslinux/Anime"; +pub const ANIME_ZBUS_NAME: &str = "Anime"; +pub const ANIME_ZBUS_PATH: &str = "/org/asuslinux/Anime"; async fn get_logind_manager<'a>() -> ManagerProxy<'a> { let connection = Connection::system() @@ -37,7 +38,7 @@ pub struct CtrlAnimeZbus(pub Arc>); #[async_trait] impl crate::ZbusRun for CtrlAnimeZbus { async fn add_to_server(self, server: &mut Connection) { - Self::add_to_server_helper(self, ZBUS_PATH, server).await; + Self::add_to_server_helper(self, ANIME_ZBUS_PATH, server).await; } } @@ -59,11 +60,15 @@ impl CtrlAnimeZbus { } /// Set base brightness level - async fn set_brightness( - &self, - #[zbus(signal_context)] ctxt: SignalContext<'_>, - brightness: Brightness, - ) { + #[dbus_interface(property)] + async fn brightness(&self) -> Brightness { + let lock = self.0.lock().await; + lock.config.display_brightness + } + + /// Set base brightness level + #[dbus_interface(property)] + async fn set_brightness(&self, brightness: Brightness) { let mut lock = self.0.lock().await; lock.node .write_bytes(&pkt_set_brightness(brightness)) @@ -81,19 +86,18 @@ impl CtrlAnimeZbus { lock.config.display_enabled = brightness != Brightness::Off; lock.config.display_brightness = brightness; lock.config.write(); + } - Self::notify_device_state(&ctxt, DeviceState::from(&lock.config)) - .await - .ok(); + #[dbus_interface(property)] + async fn builtins_enabled(&self) -> bool { + let lock = self.0.lock().await; + lock.config.builtin_anims_enabled } /// Enable the builtin animations or not. This is quivalent to "Powersave /// animations" in Armory crate - async fn set_builtins_enabled( - &self, - #[zbus(signal_context)] ctxt: SignalContext<'_>, - enabled: bool, - ) { + #[dbus_interface(property)] + async fn set_builtins_enabled(&self, enabled: bool) { let mut lock = self.0.lock().await; lock.node .set_builtins_enabled(enabled, lock.config.display_brightness) @@ -121,24 +125,25 @@ impl CtrlAnimeZbus { if enabled { lock.thread_exit.store(true, Ordering::Release); } + } - Self::notify_device_state(&ctxt, DeviceState::from(&lock.config)) - .await - .ok(); + #[dbus_interface(property)] + async fn builtin_animations(&self) -> Animations { + let lock = self.0.lock().await; + lock.config.builtin_anims } /// Set which builtin animation is used for each stage - async fn set_builtin_animations( - &self, - #[zbus(signal_context)] ctxt: SignalContext<'_>, - boot: AnimBooting, - awake: AnimAwake, - sleep: AnimSleeping, - shutdown: AnimShutdown, - ) { + #[dbus_interface(property)] + async fn set_builtin_animations(&self, settings: Animations) { let mut lock = self.0.lock().await; lock.node - .write_bytes(&pkt_set_builtin_animations(boot, awake, sleep, shutdown)) + .write_bytes(&pkt_set_builtin_animations( + settings.boot, + settings.awake, + settings.sleep, + settings.shutdown, + )) .map_err(|err| { warn!("ctrl_anime::run_animation:callback {}", err); }) @@ -150,23 +155,19 @@ impl CtrlAnimeZbus { }) .ok(); lock.config.display_enabled = true; - lock.config.builtin_anims.boot = boot; - lock.config.builtin_anims.sleep = sleep; - lock.config.builtin_anims.awake = awake; - lock.config.builtin_anims.shutdown = shutdown; + lock.config.builtin_anims = settings; lock.config.write(); + } - Self::notify_device_state(&ctxt, DeviceState::from(&lock.config)) - .await - .ok(); + #[dbus_interface(property)] + async fn enable_display(&self) -> bool { + let lock = self.0.lock().await; + lock.config.display_enabled } /// Set whether the AniMe is enabled at all - async fn set_enable_display( - &self, - #[zbus(signal_context)] ctxt: SignalContext<'_>, - enabled: bool, - ) { + #[dbus_interface(property)] + async fn set_enable_display(&self, enabled: bool) { let mut lock = self.0.lock().await; lock.node .write_bytes(&pkt_set_enable_display(enabled)) @@ -176,18 +177,17 @@ impl CtrlAnimeZbus { .ok(); lock.config.display_enabled = enabled; lock.config.write(); + } - Self::notify_device_state(&ctxt, DeviceState::from(&lock.config)) - .await - .ok(); + #[dbus_interface(property)] + async fn off_when_unplugged(&self) -> bool { + let lock = self.0.lock().await; + lock.config.off_when_unplugged } /// Set if to turn the AniMe Matrix off when external power is unplugged - async fn set_off_when_unplugged( - &self, - #[zbus(signal_context)] ctxt: SignalContext<'_>, - enabled: bool, - ) { + #[dbus_interface(property)] + async fn set_off_when_unplugged(&self, enabled: bool) { let mut lock = self.0.lock().await; let manager = get_logind_manager().await; let pow = manager.on_external_power().await.unwrap_or_default(); @@ -201,31 +201,31 @@ impl CtrlAnimeZbus { lock.config.off_when_unplugged = enabled; lock.config.write(); - Self::notify_device_state(&ctxt, DeviceState::from(&lock.config)) - .await - .ok(); + } + + #[dbus_interface(property)] + async fn off_when_suspended(&self) -> bool { + let lock = self.0.lock().await; + lock.config.off_when_suspended } /// Set if to turn the AniMe Matrix off when the laptop is suspended - async fn set_off_when_suspended( - &self, - #[zbus(signal_context)] ctxt: SignalContext<'_>, - enabled: bool, - ) { + #[dbus_interface(property)] + async fn set_off_when_suspended(&self, enabled: bool) { let mut lock = self.0.lock().await; lock.config.off_when_suspended = enabled; lock.config.write(); - Self::notify_device_state(&ctxt, DeviceState::from(&lock.config)) - .await - .ok(); + } + + #[dbus_interface(property)] + async fn off_when_lid_closed(&self) -> bool { + let lock = self.0.lock().await; + lock.config.off_when_lid_closed } /// Set if to turn the AniMe Matrix off when the lid is closed - async fn set_off_when_lid_closed( - &self, - #[zbus(signal_context)] ctxt: SignalContext<'_>, - enabled: bool, - ) { + #[dbus_interface(property)] + async fn set_off_when_lid_closed(&self, enabled: bool) { let mut lock = self.0.lock().await; let manager = get_logind_manager().await; let lid = manager.lid_closed().await.unwrap_or_default(); @@ -239,9 +239,6 @@ impl CtrlAnimeZbus { lock.config.off_when_lid_closed = enabled; lock.config.write(); - Self::notify_device_state(&ctxt, DeviceState::from(&lock.config)) - .await - .ok(); } /// The main loop is the base system set action if the user isn't running @@ -260,17 +257,12 @@ impl CtrlAnimeZbus { let lock = self.0.lock().await; DeviceState::from(&lock.config) } - - /// Notify listeners of the status of AniMe LED power and factory - /// system-status animations - #[dbus_interface(signal)] - async fn notify_device_state(ctxt: &SignalContext<'_>, data: DeviceState) -> zbus::Result<()>; } #[async_trait] impl crate::CtrlTask for CtrlAnimeZbus { fn zbus_path() -> &'static str { - ZBUS_PATH + ANIME_ZBUS_PATH } async fn create_tasks(&self, _: SignalContext<'static>) -> Result<(), RogError> { @@ -386,15 +378,17 @@ impl crate::Reloadable for CtrlAnimeZbus { let lid_closed = manager.lid_closed().await.unwrap_or_default(); let power_plugged = manager.on_external_power().await.unwrap_or_default(); - let on = (lid_closed && lock.config.off_when_lid_closed) - || (power_plugged && lock.config.off_when_unplugged); + let turn_off = (lid_closed && lock.config.off_when_lid_closed) + || (!power_plugged && lock.config.off_when_unplugged); lock.node - .write_bytes(&pkt_set_enable_display(on)) + .write_bytes(&pkt_set_enable_display(!turn_off)) .map_err(|err| { warn!("create_sys_event_tasks::reload {}", err); }) .ok(); - if !on { + + if turn_off || !lock.config.display_enabled { + lock.node.write_bytes(&pkt_set_enable_display(false))?; // early return so we don't run animation thread return Ok(()); } diff --git a/asusd/src/ctrl_aura/controller.rs b/asusd/src/ctrl_aura/controller.rs index 24336f24..0c862c83 100644 --- a/asusd/src/ctrl_aura/controller.rs +++ b/asusd/src/ctrl_aura/controller.rs @@ -6,49 +6,14 @@ use log::{info, warn}; use rog_aura::advanced::{LedUsbPackets, UsbPackets}; use rog_aura::aura_detection::{LaptopLedData, ASUS_KEYBOARD_DEVICES}; use rog_aura::usb::{AuraDevice, LED_APPLY, LED_SET}; -use rog_aura::{AuraEffect, AuraZone, Direction, LedBrightness, Speed, GRADIENT, LED_MSG_LEN}; +use rog_aura::{AuraEffect, Direction, LedBrightness, Speed, GRADIENT, LED_MSG_LEN}; use rog_platform::hid_raw::HidRaw; use rog_platform::keyboard_led::KeyboardLed; -use rog_platform::supported::LedSupportedFunctions; use super::config::{AuraConfig, AuraPowerConfig}; use crate::error::RogError; -use crate::GetSupported; -impl GetSupported for CtrlKbdLed { - type A = LedSupportedFunctions; - - fn get_supported() -> Self::A { - // let mode = <&str>::from(&::from(*mode)); - let laptop = LaptopLedData::get_data(); - - let mut prod_id = AuraDevice::Unknown; - for prod in ASUS_KEYBOARD_DEVICES { - if HidRaw::new(prod.into()).is_ok() { - prod_id = prod; - break; - } - } - - let rgb = KeyboardLed::new(); - if let Ok(p) = rgb.as_ref() { - if p.has_kbd_rgb_mode() { - prod_id = AuraDevice::Tuf; - } - } - - LedSupportedFunctions { - dev_id: prod_id, - brightness: rgb.is_ok(), - basic_modes: laptop.basic_modes, - basic_zones: laptop.basic_zones, - advanced_type: laptop.advanced_type.into(), - power_zones: laptop.power_zones, - } - } -} - -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug)] pub enum LEDNode { KbdLed(KeyboardLed), Rog(HidRaw), @@ -59,9 +24,8 @@ pub struct CtrlKbdLed { // TODO: config stores the keyboard type as an AuraPower, use or update this pub led_prod: AuraDevice, pub led_node: LEDNode, - pub kd_brightness: KeyboardLed, + pub sysfs_node: KeyboardLed, pub supported_modes: LaptopLedData, - pub flip_effect_write: bool, pub per_key_mode_active: bool, pub config: AuraConfig, } @@ -145,50 +109,15 @@ impl CtrlKbdLed { let ctrl = CtrlKbdLed { led_prod, - led_node, // on TUF this is the same as rgb_led / kd_brightness - kd_brightness: rgb_led, // If was none then we already returned above + led_node, // on TUF this is the same as rgb_led / kd_brightness + sysfs_node: rgb_led, // If was none then we already returned above supported_modes, - flip_effect_write: false, per_key_mode_active: false, config: config_loaded, }; Ok(ctrl) } - pub(super) fn get_brightness(&self) -> Result { - self.kd_brightness - .get_brightness() - .map_err(RogError::Platform) - } - - pub(super) fn set_brightness(&self, brightness: LedBrightness) -> Result<(), RogError> { - self.kd_brightness - .set_brightness(brightness as u8) - .map_err(RogError::Platform) - } - - pub fn next_brightness(&mut self) -> Result<(), RogError> { - let mut bright = (self.config.brightness as u32) + 1; - if bright > 3 { - bright = 0; - } - self.config.brightness = ::from(bright); - self.config.write(); - self.set_brightness(self.config.brightness) - } - - pub fn prev_brightness(&mut self) -> Result<(), RogError> { - let mut bright = self.config.brightness as u32; - if bright == 0 { - bright = 3; - } else { - bright -= 1; - } - self.config.brightness = ::from(bright); - self.config.write(); - self.set_brightness(self.config.brightness) - } - /// Set combination state for boot animation/sleep animation/all leds/keys /// leds/side leds LED active pub(super) fn set_power_states(&mut self) -> Result<(), RogError> { @@ -209,29 +138,6 @@ impl CtrlKbdLed { Ok(()) } - /// Set an Aura effect if the effect mode or zone is supported. - /// - /// On success the aura config file is read to refresh cached values, then - /// the effect is stored and config written to disk. - pub(crate) fn set_effect(&mut self, effect: AuraEffect) -> Result<(), RogError> { - if !self.supported_modes.basic_modes.contains(&effect.mode) - || effect.zone != AuraZone::None - && !self.supported_modes.basic_zones.contains(&effect.zone) - { - return Err(RogError::AuraEffectNotSupported); - } - - self.write_mode(&effect)?; - self.config.read(); // refresh config if successful - self.config.set_builtin(effect); - if self.config.brightness == LedBrightness::Off { - self.config.brightness = LedBrightness::Med; - } - self.config.write(); - self.set_brightness(self.config.brightness)?; - Ok(()) - } - /// Write an effect block. This is for per-key, but can be repurposed to /// write the raw factory mode packets - when doing this it is expected that /// only the first `Vec` (`effect[0]`) is valid. @@ -271,47 +177,11 @@ impl CtrlKbdLed { tuf.set_kbd_rgb_mode(&[0, 0, r, g, b, 0])?; } } - self.flip_effect_write = !self.flip_effect_write; } Ok(()) } - pub(super) fn toggle_mode(&mut self, reverse: bool) -> Result<(), RogError> { - let current = self.config.current_mode; - if let Some(idx) = self - .supported_modes - .basic_modes - .iter() - .position(|v| *v == current) - { - let mut idx = idx; - // goes past end of array - if reverse { - if idx == 0 { - idx = self.supported_modes.basic_modes.len() - 1; - } else { - idx -= 1; - } - } else { - idx += 1; - if idx == self.supported_modes.basic_modes.len() { - idx = 0; - } - } - let next = self.supported_modes.basic_modes[idx]; - - self.config.read(); - // if self.config.builtins.contains_key(&next) { - self.config.current_mode = next; - self.write_current_config_mode()?; - // } - self.config.write(); - } - - Ok(()) - } - - fn write_mode(&mut self, mode: &AuraEffect) -> Result<(), RogError> { + pub fn write_mode(&mut self, mode: &AuraEffect) -> Result<(), RogError> { if let LEDNode::KbdLed(platform) = &self.led_node { let buf = [ 1, @@ -404,82 +274,13 @@ impl CtrlKbdLed { mod tests { use rog_aura::aura_detection::{LaptopLedData, PowerZones}; use rog_aura::usb::AuraDevice; - use rog_aura::{AuraEffect, AuraModeNum, AuraZone, Colour}; + use rog_aura::{AuraModeNum, AuraZone}; use rog_platform::keyboard_led::KeyboardLed; use super::CtrlKbdLed; use crate::ctrl_aura::config::AuraConfig; use crate::ctrl_aura::controller::LEDNode; - #[test] - // #[ignore = "Must be manually run due to detection stage"] - fn check_set_mode_errors() { - // Checking to ensure set_mode errors when unsupported modes are tried - let config = AuraConfig::from_default_support(AuraDevice::X19b6, &LaptopLedData::default()); - let supported_modes = LaptopLedData { - board_name: String::new(), - layout_name: "ga401".to_owned(), - basic_modes: vec![AuraModeNum::Static], - basic_zones: vec![], - advanced_type: rog_aura::AdvancedAuraType::None, - power_zones: vec![PowerZones::Keyboard, PowerZones::RearGlow], - }; - let mut controller = CtrlKbdLed { - led_prod: AuraDevice::X19b6, - led_node: LEDNode::None, - kd_brightness: KeyboardLed::default(), - supported_modes, - flip_effect_write: false, - per_key_mode_active: false, - config, - }; - - let mut effect = AuraEffect { - colour1: Colour { - r: 0xff, - g: 0x00, - b: 0xff, - }, - zone: AuraZone::None, - ..Default::default() - }; - - // This error comes from write_bytes because we don't have a keyboard node - // stored - assert_eq!( - controller - .set_effect(effect.clone()) - .unwrap_err() - .to_string(), - "No supported Aura keyboard" - ); - - effect.mode = AuraModeNum::Laser; - assert_eq!( - controller - .set_effect(effect.clone()) - .unwrap_err() - .to_string(), - "Aura effect not supported" - ); - - effect.mode = AuraModeNum::Static; - effect.zone = AuraZone::Key2; - assert_eq!( - controller - .set_effect(effect.clone()) - .unwrap_err() - .to_string(), - "Aura effect not supported" - ); - - controller.supported_modes.basic_zones.push(AuraZone::Key2); - assert_eq!( - controller.set_effect(effect).unwrap_err().to_string(), - "No supported Aura keyboard" - ); - } - #[test] fn create_multizone_if_no_config() { // Checking to ensure set_mode errors when unsupported modes are tried @@ -495,9 +296,8 @@ mod tests { let mut controller = CtrlKbdLed { led_prod: AuraDevice::X19b6, led_node: LEDNode::None, - kd_brightness: KeyboardLed::default(), + sysfs_node: KeyboardLed::default(), supported_modes, - flip_effect_write: false, per_key_mode_active: false, config, }; @@ -534,9 +334,8 @@ mod tests { let mut controller = CtrlKbdLed { led_prod: AuraDevice::X19b6, led_node: LEDNode::None, - kd_brightness: KeyboardLed::default(), + sysfs_node: KeyboardLed::default(), supported_modes, - flip_effect_write: false, per_key_mode_active: false, config, }; diff --git a/asusd/src/ctrl_aura/trait_impls.rs b/asusd/src/ctrl_aura/trait_impls.rs index 0c80fad6..36cf7f77 100644 --- a/asusd/src/ctrl_aura/trait_impls.rs +++ b/asusd/src/ctrl_aura/trait_impls.rs @@ -6,34 +6,36 @@ use config_traits::StdConfig; use log::{debug, error, info, warn}; use rog_aura::advanced::UsbPackets; use rog_aura::usb::{AuraDevice, AuraPowerDev}; -use rog_aura::{AuraEffect, AuraModeNum, LedBrightness}; +use rog_aura::{AuraEffect, AuraModeNum, AuraZone, LedBrightness}; use zbus::export::futures_util::lock::{Mutex, MutexGuard}; use zbus::export::futures_util::StreamExt; +use zbus::fdo::Error as ZbErr; use zbus::{dbus_interface, Connection, SignalContext}; use super::controller::CtrlKbdLed; use crate::error::RogError; use crate::CtrlTask; -pub(super) const ZBUS_PATH: &str = "/org/asuslinux/Aura"; +pub const AURA_ZBUS_NAME: &str = "Aura"; +pub const AURA_ZBUS_PATH: &str = "/org/asuslinux/Aura"; #[derive(Clone)] -pub struct CtrlKbdLedZbus(pub Arc>); +pub struct CtrlAuraZbus(pub Arc>); -impl CtrlKbdLedZbus { +impl CtrlAuraZbus { fn update_config(lock: &mut CtrlKbdLed) -> Result<(), RogError> { - let bright = lock.kd_brightness.get_brightness()?; + let bright = lock.sysfs_node.get_brightness()?; lock.config.read(); - lock.config.brightness = (bright as u32).into(); + lock.config.brightness = bright.into(); lock.config.write(); Ok(()) } } #[async_trait] -impl crate::ZbusRun for CtrlKbdLedZbus { +impl crate::ZbusRun for CtrlAuraZbus { async fn add_to_server(self, server: &mut Connection) { - Self::add_to_server_helper(self, ZBUS_PATH, server).await; + Self::add_to_server_helper(self, AURA_ZBUS_PATH, server).await; } } @@ -41,25 +43,130 @@ impl crate::ZbusRun for CtrlKbdLedZbus { /// /// LED commands are split between Brightness, Modes, Per-Key #[dbus_interface(name = "org.asuslinux.Daemon")] -impl CtrlKbdLedZbus { - /// Set the keyboard brightness level (0-3) - async fn set_brightness(&mut self, brightness: LedBrightness) { +impl CtrlAuraZbus { + /// Return the device type for this Aura keyboard + #[dbus_interface(property)] + async fn device_type(&self) -> AuraDevice { let ctrl = self.0.lock().await; - ctrl.set_brightness(brightness) - .map_err(|err| warn!("{}", err)) - .ok(); + ctrl.led_prod + } + + /// Return the current LED brightness + #[dbus_interface(property)] + async fn brightness(&self) -> Result { + let ctrl = self.0.lock().await; + Ok(ctrl.sysfs_node.get_brightness().map(|n| n.into())?) + } + + /// Set the keyboard brightness level (0-3) + #[dbus_interface(property)] + async fn set_brightness(&mut self, brightness: LedBrightness) -> Result<(), ZbErr> { + let ctrl = self.0.lock().await; + Ok(ctrl.sysfs_node.set_brightness(brightness.into())?) + } + + /// Total levels of brightness available + #[dbus_interface(property)] + async fn supported_brightness(&self) -> Vec { + vec![ + LedBrightness::Off, + LedBrightness::Low, + LedBrightness::Med, + LedBrightness::High, + ] + } + + /// The total available modes + #[dbus_interface(property)] + async fn supported_modes(&self) -> Result, ZbErr> { + let ctrl = self.0.lock().await; + Ok(ctrl.config.builtins.keys().cloned().collect()) + } + + /// The current mode data + #[dbus_interface(property)] + async fn led_mode(&self) -> Result { + let ctrl = self.0.lock().await; + Ok(ctrl.config.current_mode) + } + + /// Set an Aura effect if the effect mode or zone is supported. + /// + /// On success the aura config file is read to refresh cached values, then + /// the effect is stored and config written to disk. + #[dbus_interface(property)] + async fn set_led_mode(&mut self, num: AuraModeNum) -> Result<(), ZbErr> { + let mut ctrl = self.0.lock().await; + ctrl.config.current_mode = num; + ctrl.write_current_config_mode()?; + if ctrl.config.brightness == LedBrightness::Off { + ctrl.config.brightness = LedBrightness::Med; + } + ctrl.sysfs_node + .set_brightness(ctrl.config.brightness.into())?; + ctrl.config.write(); + Ok(()) + } + + /// The current mode data + #[dbus_interface(property)] + async fn led_mode_data(&self) -> Result { + let ctrl = self.0.lock().await; + let mode = ctrl.config.current_mode; + match ctrl.config.builtins.get(&mode) { + Some(effect) => Ok(effect.clone()), + None => Err(ZbErr::Failed("Could not get the current effect".into())), + } + } + + /// Set an Aura effect if the effect mode or zone is supported. + /// + /// On success the aura config file is read to refresh cached values, then + /// the effect is stored and config written to disk. + #[dbus_interface(property)] + async fn set_led_mode_data(&mut self, effect: AuraEffect) -> Result<(), ZbErr> { + let mut ctrl = self.0.lock().await; + if !ctrl.supported_modes.basic_modes.contains(&effect.mode) + || effect.zone != AuraZone::None + && !ctrl.supported_modes.basic_zones.contains(&effect.zone) + { + return Err(ZbErr::NotSupported(format!( + "The Aura effect is not supported: {effect:?}" + ))); + } + + ctrl.write_mode(&effect)?; + if ctrl.config.brightness == LedBrightness::Off { + ctrl.config.brightness = LedBrightness::Med; + } + ctrl.sysfs_node + .set_brightness(ctrl.config.brightness.into())?; + ctrl.config.set_builtin(effect); + ctrl.config.write(); + Ok(()) + } + + /// Get the data set for every mode available + async fn all_mode_data(&self) -> BTreeMap { + let ctrl = self.0.lock().await; + ctrl.config.builtins.clone() + } + + // As property doesn't work for AuraPowerDev (complexity of serialization?) + #[dbus_interface(property)] + async fn led_power(&self) -> AuraPowerDev { + let ctrl = self.0.lock().await; + AuraPowerDev::from(&ctrl.config.enabled) } /// Set a variety of states, input is array of enum. /// `enabled` sets if the sent array should be disabled or enabled /// /// For Modern ROG devices the "enabled" flag is ignored. - async fn set_led_power( - &mut self, - #[zbus(signal_context)] ctxt: SignalContext<'_>, - options: AuraPowerDev, - enabled: bool, - ) -> zbus::fdo::Result<()> { + #[dbus_interface(property)] + async fn set_led_power(&mut self, options: (AuraPowerDev, bool)) -> Result<(), ZbErr> { + let enabled = options.1; + let options = options.0; let mut ctrl = self.0.lock().await; for p in options.tuf { ctrl.config.enabled.set_tuf(p, enabled); @@ -68,158 +175,27 @@ impl CtrlKbdLedZbus { ctrl.config.enabled.set_0x1866(p, enabled); } ctrl.config.enabled.set_0x19b6(options.rog); - ctrl.config.write(); - - ctrl.set_power_states().map_err(|e| { + Ok(ctrl.set_power_states().map_err(|e| { warn!("{}", e); e - })?; - - Self::notify_power_states(&ctxt, &AuraPowerDev::from(&ctrl.config.enabled)) - .await - .unwrap_or_else(|err| warn!("{}", err)); - Ok(()) - } - - async fn set_led_mode( - &mut self, - #[zbus(signal_context)] ctxt: SignalContext<'_>, - effect: AuraEffect, - ) -> zbus::fdo::Result<()> { - let mut ctrl = self.0.lock().await; - - ctrl.set_effect(effect).map_err(|e| { - warn!("{}", e); - e - })?; - - ctrl.set_brightness(ctrl.config.brightness).map_err(|e| { - warn!("{}", e); - e - })?; - - if let Some(mode) = ctrl.config.builtins.get(&ctrl.config.current_mode) { - Self::notify_led(&ctxt, mode.clone()) - .await - .unwrap_or_else(|err| warn!("{}", err)); - } - Ok(()) - } - - async fn next_led_mode( - &self, - #[zbus(signal_context)] ctxt: SignalContext<'_>, - ) -> zbus::fdo::Result<()> { - let mut ctrl = self.0.lock().await; - - ctrl.toggle_mode(false).map_err(|e| { - warn!("{}", e); - e - })?; - - if let Some(mode) = ctrl.config.builtins.get(&ctrl.config.current_mode) { - Self::notify_led(&ctxt, mode.clone()) - .await - .unwrap_or_else(|err| warn!("{}", err)); - } - - Ok(()) - } - - async fn prev_led_mode( - &self, - #[zbus(signal_context)] ctxt: SignalContext<'_>, - ) -> zbus::fdo::Result<()> { - let mut ctrl = self.0.lock().await; - - ctrl.toggle_mode(true).map_err(|e| { - warn!("{}", e); - e - })?; - - if let Some(mode) = ctrl.config.builtins.get(&ctrl.config.current_mode) { - Self::notify_led(&ctxt, mode.clone()) - .await - .unwrap_or_else(|err| warn!("{}", err)); - } - - Ok(()) - } - - async fn next_led_brightness(&self) -> zbus::fdo::Result<()> { - let mut ctrl = self.0.lock().await; - ctrl.next_brightness().map_err(|e| { - warn!("{}", e); - e - })?; - Ok(()) - } - - async fn prev_led_brightness(&self) -> zbus::fdo::Result<()> { - let mut ctrl = self.0.lock().await; - ctrl.prev_brightness().map_err(|e| { - warn!("{}", e); - e - })?; - Ok(()) - } - - /// Return the device type for this Aura keyboard - async fn device_type(&self) -> AuraDevice { - let ctrl = self.0.lock().await; - ctrl.led_prod - } - - // As property doesn't work for AuraPowerDev (complexity of serialization?) - // #[dbus_interface(property)] - async fn led_power(&self) -> AuraPowerDev { - let ctrl = self.0.lock().await; - AuraPowerDev::from(&ctrl.config.enabled) - } - - /// Return the current mode data - async fn led_mode(&self) -> AuraModeNum { - let ctrl = self.0.lock().await; - ctrl.config.current_mode - } - - /// Return a list of available modes - async fn led_modes(&self) -> BTreeMap { - let ctrl = self.0.lock().await; - ctrl.config.builtins.clone() + })?) } /// On machine that have some form of either per-key keyboard or per-zone /// this can be used to write custom effects over dbus. The input is a /// nested `Vec>` where `Vec` is a raw USB packet - async fn direct_addressing_raw(&self, data: UsbPackets) -> zbus::fdo::Result<()> { + async fn direct_addressing_raw(&self, data: UsbPackets) -> Result<(), ZbErr> { let mut ctrl = self.0.lock().await; ctrl.write_effect_block(&data)?; Ok(()) } - - /// Return the current LED brightness - #[dbus_interface(property)] - async fn led_brightness(&self) -> i8 { - let ctrl = self.0.lock().await; - ctrl.get_brightness().map(|n| n as i8).unwrap_or(-1) - } - - #[dbus_interface(signal)] - async fn notify_led(signal_ctxt: &SignalContext<'_>, data: AuraEffect) -> zbus::Result<()>; - - #[dbus_interface(signal)] - async fn notify_power_states( - signal_ctxt: &SignalContext<'_>, - data: &AuraPowerDev, - ) -> zbus::Result<()>; } #[async_trait] -impl CtrlTask for CtrlKbdLedZbus { +impl CtrlTask for CtrlAuraZbus { fn zbus_path() -> &'static str { - ZBUS_PATH + AURA_ZBUS_PATH } async fn create_tasks(&self, _: SignalContext<'static>) -> Result<(), RogError> { @@ -227,7 +203,8 @@ impl CtrlTask for CtrlKbdLedZbus { // If waking up if !start { info!("CtrlKbdLedTask reloading brightness and modes"); - lock.set_brightness(lock.config.brightness) + lock.sysfs_node + .set_brightness(lock.config.brightness.into()) .map_err(|e| error!("CtrlKbdLedTask: {e}")) .ok(); lock.write_current_config_mode() @@ -270,7 +247,7 @@ impl CtrlTask for CtrlKbdLedZbus { let ctrl2 = self.0.clone(); let ctrl = self.0.lock().await; - let watch = ctrl.kd_brightness.monitor_brightness()?; + let watch = ctrl.sysfs_node.monitor_brightness()?; tokio::spawn(async move { let mut buffer = [0; 32]; watch @@ -289,7 +266,7 @@ impl CtrlTask for CtrlKbdLedZbus { } #[async_trait] -impl crate::Reloadable for CtrlKbdLedZbus { +impl crate::Reloadable for CtrlAuraZbus { async fn reload(&mut self) -> Result<(), RogError> { let mut ctrl = self.0.lock().await; debug!("CtrlKbdLedZbus: reloading keyboard mode"); diff --git a/asusd/src/ctrl_fancurves.rs b/asusd/src/ctrl_fancurves.rs new file mode 100644 index 00000000..ed8b1116 --- /dev/null +++ b/asusd/src/ctrl_fancurves.rs @@ -0,0 +1,295 @@ +use std::path::PathBuf; +use std::sync::Arc; + +use async_trait::async_trait; +use config_traits::{StdConfig, StdConfigLoad}; +use futures_lite::StreamExt; +use log::{debug, error, info, warn}; +use rog_platform::platform::{PlatformPolicy, RogPlatform}; +use rog_profiles::error::ProfileError; +use rog_profiles::fan_curve_set::CurveData; +use rog_profiles::{find_fan_curve_node, FanCurvePU, FanCurveProfiles}; +use serde_derive::{Deserialize, Serialize}; +use tokio::sync::Mutex; +use zbus::{dbus_interface, Connection, SignalContext}; + +use crate::error::RogError; +use crate::{CtrlTask, CONFIG_PATH_BASE}; + +const MOD_NAME: &str = "FanCurveZbus"; +pub const FAN_CURVE_ZBUS_NAME: &str = "FanCurves"; +pub const FAN_CURVE_ZBUS_PATH: &str = "/org/asuslinux/FanCurves"; + +#[derive(Deserialize, Serialize, Debug, Default)] +pub struct FanCurveConfig { + pub balanced: Vec, + pub performance: Vec, + pub quiet: Vec, + #[serde(skip)] + pub current: u8, +} + +impl StdConfig for FanCurveConfig { + /// Create a new config. The defaults are zeroed so the device must be read + /// to get the actual device defaults. + fn new() -> Self { + Self::default() + } + + fn file_name(&self) -> String { + "fan_curves.ron".to_owned() + } + + fn config_dir() -> std::path::PathBuf { + PathBuf::from(CONFIG_PATH_BASE) + } +} + +impl StdConfigLoad for FanCurveConfig {} + +#[derive(Debug, Clone)] +pub struct CtrlFanCurveZbus { + config: Arc>, + fan_curves: Arc>, + platform: RogPlatform, +} + +// Non-zbus-derive impl +impl CtrlFanCurveZbus { + pub fn new() -> Result { + let platform = RogPlatform::new()?; + if platform.has_throttle_thermal_policy() { + info!("{MOD_NAME}: Device has profile control available"); + find_fan_curve_node()?; + info!("{MOD_NAME}: Device has fan curves available"); + let mut config = FanCurveConfig::new(); + let mut fan_curves = FanCurveProfiles::default(); + + // Only do defaults if the config doesn't already exist + if !config.file_path().exists() { + info!("{MOD_NAME}: Fetching default fan curves"); + + for this in [ + PlatformPolicy::Balanced, + PlatformPolicy::Performance, + PlatformPolicy::Quiet, + ] { + // For each profile we need to switch to it before we + // can read the existing values from hardware. The ACPI method used + // for this is what limits us. + let next = PlatformPolicy::get_next_profile(this); + platform.set_throttle_thermal_policy(next.into())?; + + let active = platform + .get_throttle_thermal_policy() + .map_or(PlatformPolicy::Balanced, |t| t.into()); + + info!("{MOD_NAME}: {active:?}:"); + for curve in fan_curves.get_fan_curves_for(active) { + info!("{}", String::from(curve)); + } + } + config.write(); + } else { + info!("{MOD_NAME}: Fan curves previously stored, loading..."); + config = config.load(); + fan_curves.balanced = config.balanced.clone(); + fan_curves.performance = config.performance.clone(); + fan_curves.quiet = config.quiet.clone(); + } + + return Ok(Self { + config: Arc::new(Mutex::new(config)), + fan_curves: Arc::new(Mutex::new(fan_curves)), + platform, + }); + } + + Err(ProfileError::NotSupported.into()) + } + + pub async fn update_profiles_from_config(&self) { + let mut fan_curves = self.fan_curves.lock().await; + let config = self.config.lock().await; + fan_curves.balanced = config.balanced.clone(); + fan_curves.performance = config.performance.clone(); + fan_curves.quiet = config.quiet.clone(); + } + + pub async fn update_config_from_profiles(&self) { + let fan_curves = self.fan_curves.lock().await; + let mut config = self.config.lock().await; + config.balanced = fan_curves.balanced.clone(); + config.performance = fan_curves.performance.clone(); + config.quiet = fan_curves.quiet.clone(); + } +} + +#[dbus_interface(name = "org.asuslinux.Daemon")] +impl CtrlFanCurveZbus { + /// Set all fan curves for a profile to enabled status. Will also activate a + /// fan curve if in the same profile mode + async fn set_fan_curves_enabled( + &mut self, + profile: PlatformPolicy, + enabled: bool, + ) -> zbus::fdo::Result<()> { + let mut fan_curves = self.fan_curves.lock().await; + fan_curves.set_profile_curves_enabled(profile, enabled); + fan_curves.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?; + + self.update_config_from_profiles().await; + self.config.lock().await.write(); + Ok(()) + } + + /// Set a single fan curve for a profile to enabled status. Will also + /// activate a fan curve if in the same profile mode + async fn set_profile_fan_curve_enabled( + &mut self, + profile: PlatformPolicy, + fan: FanCurvePU, + enabled: bool, + ) -> zbus::fdo::Result<()> { + let mut fan_curves = self.fan_curves.lock().await; + fan_curves.set_profile_fan_curve_enabled(profile, fan, enabled); + fan_curves.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?; + + self.update_config_from_profiles().await; + self.config.lock().await.write(); + Ok(()) + } + + /// Get the fan-curve data for the currently active PlatformPolicy + async fn fan_curve_data( + &mut self, + profile: PlatformPolicy, + ) -> zbus::fdo::Result> { + let fan_curves = self.fan_curves.lock().await; + let curve = fan_curves.get_fan_curves_for(profile); + Ok(curve.to_vec()) + } + + /// Set the fan curve for the specified profile. + /// Will also activate the fan curve if the user is in the same mode. + async fn set_fan_curve( + &mut self, + profile: PlatformPolicy, + curve: CurveData, + ) -> zbus::fdo::Result<()> { + let mut fan_curves = self.fan_curves.lock().await; + fan_curves.save_fan_curve(curve, profile)?; + fan_curves.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?; + + self.update_config_from_profiles().await; + self.config.lock().await.write(); + + Ok(()) + } + + /// Reset the stored (self) and device curve to the defaults of the + /// platform. + /// + /// Each platform_profile has a different default and the defualt can be + /// read only for the currently active profile. + async fn set_active_curve_to_defaults(&mut self) -> zbus::fdo::Result<()> { + let mut fan_curves = self.fan_curves.lock().await; + let active = self.platform.get_throttle_thermal_policy()?; + fan_curves.set_active_curve_to_defaults(active.into(), &mut find_fan_curve_node()?)?; + + self.update_config_from_profiles().await; + self.config.lock().await.write(); + Ok(()) + } + + /// Reset the stored (self) and device curve to the defaults of the + /// platform. + /// + /// Each platform_profile has a different default and the defualt can be + /// read only for the currently active profile. + async fn reset_profile_curves(&self, profile: PlatformPolicy) -> zbus::fdo::Result<()> { + let mut fan_curves = self.fan_curves.lock().await; + + let active = self + .platform + .get_throttle_thermal_policy() + .unwrap_or(PlatformPolicy::Balanced.into()); + + self.platform.set_throttle_thermal_policy(profile.into())?; + fan_curves.set_active_curve_to_defaults(active.into(), &mut find_fan_curve_node()?)?; + self.platform.set_throttle_thermal_policy(active)?; + + self.update_config_from_profiles().await; + self.config.lock().await.write(); + Ok(()) + } +} + +#[async_trait] +impl crate::ZbusRun for CtrlFanCurveZbus { + async fn add_to_server(self, server: &mut Connection) { + Self::add_to_server_helper(self, FAN_CURVE_ZBUS_PATH, server).await; + } +} + +#[async_trait] +impl CtrlTask for CtrlFanCurveZbus { + fn zbus_path() -> &'static str { + FAN_CURVE_ZBUS_PATH + } + + async fn create_tasks(&self, _signal_ctxt: SignalContext<'static>) -> Result<(), RogError> { + let watch_throttle_thermal_policy = self.platform.monitor_throttle_thermal_policy()?; + let platform = self.platform.clone(); + let config = self.config.clone(); + let fan_curves = self.fan_curves.clone(); + + tokio::spawn(async move { + let mut buffer = [0; 32]; + if let Ok(mut stream) = watch_throttle_thermal_policy.into_event_stream(&mut buffer) { + while (stream.next().await).is_some() { + debug!("watch_throttle_thermal_policy changed"); + if let Ok(profile) = platform.get_throttle_thermal_policy().map_err(|e| { + error!("{MOD_NAME}: get_throttle_thermal_policy error: {e}"); + }) { + if profile != config.lock().await.current { + fan_curves + .lock() + .await + .write_profile_curve_to_platform( + profile.into(), + &mut find_fan_curve_node().unwrap(), + ) + .map_err(|e| { + warn!("{MOD_NAME}: write_profile_curve_to_platform, {}", e) + }) + .ok(); + config.lock().await.current = profile; + } + } + } + dbg!("STREAM ENDED"); + } + }); + + Ok(()) + } +} + +#[async_trait] +impl crate::Reloadable for CtrlFanCurveZbus { + /// Fetch the active profile and use that to set all related components up + async fn reload(&mut self) -> Result<(), RogError> { + // let active = self.platform.get_throttle_thermal_policy()?.into(); + // if let Ok(mut device) = find_fan_curve_node() { + // // There is a possibility that the curve was default zeroed, so this call + // // initialises the data from system read and we need to save it + // // after + // self.fan_curves + // .lock() + // .await + // .write_profile_curve_to_platform(active, &mut device)?; + // } + Ok(()) + } +} diff --git a/asusd/src/ctrl_platform.rs b/asusd/src/ctrl_platform.rs index 15e4ef6f..aac22f25 100644 --- a/asusd/src/ctrl_platform.rs +++ b/asusd/src/ctrl_platform.rs @@ -1,17 +1,22 @@ +use std::process::Command; use std::sync::Arc; use async_trait::async_trait; use config_traits::StdConfig; -use log::{error, info, warn}; -use rog_platform::platform::{AsusPlatform, GpuMode}; -use rog_platform::supported::PlatformSupportedFunctions; +use log::{debug, error, info, warn}; +use rog_platform::cpu::CPUControl; +use rog_platform::platform::{GpuMode, PlatformPolicy, Properties, RogPlatform}; +use rog_platform::power::AsusPower; use zbus::export::futures_util::lock::Mutex; use zbus::fdo::Error as FdoErr; -use zbus::{dbus_interface, Connection, SignalContext}; +use zbus::{dbus_interface, Connection, ObjectServer, SignalContext}; use crate::config::Config; +use crate::ctrl_anime::trait_impls::{CtrlAnimeZbus, ANIME_ZBUS_NAME, ANIME_ZBUS_PATH}; +use crate::ctrl_aura::trait_impls::{CtrlAuraZbus, AURA_ZBUS_NAME, AURA_ZBUS_PATH}; +use crate::ctrl_fancurves::{CtrlFanCurveZbus, FAN_CURVE_ZBUS_NAME, FAN_CURVE_ZBUS_PATH}; use crate::error::RogError; -use crate::{task_watch_item, CtrlTask, GetSupported}; +use crate::{task_watch_item, task_watch_item_notify, CtrlTask}; const ZBUS_PATH: &str = "/org/asuslinux/Platform"; @@ -23,13 +28,13 @@ macro_rules! platform_get_value { $self.platform .get() .map_err(|err| { - warn!("CtrlRogBios: {}: {}", $prop_name, err); - FdoErr::Failed(format!("CtrlRogBios: {}: {}", $prop_name, err)) + warn!("RogPlatform: {}: {}", $prop_name, err); + FdoErr::Failed(format!("RogPlatform: {}: {}", $prop_name, err)) }) }) } else { - error!("CtrlRogBios: {} not supported", $prop_name); - return Err(FdoErr::NotSupported(format!("CtrlRogBios: {} not supported", $prop_name))); + error!("RogPlatform: {} not supported", $prop_name); + return Err(FdoErr::NotSupported(format!("RogPlatform: {} not supported", $prop_name))); } }) } @@ -42,8 +47,8 @@ macro_rules! platform_get_value_if_some { let lock = $self.config.lock().await; Ok(lock.ppt_pl1_spl.unwrap_or($default)) } else { - error!("CtrlRogBios: {} not supported", $prop_name); - return Err(FdoErr::NotSupported(format!("CtrlRogBios: {} not supported", $prop_name))); + error!("RogPlatform: {} not supported", $prop_name); + return Err(FdoErr::NotSupported(format!("RogPlatform: {} not supported", $prop_name))); } }) } @@ -55,8 +60,8 @@ macro_rules! platform_set_bool { if $self.platform.has() { concat_idents::concat_idents!(set = set_, $property { $self.platform.set($new_value).map_err(|err| { - error!("CtrlRogBios: {} {err}", $prop_name); - FdoErr::NotSupported(format!("CtrlRogBios: {} {err}", $prop_name)) + error!("RogPlatform: {} {err}", $prop_name); + FdoErr::NotSupported(format!("RogPlatform: {} {err}", $prop_name)) })?; }); let mut lock = $self.config.lock().await; @@ -64,8 +69,8 @@ macro_rules! platform_set_bool { lock.write(); Ok(()) } else { - error!("CtrlRogBios: {} not supported", $prop_name); - Err(FdoErr::NotSupported(format!("CtrlRogBios: {} not supported", $prop_name))) + error!("RogPlatform: {} not supported", $prop_name); + Err(FdoErr::NotSupported(format!("RogPlatform: {} not supported", $prop_name))) } }) } @@ -77,23 +82,23 @@ macro_rules! platform_set_with_min_max { ($self:ident, $property:tt, $prop_name:literal, $new_value:expr, $min_value:expr, $max_value:expr) => { if !($min_value..=$max_value).contains(&$new_value) { Err(FdoErr::Failed( - format!("CtrlRogBios: {} value not in range {}=..={}", $prop_name, $min_value, $max_value) + format!("RogPlatform: {} value not in range {}=..={}", $prop_name, $min_value, $max_value) )) } else { concat_idents::concat_idents!(has = has_, $property { if $self.platform.has() { concat_idents::concat_idents!(set = set_, $property { $self.platform.set($new_value).map_err(|err| { - error!("CtrlRogBios: {} {err}", $prop_name); - FdoErr::NotSupported(format!("CtrlRogBios: {} {err}", $prop_name)) + error!("RogPlatform: {} {err}", $prop_name); + FdoErr::NotSupported(format!("RogPlatform: {} {err}", $prop_name)) })?; }); let mut lock = $self.config.lock().await; lock.$property = Some($new_value); lock.write(); } else { - error!("CtrlRogBios: {} not supported", $prop_name); - return Err(FdoErr::NotSupported(format!("CtrlRogBios: {} not supported", $prop_name))); + error!("RogPlatform: {} not supported", $prop_name); + return Err(FdoErr::NotSupported(format!("RogPlatform: {} not supported", $prop_name))); } }); Ok(()) @@ -103,29 +108,30 @@ macro_rules! platform_set_with_min_max { #[derive(Clone)] pub struct CtrlPlatform { - platform: AsusPlatform, + power: AsusPower, + platform: RogPlatform, + cpu_control: Option, config: Arc>, } -impl GetSupported for CtrlPlatform { - type A = PlatformSupportedFunctions; - - fn get_supported() -> Self::A { - let platform = AsusPlatform::new().unwrap_or_default(); - platform.into() - } -} - impl CtrlPlatform { pub fn new(config: Arc>) -> Result { - let platform = AsusPlatform::new()?; + let platform = RogPlatform::new()?; + let power = AsusPower::new()?; if !platform.has_gpu_mux_mode() { info!("G-Sync Switchable Graphics or GPU MUX not detected"); info!("Standard graphics switching will still work."); } - Ok(CtrlPlatform { platform, config }) + Ok(CtrlPlatform { + power, + platform, + config, + cpu_control: CPUControl::new() + .map_err(|e| error!("Couldn't get CPU control sysfs: {e}")) + .ok(), + }) } fn set_gfx_mode(&self, mode: GpuMode) -> Result<(), RogError> { @@ -138,16 +144,51 @@ impl CtrlPlatform { } Ok(()) } + + async fn run_ac_or_bat_cmd(&self, power_plugged: bool) { + let prog: Vec = if power_plugged { + // AC ONLINE + self.config + .lock() + .await + .ac_command + .split_whitespace() + .map(|s| s.to_string()) + .collect() + } else { + // BATTERY + self.config + .lock() + .await + .bat_command + .split_whitespace() + .map(|s| s.to_string()) + .collect() + }; + if prog.len() > 1 { + let mut cmd = Command::new(&prog[0]); + for arg in prog.iter().skip(1) { + cmd.arg(arg); + } + if let Err(e) = cmd.spawn() { + if power_plugged { + error!("AC power command error: {e}"); + } else { + error!("Battery power command error: {e}"); + } + } + } + } } #[dbus_interface(name = "org.asuslinux.Daemon")] impl CtrlPlatform { /// Returns a list of property names that this system supports - fn supported_properties(&self) -> Vec { + async fn supported_properties(&self) -> Vec { let mut supported = Vec::new(); - macro_rules! push_name { - ($property:tt, $prop_name:literal) => { + macro_rules! platform_name { + ($property:tt, $prop_name:ty) => { concat_idents::concat_idents!(has = has_, $property { if self.platform.has() { supported.push($prop_name.to_owned()); @@ -156,29 +197,91 @@ impl CtrlPlatform { } } - push_name!(dgpu_disable, "dgpu_disable"); - push_name!(gpu_mux_mode, "gpu_mux_mode"); - push_name!(post_animation_sound, "post_animation_sound"); - push_name!(panel_od, "panel_od"); - push_name!(mini_led_mode, "mini_led_mode"); - push_name!(egpu_enable, "egpu_enable"); + macro_rules! power_name { + ($property:tt, $prop_name:ty) => { + concat_idents::concat_idents!(has = has_, $property { + if self.power.has() { + supported.push($prop_name.to_owned()); + } + }) + } + } - push_name!(ppt_pl1_spl, "ppt_pl1_spl"); - push_name!(ppt_pl2_sppt, "ppt_pl2_sppt"); - push_name!(ppt_fppt, "ppt_fppt"); - push_name!(ppt_apu_sppt, "ppt_apu_sppt"); - push_name!(ppt_platform_sppt, "ppt_platform_sppt"); - push_name!(nv_dynamic_boost, "nv_dynamic_boost"); - push_name!(nv_temp_target, "nv_temp_target"); + // TODO: automate this + power_name!( + charge_control_end_threshold, + Properties::ChargeControlEndThreshold + ); + + platform_name!(dgpu_disable, Properties::DgpuDisable); + platform_name!(gpu_mux_mode, Properties::GpuMuxMode); + platform_name!(post_animation_sound, Properties::PostAnimationSound); + platform_name!(panel_od, Properties::PanelOd); + platform_name!(mini_led_mode, Properties::MiniLedMode); + platform_name!(egpu_enable, Properties::EgpuEnable); + platform_name!(throttle_thermal_policy, Properties::PlatformPolicy); + + platform_name!(ppt_pl1_spl, Properties::PptPl1Spl); + platform_name!(ppt_pl2_sppt, Properties::PptPl2Sppt); + platform_name!(ppt_fppt, Properties::PptFppt); + platform_name!(ppt_apu_sppt, Properties::PptApuSppt); + platform_name!(ppt_platform_sppt, Properties::PptPlatformSppt); + platform_name!(nv_dynamic_boost, Properties::NvDynamicBoost); + platform_name!(nv_temp_target, Properties::NvTempTarget); supported } + async fn supported_interfaces( + &self, + #[zbus(object_server)] server: &ObjectServer, + ) -> Vec { + let mut interfaces = Vec::default(); + if server + .interface::<_, CtrlAnimeZbus>(ANIME_ZBUS_PATH) + .await + .is_ok() + { + interfaces.push(ANIME_ZBUS_NAME.to_owned()); + } + if server + .interface::<_, CtrlAuraZbus>(AURA_ZBUS_PATH) + .await + .is_ok() + { + interfaces.push(AURA_ZBUS_NAME.to_owned()); + } + if server + .interface::<_, CtrlFanCurveZbus>(FAN_CURVE_ZBUS_PATH) + .await + .is_ok() + { + interfaces.push(FAN_CURVE_ZBUS_NAME.to_owned()); + } + interfaces + } + + #[dbus_interface(property)] + fn charge_control_end_threshold(&self) -> Result { + let limit = self.power.get_charge_control_end_threshold()?; + Ok(limit) + } + + #[dbus_interface(property)] + async fn set_charge_control_end_threshold(&mut self, limit: u8) -> Result<(), FdoErr> { + if !(20..=100).contains(&limit) { + return Err(RogError::ChargeLimit(limit))?; + } + self.power.set_charge_control_end_threshold(limit)?; + self.config.lock().await.charge_control_end_threshold = limit; + Ok(()) + } + #[dbus_interface(property)] fn gpu_mux_mode(&self) -> Result { self.platform.get_gpu_mux_mode().map_err(|err| { - warn!("CtrlRogBios: set_gpu_mux_mode {err}"); - FdoErr::NotSupported("CtrlRogBios: set_gpu_mux_mode not supported".to_owned()) + warn!("RogPlatform: set_gpu_mux_mode {err}"); + FdoErr::NotSupported("RogPlatform: set_gpu_mux_mode not supported".to_owned()) }) } @@ -186,12 +289,70 @@ impl CtrlPlatform { async fn set_gpu_mux_mode(&mut self, mode: u8) -> Result<(), FdoErr> { if self.platform.has_gpu_mux_mode() { self.set_gfx_mode(mode.into()).map_err(|err| { - warn!("CtrlRogBios: set_gpu_mux_mode {}", err); - FdoErr::Failed(format!("CtrlRogBios: set_gpu_mux_mode: {err}")) + warn!("RogPlatform: set_gpu_mux_mode {}", err); + FdoErr::Failed(format!("RogPlatform: set_gpu_mux_mode: {err}")) }) } else { Err(FdoErr::NotSupported( - "CtrlRogBios: set_gpu_mux_mode not supported".to_owned(), + "RogPlatform: set_gpu_mux_mode not supported".to_owned(), + )) + } + } + + /// Toggle to next platform_profile. Names provided by `Profiles`. + /// If fan-curves are supported will also activate a fan curve for profile. + async fn next_throttle_thermal_policy( + &mut self, + #[zbus(signal_context)] ctxt: SignalContext<'_>, + ) -> Result<(), FdoErr> { + let policy: PlatformPolicy = + platform_get_value!(self, throttle_thermal_policy, "throttle_thermal_policy") + .map(|n| n.into())?; + + if self.platform.has_throttle_thermal_policy() { + if let Some(cpu) = self.cpu_control.as_ref() { + info!("PlatformPolicy setting EPP"); + cpu.set_epp(policy.into())? + } + self.platform + .set_throttle_thermal_policy(policy.into()) + .map_err(|err| { + warn!("RogPlatform: throttle_thermal_policy {}", err); + FdoErr::Failed(format!("RogPlatform: throttle_thermal_policy: {err}")) + })?; + self.config.lock().await.platform_policy_to_restore = policy; + Ok(self.throttle_thermal_policy_changed(&ctxt).await?) + } else { + Err(FdoErr::NotSupported( + "RogPlatform: throttle_thermal_policy not supported".to_owned(), + )) + } + } + + #[dbus_interface(property)] + fn throttle_thermal_policy(&self) -> Result { + platform_get_value!(self, throttle_thermal_policy, "throttle_thermal_policy") + .map(|n| n.into()) + } + + #[dbus_interface(property)] + async fn set_throttle_thermal_policy(&mut self, policy: PlatformPolicy) -> Result<(), FdoErr> { + // TODO: watch for external changes + if self.platform.has_throttle_thermal_policy() { + if let Some(cpu) = self.cpu_control.as_ref() { + info!("PlatformPolicy setting EPP"); + cpu.set_epp(policy.into())? + } + self.config.lock().await.platform_policy_to_restore = policy; + self.platform + .set_throttle_thermal_policy(policy.into()) + .map_err(|err| { + warn!("RogPlatform: throttle_thermal_policy {}", err); + FdoErr::Failed(format!("RogPlatform: throttle_thermal_policy: {err}")) + }) + } else { + Err(FdoErr::NotSupported( + "RogPlatform: throttle_thermal_policy not supported".to_owned(), )) } } @@ -203,7 +364,16 @@ impl CtrlPlatform { #[dbus_interface(property)] async fn set_post_animation_sound(&mut self, on: bool) -> Result<(), FdoErr> { - platform_set_bool!(self, post_animation_sound, "post_animation_sound", on) + if self.platform.has_post_animation_sound() { + self.platform.set_post_animation_sound(on).map_err(|err| { + warn!("RogPlatform: set_post_animation_sound {}", err); + FdoErr::Failed(format!("RogPlatform: set_post_animation_sound: {err}")) + }) + } else { + Err(FdoErr::NotSupported( + "RogPlatform: set_post_animation_sound not supported".to_owned(), + )) + } } /// Get the `panel_od` value from platform. Updates the stored value in @@ -315,7 +485,7 @@ impl CtrlPlatform { #[async_trait] impl crate::ZbusRun for CtrlPlatform { async fn add_to_server(self, server: &mut Connection) { - Self::add_to_server_helper(self, "/org/asuslinux/Platform", server).await; + Self::add_to_server_helper(self, ZBUS_PATH, server).await; } } @@ -323,24 +493,72 @@ impl crate::ZbusRun for CtrlPlatform { impl crate::Reloadable for CtrlPlatform { async fn reload(&mut self) -> Result<(), RogError> { if self.platform.has_panel_od() { - let p = if let Some(lock) = self.config.try_lock() { - lock.panel_od - } else { - false - }; - self.platform.set_panel_od(p)?; + self.platform + .set_panel_od(self.config.lock().await.panel_od)?; } + + if self.platform.has_mini_led_mode() { + self.platform + .set_mini_led_mode(self.config.lock().await.mini_led_mode)?; + } + + if self.power.has_charge_control_end_threshold() { + self.power.set_charge_control_end_threshold( + self.config.lock().await.charge_control_end_threshold, + )?; + } + + if self.platform.has_throttle_thermal_policy() { + if let Ok(ac) = self.power.get_online() { + let profile = if ac == 1 { + self.config.lock().await.platform_policy_on_ac + } else { + self.config.lock().await.platform_policy_on_battery + }; + self.platform.set_throttle_thermal_policy(profile.into())?; + if let Some(cpu) = self.cpu_control.as_ref() { + cpu.set_epp(profile.into())?; + } + } + } + + if let Ok(power_plugged) = self.power.get_online() { + self.run_ac_or_bat_cmd(power_plugged > 0).await; + } + Ok(()) } } impl CtrlPlatform { task_watch_item!(panel_od platform); - // task_watch_item!(dgpu_disable platform); - // task_watch_item!(egpu_enable platform); - // task_watch_item!(mini_led_mode platform); + + task_watch_item!(mini_led_mode platform); + + task_watch_item!(charge_control_end_threshold power); + + task_watch_item_notify!(post_animation_sound platform); + + task_watch_item_notify!(dgpu_disable platform); + + task_watch_item_notify!(egpu_enable platform); + // NOTE: see note further below - // task_watch_item!(gpu_mux_mode platform); + task_watch_item_notify!(gpu_mux_mode platform); + + task_watch_item_notify!(ppt_pl1_spl platform); + + task_watch_item_notify!(ppt_pl2_sppt platform); + + task_watch_item_notify!(ppt_fppt platform); + + task_watch_item_notify!(ppt_apu_sppt platform); + + task_watch_item_notify!(ppt_platform_sppt platform); + + task_watch_item_notify!(nv_dynamic_boost platform); + + task_watch_item_notify!(nv_temp_target platform); } #[async_trait] @@ -352,11 +570,12 @@ impl CtrlTask for CtrlPlatform { async fn create_tasks(&self, signal_ctxt: SignalContext<'static>) -> Result<(), RogError> { let platform1 = self.clone(); let platform2 = self.clone(); + let platform3 = self.clone(); self.create_sys_event_tasks( move |sleeping| { let platform1 = platform1.clone(); async move { - info!("CtrlRogBios reloading panel_od"); + info!("RogPlatform reloading panel_od"); let lock = platform1.config.lock().await; if !sleeping && platform1.platform.has_panel_od() { platform1 @@ -368,12 +587,25 @@ impl CtrlTask for CtrlPlatform { }) .ok(); } + if sleeping && platform1.power.has_charge_control_end_threshold() { + platform1.config.lock().await.charge_control_end_threshold = platform1 + .power + .get_charge_control_end_threshold() + .unwrap_or(100); + } else if !sleeping && platform1.power.has_charge_control_end_threshold() { + platform1 + .power + .set_charge_control_end_threshold( + platform1.config.lock().await.charge_control_end_threshold, + ) + .ok(); + } } }, move |shutting_down| { let platform2 = platform2.clone(); async move { - info!("CtrlRogBios reloading panel_od"); + info!("RogPlatform reloading panel_od"); let lock = platform2.config.lock().await; if !shutting_down && platform2.platform.has_panel_od() { platform2 @@ -391,20 +623,80 @@ impl CtrlTask for CtrlPlatform { // on lid change async move {} }, - move |_power_plugged| { + move |power_plugged| { + let mut platform3 = platform3.clone(); // power change - async move {} + async move { + let policy = if power_plugged { + platform3.config.lock().await.platform_policy_on_ac + } else { + platform3.config.lock().await.platform_policy_on_battery + }; + platform3 + .set_throttle_thermal_policy(policy) + .await + .map_err(|err| { + warn!("RogPlatform: throttle_thermal_policy {}", err); + FdoErr::Failed(format!("RogPlatform: throttle_thermal_policy: {err}")) + }) + .ok(); + + platform3.run_ac_or_bat_cmd(power_plugged).await; + } }, ) .await; + // This spawns a new task for every item. + // TODO: find a better way to manage this self.watch_panel_od(signal_ctxt.clone()).await?; - // self.watch_dgpu_disable(signal_ctxt.clone()).await?; - // self.watch_egpu_enable(signal_ctxt.clone()).await?; - // self.watch_mini_led_mode(signal_ctxt.clone()).await?; + self.watch_mini_led_mode(signal_ctxt.clone()).await?; + self.watch_charge_control_end_threshold(signal_ctxt.clone()) + .await?; + + self.watch_dgpu_disable(signal_ctxt.clone()).await?; + self.watch_egpu_enable(signal_ctxt.clone()).await?; + // NOTE: Can't have this as a watch because on a write to it, it reverts back to // booted-with value as it does not actually change until reboot. - // self.watch_gpu_mux_mode(signal_ctxt.clone()).await?; + self.watch_gpu_mux_mode(signal_ctxt.clone()).await?; + self.watch_post_animation_sound(signal_ctxt.clone()).await?; + + self.watch_ppt_pl1_spl(signal_ctxt.clone()).await?; + self.watch_ppt_pl2_sppt(signal_ctxt.clone()).await?; + self.watch_ppt_fppt(signal_ctxt.clone()).await?; + self.watch_ppt_apu_sppt(signal_ctxt.clone()).await?; + self.watch_ppt_platform_sppt(signal_ctxt.clone()).await?; + self.watch_nv_dynamic_boost(signal_ctxt.clone()).await?; + self.watch_nv_temp_target(signal_ctxt.clone()).await?; + + let watch_throttle_thermal_policy = self.platform.monitor_throttle_thermal_policy()?; + let ctrl = self.clone(); + + tokio::spawn(async move { + use futures_lite::StreamExt; + let mut buffer = [0; 32]; + if let Ok(mut stream) = watch_throttle_thermal_policy.into_event_stream(&mut buffer) { + while (stream.next().await).is_some() { + // this blocks + debug!("Platform: watch_throttle_thermal_policy changed"); + if let Ok(profile) = ctrl + .platform + .get_throttle_thermal_policy() + .map(PlatformPolicy::from) + .map_err(|e| { + error!("Platform: get_throttle_thermal_policy error: {e}"); + }) + { + if let Some(cpu) = ctrl.cpu_control.as_ref() { + info!("PlatformPolicy setting EPP"); + cpu.set_epp(profile.into()).ok(); + } + ctrl.config.lock().await.platform_policy_to_restore = profile; + } + } + } + }); Ok(()) } diff --git a/asusd/src/ctrl_power.rs b/asusd/src/ctrl_power.rs deleted file mode 100644 index d9ce0f88..00000000 --- a/asusd/src/ctrl_power.rs +++ /dev/null @@ -1,297 +0,0 @@ -use std::process::Command; -use std::sync::Arc; -use std::time::Duration; - -use async_trait::async_trait; -use config_traits::StdConfig; -use log::{error, info, warn}; -use rog_platform::power::AsusPower; -use rog_platform::supported::ChargeSupportedFunctions; -use systemd_zbus::{ManagerProxy as SystemdProxy, Mode, UnitFileState}; -use tokio::time::sleep; -use zbus::export::futures_util::lock::Mutex; -use zbus::{dbus_interface, Connection, SignalContext}; - -use crate::config::Config; -use crate::error::RogError; -use crate::{CtrlTask, GetSupported}; - -const ZBUS_PATH: &str = "/org/asuslinux/Power"; -const NVIDIA_POWERD: &str = "nvidia-powerd.service"; - -impl GetSupported for CtrlPower { - type A = ChargeSupportedFunctions; - - fn get_supported() -> Self::A { - ChargeSupportedFunctions { - charge_level_set: if let Ok(power) = AsusPower::new() { - power.has_charge_control_end_threshold() - } else { - false - }, - } - } -} - -#[derive(Clone)] -pub struct CtrlPower { - power: AsusPower, - config: Arc>, -} - -#[dbus_interface(name = "org.asuslinux.Daemon")] -impl CtrlPower { - async fn set_charge_control_end_threshold( - &mut self, - #[zbus(signal_context)] ctxt: SignalContext<'_>, - limit: u8, - ) -> zbus::fdo::Result<()> { - if !(20..=100).contains(&limit) { - return Err(RogError::ChargeLimit(limit))?; - } - self.set(limit) - .map_err(|err| { - warn!("CtrlCharge: set_limit {}", err); - err - }) - .ok(); - Self::notify_charge_control_end_threshold(&ctxt, limit) - .await - .ok(); - Ok(()) - } - - fn charge_control_end_threshold(&self) -> u8 { - loop { - if let Some(mut config) = self.config.try_lock() { - let limit = self - .power - .get_charge_control_end_threshold() - .map_err(|err| { - warn!("CtrlCharge: get_charge_control_end_threshold {}", err); - err - }) - .unwrap_or(100); - - config.read(); - config.bat_charge_limit = limit; - config.write(); - - return config.bat_charge_limit; - } - } - } - - fn mains_online(&self) -> bool { - if self.power.has_online() { - if let Ok(v) = self.power.get_online() { - return v == 1; - } - } - false - } - - #[dbus_interface(signal)] - async fn notify_charge_control_end_threshold( - ctxt: &SignalContext<'_>, - limit: u8, - ) -> zbus::Result<()>; - - #[dbus_interface(signal)] - async fn notify_mains_online(ctxt: &SignalContext<'_>, on: bool) -> zbus::Result<()>; -} - -#[async_trait] -impl crate::ZbusRun for CtrlPower { - async fn add_to_server(self, server: &mut Connection) { - Self::add_to_server_helper(self, ZBUS_PATH, server).await; - } -} - -#[async_trait] -impl crate::Reloadable for CtrlPower { - async fn reload(&mut self) -> Result<(), RogError> { - if let Some(mut config) = self.config.try_lock() { - config.read(); - self.set(config.bat_charge_limit)?; - } - Ok(()) - } -} - -impl CtrlPower { - // task_watch_item!(charge_control_end_threshold power); - - pub fn new(config: Arc>) -> Result { - Ok(CtrlPower { - power: AsusPower::new()?, - config, - }) - } - - pub(super) fn set(&self, limit: u8) -> Result<(), RogError> { - if !(20..=100).contains(&limit) { - return Err(RogError::ChargeLimit(limit)); - } - - self.power.set_charge_control_end_threshold(limit)?; - - info!("Battery charge limit: {}", limit); - - if let Some(mut config) = self.config.try_lock() { - config.read(); - config.bat_charge_limit = limit; - config.write(); - } - - Ok(()) - } -} - -#[async_trait] -impl CtrlTask for CtrlPower { - fn zbus_path() -> &'static str { - ZBUS_PATH - } - - async fn create_tasks(&self, signal_ctxt: SignalContext<'static>) -> Result<(), RogError> { - let conn = zbus::Connection::system().await?; - let sysd1 = SystemdProxy::new(&conn).await?; - let sysd2 = sysd1.clone(); - let sysd3 = sysd1.clone(); - - let power1 = self.clone(); - let power2 = self.clone(); - self.create_sys_event_tasks( - move |sleeping| { - let power = power1.clone(); - let sysd = sysd1.clone(); - async move { - if !sleeping { - info!("CtrlCharge reloading charge limit"); - let lock = power.config.lock().await; - power - .set(lock.bat_charge_limit) - .map_err(|err| { - warn!("CtrlCharge: set_limit {}", err); - err - }) - .ok(); - - if lock.disable_nvidia_powerd_on_battery { - if let Ok(value) = power.power.get_online() { - do_nvidia_powerd_action(&sysd, value == 1).await; - } - } - } - } - }, - move |shutting_down| { - let power = power2.clone(); - let sysd = sysd2.clone(); - async move { - if !shutting_down { - info!("CtrlCharge reloading charge limit"); - let lock = power.config.lock().await; - power - .set(lock.bat_charge_limit) - .map_err(|err| { - warn!("CtrlCharge: set_limit {}", err); - err - }) - .ok(); - - if lock.disable_nvidia_powerd_on_battery { - if let Ok(value) = power.power.get_online() { - do_nvidia_powerd_action(&sysd, value == 1).await; - } - } - } - } - }, - move |_lid_closed| { - // on lid change - async move {} - }, - move |_power_plugged| { - // power change - async move {} - }, - ) - .await; - - let config = self.config.clone(); - // self.watch_charge_control_end_threshold(signal_ctxt.clone()) - // .await?; - - let ctrl = self.clone(); - tokio::spawn(async move { - let mut online = 10; - loop { - if let Ok(value) = ctrl.power.get_online() { - if online != value { - online = value; - let mut config = config.lock().await; - config.read(); - - if config.disable_nvidia_powerd_on_battery { - do_nvidia_powerd_action(&sysd3, value == 1).await; - } - - Self::notify_mains_online(&signal_ctxt, value == 1) - .await - .unwrap(); - - let mut prog: Vec<&str> = Vec::new(); - if value == 1 { - // AC ONLINE - prog = config.ac_command.split_whitespace().collect(); - } else if value == 0 { - // BATTERY - prog = config.bat_command.split_whitespace().collect(); - } - - if prog.len() > 1 { - let mut cmd = Command::new(prog[0]); - for arg in prog.iter().skip(1) { - cmd.arg(*arg); - } - if let Err(e) = cmd.spawn() { - if value == 1 { - error!("AC power command error: {e}"); - } else { - error!("Battery power command error: {e}"); - } - } - } - } - } - // The inotify doesn't pick up events when the kernel changes internal value - // so we need to watch it with a thread and sleep unfortunately - sleep(Duration::from_secs(1)).await; - } - }); - - Ok(()) - } -} - -async fn do_nvidia_powerd_action(proxy: &SystemdProxy<'_>, ac_on: bool) { - if let Ok(res) = proxy.get_unit_file_state(NVIDIA_POWERD).await { - if res == UnitFileState::Enabled { - if ac_on { - proxy - .start_unit(NVIDIA_POWERD, Mode::Replace) - .await - .map_err(|e| error!("Error stopping {NVIDIA_POWERD}, {e:?}")) - .ok(); - } else { - proxy - .stop_unit(NVIDIA_POWERD, Mode::Replace) - .await - .map_err(|e| error!("Error stopping {NVIDIA_POWERD}, {e:?}")) - .ok(); - } - } - } -} diff --git a/asusd/src/ctrl_profiles/config.rs b/asusd/src/ctrl_profiles/config.rs deleted file mode 100644 index dcb93866..00000000 --- a/asusd/src/ctrl_profiles/config.rs +++ /dev/null @@ -1,60 +0,0 @@ -use std::path::PathBuf; - -use config_traits::{StdConfig, StdConfigLoad}; -use rog_profiles::fan_curve_set::CurveData; -use rog_profiles::Profile; -use serde_derive::{Deserialize, Serialize}; - -use crate::CONFIG_PATH_BASE; - -const CONFIG_FILE: &str = "profile.ron"; -const CONFIG_FAN_FILE: &str = "fan_curves.ron"; - -#[derive(Deserialize, Serialize, Debug)] -pub struct ProfileConfig { - /// For restore on boot - pub active_profile: Profile, -} - -impl StdConfig for ProfileConfig { - fn new() -> Self { - Self { - active_profile: Profile::Balanced, - } - } - - fn config_dir() -> std::path::PathBuf { - PathBuf::from(CONFIG_PATH_BASE) - } - - fn file_name(&self) -> String { - CONFIG_FILE.to_owned() - } -} - -impl StdConfigLoad for ProfileConfig {} - -#[derive(Deserialize, Serialize, Debug, Default)] -pub struct FanCurveConfig { - pub balanced: Vec, - pub performance: Vec, - pub quiet: Vec, -} - -impl StdConfig for FanCurveConfig { - /// Create a new config. The defaults are zeroed so the device must be read - /// to get the actual device defaults. - fn new() -> Self { - Self::default() - } - - fn file_name(&self) -> String { - CONFIG_FAN_FILE.to_owned() - } - - fn config_dir() -> std::path::PathBuf { - PathBuf::from(CONFIG_PATH_BASE) - } -} - -impl StdConfigLoad for FanCurveConfig {} diff --git a/asusd/src/ctrl_profiles/controller.rs b/asusd/src/ctrl_profiles/controller.rs deleted file mode 100644 index ebf58439..00000000 --- a/asusd/src/ctrl_profiles/controller.rs +++ /dev/null @@ -1,171 +0,0 @@ -use config_traits::{StdConfig, StdConfigLoad}; -use log::{info, warn}; -use rog_platform::platform::AsusPlatform; -use rog_platform::supported::PlatformProfileFunctions; -use rog_profiles::error::ProfileError; -use rog_profiles::{FanCurveProfiles, Profile}; - -use super::config::{FanCurveConfig, ProfileConfig}; -use crate::error::RogError; -use crate::GetSupported; - -// TODO: macro wrapper for warn/info/error log macros to add module name -const MOD_NAME: &str = "CtrlPlatformProfile"; - -pub struct FanCurves { - config_file: FanCurveConfig, - profiles: FanCurveProfiles, -} - -impl FanCurves { - pub fn update_profiles_from_config(&mut self) { - self.profiles.balanced = self.config_file.balanced.clone(); - self.profiles.performance = self.config_file.performance.clone(); - self.profiles.quiet = self.config_file.quiet.clone(); - } - - pub fn update_config_from_profiles(&mut self) { - self.config_file.balanced = self.profiles.balanced.clone(); - self.config_file.performance = self.profiles.performance.clone(); - self.config_file.quiet = self.profiles.quiet.clone(); - } - - pub fn profiles(&self) -> &FanCurveProfiles { - &self.profiles - } - - pub fn profiles_mut(&mut self) -> &mut FanCurveProfiles { - &mut self.profiles - } -} - -pub struct CtrlPlatformProfile { - pub profile_config: ProfileConfig, - pub fan_curves: Option, - pub platform: AsusPlatform, -} - -impl GetSupported for CtrlPlatformProfile { - type A = PlatformProfileFunctions; - - fn get_supported() -> Self::A { - if !Profile::is_platform_profile_supported() { - warn!( - "platform_profile kernel interface not found, your laptop does not support this, \ - or the interface is missing." - ); - } - - let res = FanCurveProfiles::supported_fans(); - - if res.is_err() { - info!( - "fan curves kernel interface not found, your laptop does not support this, or the \ - interface is missing." - ); - } - - PlatformProfileFunctions { - platform_profile: Profile::is_platform_profile_supported(), - fans: res.unwrap_or_default(), - } - } -} - -impl CtrlPlatformProfile { - pub fn new(config: ProfileConfig) -> Result { - let platform = AsusPlatform::new()?; - if platform.has_platform_profile() || platform.has_throttle_thermal_policy() { - info!("{MOD_NAME}: Device has profile control available"); - - let mut controller = CtrlPlatformProfile { - profile_config: config, - fan_curves: None, - platform, - }; - if FanCurveProfiles::get_device().is_ok() { - info!("{MOD_NAME}: Device has fan curves available"); - let fan_config = FanCurveConfig::new(); - // Only do defaults if the config doesn't already exist - if !fan_config.file_path().exists() { - info!("{MOD_NAME}: Fetching default fan curves"); - controller.fan_curves = Some(FanCurves { - config_file: fan_config, - profiles: FanCurveProfiles::default(), - }); - for _ in [Profile::Balanced, Profile::Performance, Profile::Quiet] { - // For each profile we need to switch to it before we - // can read the existing values from hardware. The ACPI method used - // for this is what limits us. - let next = - Profile::get_next_profile(controller.profile_config.active_profile); - Profile::set_profile(next) - .map_err(|e| warn!("{MOD_NAME}: set_profile, {}", e)) - .ok(); - controller.profile_config.active_profile = next; - - // Make sure to set the baseline to default - controller.set_active_curve_to_defaults()?; - let active = Profile::get_active_profile().unwrap_or(Profile::Balanced); - - if let Some(curves) = controller.fan_curves.as_ref() { - info!("{MOD_NAME}: {active:?}:"); - for curve in curves.profiles().get_fan_curves_for(active) { - info!("{}", String::from(curve)); - } - } - } - if let Some(curves) = controller.fan_curves.as_ref() { - curves.config_file.write(); - } - } else { - info!("{MOD_NAME}: Fan curves previously stored, loading..."); - let mut fan_curves = FanCurves { - config_file: fan_config.load(), - profiles: FanCurveProfiles::default(), - }; - fan_curves.update_profiles_from_config(); - controller.fan_curves = Some(fan_curves); - } - } - - return Ok(controller); - } - - Err(ProfileError::NotSupported.into()) - } - - pub fn save_config(&mut self) { - self.profile_config.write(); - if let Some(fans) = self.fan_curves.as_mut() { - fans.update_config_from_profiles(); - fans.config_file.write(); // config write - } - } - - /// Set the curve for the active profile active - pub(super) fn write_profile_curve_to_platform(&mut self) -> Result<(), RogError> { - if let Some(curves) = &mut self.fan_curves { - if let Ok(mut device) = FanCurveProfiles::get_device() { - curves.profiles_mut().write_profile_curve_to_platform( - self.profile_config.active_profile, - &mut device, - )?; - } - } - Ok(()) - } - - pub(super) fn set_active_curve_to_defaults(&mut self) -> Result<(), RogError> { - if let Some(curves) = self.fan_curves.as_mut() { - if let Ok(mut device) = FanCurveProfiles::get_device() { - curves.profiles_mut().set_active_curve_to_defaults( - self.profile_config.active_profile, - &mut device, - )?; - curves.update_config_from_profiles(); - } - } - Ok(()) - } -} diff --git a/asusd/src/ctrl_profiles/mod.rs b/asusd/src/ctrl_profiles/mod.rs deleted file mode 100644 index d4212ff9..00000000 --- a/asusd/src/ctrl_profiles/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod config; -pub mod controller; -/// Implements `CtrlTask`, Reloadable, `ZbusRun` -pub mod trait_impls; diff --git a/asusd/src/ctrl_profiles/trait_impls.rs b/asusd/src/ctrl_profiles/trait_impls.rs deleted file mode 100644 index f1bb623f..00000000 --- a/asusd/src/ctrl_profiles/trait_impls.rs +++ /dev/null @@ -1,332 +0,0 @@ -use std::str::FromStr; -use std::sync::Arc; - -use async_trait::async_trait; -use config_traits::StdConfig; -use log::{error, info, warn}; -use rog_profiles::fan_curve_set::CurveData; -use rog_profiles::{FanCurvePU, FanCurveProfiles, Profile}; -use zbus::export::futures_util::lock::Mutex; -use zbus::export::futures_util::StreamExt; -use zbus::fdo::Error; -use zbus::{dbus_interface, Connection, SignalContext}; - -use super::controller::CtrlPlatformProfile; -use crate::error::RogError; -use crate::CtrlTask; - -const MOD_NAME: &str = "ProfileZbus"; - -const ZBUS_PATH: &str = "/org/asuslinux/Profile"; -const UNSUPPORTED_MSG: &str = - "Fan curves are not supported on this laptop or you require a patched kernel"; - -#[derive(Clone)] -pub struct ProfileZbus(pub Arc>); - -#[dbus_interface(name = "org.asuslinux.Daemon")] -impl ProfileZbus { - /// Fetch profile names - fn profiles(&mut self) -> zbus::fdo::Result> { - if let Ok(profiles) = Profile::get_profile_names() { - return Ok(profiles); - } - Err(Error::Failed( - "Failed to get all profile details".to_owned(), - )) - } - - /// Toggle to next platform_profile. Names provided by `Profiles`. - /// If fan-curves are supported will also activate a fan curve for profile. - async fn next_profile(&mut self, #[zbus(signal_context)] ctxt: SignalContext<'_>) { - let mut ctrl = self.0.lock().await; - let next = Profile::get_next_profile(ctrl.profile_config.active_profile); - Profile::set_profile(next) - .map_err(|e| warn!("{MOD_NAME}: set_profile, {}", e)) - .ok(); - ctrl.profile_config.active_profile = next; - ctrl.save_config(); - - Self::notify_profile(&ctxt, ctrl.profile_config.active_profile) - .await - .ok(); - } - - /// Fetch the active profile name - async fn active_profile(&mut self) -> zbus::fdo::Result { - let mut ctrl = self.0.lock().await; - ctrl.profile_config.read(); - Ok(ctrl.profile_config.active_profile) - } - - /// Set this platform_profile name as active - async fn set_active_profile( - &self, - #[zbus(signal_context)] ctxt: SignalContext<'_>, - profile: Profile, - ) { - let mut ctrl = self.0.lock().await; - // Read first just incase the user has modified the config before calling this - ctrl.profile_config.read(); - Profile::set_profile(profile) - .map_err(|e| warn!("{MOD_NAME}: set_profile, {}", e)) - .ok(); - ctrl.profile_config.active_profile = profile; - ctrl.write_profile_curve_to_platform() - .map_err(|e| warn!("{MOD_NAME}: write_profile_curve_to_platform, {}", e)) - .ok(); - - ctrl.save_config(); - - Self::notify_profile(&ctxt, ctrl.profile_config.active_profile) - .await - .ok(); - } - - /// Set all fan curves for a profile to enabled status. Will also activate a - /// fan curve if in the same profile mode - async fn set_fan_curves_enabled( - &mut self, - profile: Profile, - enabled: bool, - ) -> zbus::fdo::Result<()> { - let mut ctrl = self.0.lock().await; - ctrl.profile_config.read(); - if let Some(curves) = &mut ctrl.fan_curves { - curves - .profiles_mut() - .set_profile_curves_enabled(profile, enabled); - - ctrl.write_profile_curve_to_platform() - .map_err(|e| warn!("{MOD_NAME}: write_profile_curve_to_platform, {}", e)) - .ok(); - - ctrl.save_config(); - Ok(()) - } else { - Err(Error::Failed(UNSUPPORTED_MSG.to_owned())) - } - } - - /// Set a single fan curve for a profile to enabled status. Will also - /// activate a fan curve if in the same profile mode - async fn set_profile_fan_curve_enabled( - &mut self, - profile: Profile, - fan: FanCurvePU, - enabled: bool, - ) -> zbus::fdo::Result<()> { - let mut ctrl = self.0.lock().await; - ctrl.profile_config.read(); - if let Some(curves) = &mut ctrl.fan_curves { - curves - .profiles_mut() - .set_profile_fan_curve_enabled(profile, fan, enabled); - - ctrl.write_profile_curve_to_platform() - .map_err(|e| warn!("{MOD_NAME}: write_profile_curve_to_platform, {}", e)) - .ok(); - - ctrl.save_config(); - Ok(()) - } else { - Err(Error::Failed(UNSUPPORTED_MSG.to_owned())) - } - } - - /// Get the fan-curve data for the currently active Profile - async fn fan_curve_data(&mut self, profile: Profile) -> zbus::fdo::Result> { - let mut ctrl = self.0.lock().await; - ctrl.profile_config.read(); - if let Some(curves) = &mut ctrl.fan_curves { - let curve = curves.profiles().get_fan_curves_for(profile); - return Ok(curve.to_vec()); - } - Err(Error::Failed(UNSUPPORTED_MSG.to_owned())) - } - - /// Set the fan curve for the specified profile. - /// Will also activate the fan curve if the user is in the same mode. - async fn set_fan_curve(&self, profile: Profile, curve: CurveData) -> zbus::fdo::Result<()> { - let mut ctrl = self.0.lock().await; - ctrl.profile_config.read(); - if let Some(curves) = &mut ctrl.fan_curves { - curves - .profiles_mut() - .save_fan_curve(curve, profile) - .map_err(|err| zbus::fdo::Error::Failed(err.to_string()))?; - } else { - return Err(Error::Failed(UNSUPPORTED_MSG.to_owned())); - } - ctrl.write_profile_curve_to_platform() - .map_err(|e| warn!("{MOD_NAME}: Profile::set_profile, {}", e)) - .ok(); - ctrl.save_config(); - - Ok(()) - } - - /// Reset the stored (self) and device curve to the defaults of the - /// platform. - /// - /// Each platform_profile has a different default and the defualt can be - /// read only for the currently active profile. - async fn set_active_curve_to_defaults(&self) -> zbus::fdo::Result<()> { - let mut ctrl = self.0.lock().await; - ctrl.profile_config.read(); - ctrl.set_active_curve_to_defaults() - .map_err(|e| warn!("{MOD_NAME}: Profile::set_active_curve_to_defaults, {}", e)) - .ok(); - ctrl.save_config(); - Ok(()) - } - - /// Reset the stored (self) and device curve to the defaults of the - /// platform. - /// - /// Each platform_profile has a different default and the defualt can be - /// read only for the currently active profile. - async fn reset_profile_curves(&self, profile: Profile) -> zbus::fdo::Result<()> { - let mut ctrl = self.0.lock().await; - ctrl.profile_config.read(); - let active = Profile::get_active_profile().unwrap_or(Profile::Balanced); - - Profile::set_profile(profile) - .map_err(|e| warn!("{MOD_NAME}: set_profile, {}", e)) - .ok(); - ctrl.set_active_curve_to_defaults() - .map_err(|e| warn!("{MOD_NAME}: Profile::set_active_curve_to_defaults, {}", e)) - .ok(); - - Profile::set_profile(active) - .map_err(|e| warn!("{MOD_NAME}: set_profile, {}", e)) - .ok(); - ctrl.save_config(); - Ok(()) - } - - #[dbus_interface(signal)] - async fn notify_profile(signal_ctxt: &SignalContext<'_>, profile: Profile) -> zbus::Result<()> { - } -} - -#[async_trait] -impl crate::ZbusRun for ProfileZbus { - async fn add_to_server(self, server: &mut Connection) { - Self::add_to_server_helper(self, ZBUS_PATH, server).await; - } -} - -#[async_trait] -impl CtrlTask for ProfileZbus { - fn zbus_path() -> &'static str { - ZBUS_PATH - } - - async fn create_tasks(&self, signal_ctxt: SignalContext<'static>) -> Result<(), RogError> { - let ctrl = self.0.clone(); - let sig_ctx = signal_ctxt.clone(); - let watch = self - .0 - .lock() - .await - .platform - .monitor_throttle_thermal_policy()?; - - tokio::spawn(async move { - let mut buffer = [0; 32]; - if let Ok(stream) = watch.into_event_stream(&mut buffer) { - stream - .for_each(|_| async { - let mut lock = ctrl.lock().await; - if let Ok(profile) = - lock.platform.get_throttle_thermal_policy().map_err(|e| { - error!("{MOD_NAME}: get_throttle_thermal_policy error: {e}"); - }) - { - let new_profile = Profile::from_throttle_thermal_policy(profile); - if new_profile != lock.profile_config.active_profile { - info!("{MOD_NAME}: platform_profile changed to {new_profile}"); - lock.profile_config.active_profile = new_profile; - lock.write_profile_curve_to_platform().unwrap(); - lock.save_config(); - Profile::set_profile(lock.profile_config.active_profile) - .map_err(|e| { - error!("Profile::set_profile() error: {e}"); - }) - .ok(); - - Self::notify_profile(&sig_ctx, lock.profile_config.active_profile) - .await - .ok(); - } - } - }) - .await; - } - }); - - let ctrl = self.0.clone(); - let watch = self.0.lock().await.platform.monitor_platform_profile()?; - - tokio::spawn(async move { - let mut buffer = [0; 32]; - if let Ok(stream) = watch.into_event_stream(&mut buffer) { - stream - .for_each(|_| async { - let mut lock = ctrl.lock().await; - if let Ok(profile) = lock.platform.get_platform_profile().map_err(|e| { - error!("get_platform_profile error: {e}"); - }) { - if let Ok(new_profile) = Profile::from_str(&profile).map_err(|e| { - error!("Profile::from_str(&profile) error: {e}"); - }) { - if new_profile != lock.profile_config.active_profile { - info!("{MOD_NAME}: platform_profile changed to {new_profile}"); - lock.profile_config.active_profile = new_profile; - lock.write_profile_curve_to_platform().unwrap(); - lock.save_config(); - Profile::set_profile(lock.profile_config.active_profile) - .map_err(|e| { - error!("Profile::set_profile() error: {e}"); - }) - .ok(); - - Self::notify_profile( - &signal_ctxt, - lock.profile_config.active_profile, - ) - .await - .ok(); - } - } - } - }) - .await; - } - }); - - Ok(()) - } -} - -#[async_trait] -impl crate::Reloadable for ProfileZbus { - /// Fetch the active profile and use that to set all related components up - async fn reload(&mut self) -> Result<(), RogError> { - let mut ctrl = self.0.lock().await; - let active = ctrl.profile_config.active_profile; - if let Some(curves) = &mut ctrl.fan_curves { - if let Ok(mut device) = FanCurveProfiles::get_device() { - // There is a possibility that the curve was default zeroed, so this call - // initialises the data from system read and we need to save it - // after - curves - .profiles_mut() - .write_profile_curve_to_platform(active, &mut device)?; - ctrl.profile_config.write(); - } - } - Ok(()) - } -} diff --git a/asusd/src/ctrl_supported.rs b/asusd/src/ctrl_supported.rs deleted file mode 100644 index 2454ebdb..00000000 --- a/asusd/src/ctrl_supported.rs +++ /dev/null @@ -1,49 +0,0 @@ -use async_trait::async_trait; -use serde_derive::{Deserialize, Serialize}; -use zbus::zvariant::Type; -use zbus::{dbus_interface, Connection}; - -use crate::ctrl_anime::CtrlAnime; -use crate::ctrl_aura::controller::CtrlKbdLed; -use crate::ctrl_platform::CtrlPlatform; -use crate::ctrl_power::CtrlPower; -use crate::ctrl_profiles::controller::CtrlPlatformProfile; -use crate::GetSupported; - -#[derive(Serialize, Deserialize, Debug, Type)] -pub struct SupportedFunctions(rog_platform::supported::SupportedFunctions); - -#[dbus_interface(name = "org.asuslinux.Daemon")] -impl SupportedFunctions { - pub fn supported_functions( - &self, - ) -> zbus::fdo::Result<&rog_platform::supported::SupportedFunctions> { - Ok(&self.0) - } - - #[dbus_interface(out_args("answer", "question"))] - fn meaning_of_life(&self) -> zbus::fdo::Result<(i32, String)> { - Ok((42, String::from("Meaning of life"))) - } -} - -#[async_trait] -impl crate::ZbusRun for SupportedFunctions { - async fn add_to_server(self, server: &mut Connection) { - Self::add_to_server_helper(self, "/org/asuslinux/Supported", server).await; - } -} - -impl GetSupported for SupportedFunctions { - type A = SupportedFunctions; - - fn get_supported() -> Self::A { - Self(rog_platform::supported::SupportedFunctions { - anime_ctrl: CtrlAnime::get_supported(), - keyboard_led: CtrlKbdLed::get_supported(), - charge_ctrl: CtrlPower::get_supported(), - platform_profile: CtrlPlatformProfile::get_supported(), - rog_bios_ctrl: CtrlPlatform::get_supported(), - }) - } -} diff --git a/asusd/src/daemon.rs b/asusd/src/daemon.rs index 06c84abe..530f269b 100644 --- a/asusd/src/daemon.rs +++ b/asusd/src/daemon.rs @@ -11,19 +11,13 @@ use asusd::ctrl_anime::config::AnimeConfig; use asusd::ctrl_anime::trait_impls::CtrlAnimeZbus; use asusd::ctrl_anime::CtrlAnime; use asusd::ctrl_aura::controller::CtrlKbdLed; -use asusd::ctrl_aura::trait_impls::CtrlKbdLedZbus; +use asusd::ctrl_aura::trait_impls::CtrlAuraZbus; +use asusd::ctrl_fancurves::CtrlFanCurveZbus; use asusd::ctrl_platform::CtrlPlatform; -use asusd::ctrl_power::CtrlPower; -use asusd::ctrl_profiles::config::ProfileConfig; -use asusd::ctrl_profiles::controller::CtrlPlatformProfile; -use asusd::ctrl_profiles::trait_impls::ProfileZbus; -use asusd::ctrl_supported::SupportedFunctions; -use asusd::{print_board_info, CtrlTask, GetSupported, Reloadable, ZbusRun}; -use config_traits::{StdConfig, StdConfigLoad, StdConfigLoad2}; +use asusd::{print_board_info, CtrlTask, Reloadable, ZbusRun, DBUS_NAME}; +use config_traits::{StdConfig, StdConfigLoad2}; use log::{error, info, warn}; use rog_aura::aura_detection::LaptopLedData; -use rog_dbus::DBUS_NAME; -use rog_profiles::Profile; use tokio::time::sleep; use zbus::SignalContext; @@ -53,7 +47,6 @@ async fn main() -> Result<(), Box> { info!(" daemon v{}", asusd::VERSION); info!(" rog-anime v{}", rog_anime::VERSION); info!(" rog-aura v{}", rog_aura::VERSION); - info!(" rog-dbus v{}", rog_dbus::VERSION); info!(" rog-profiles v{}", rog_profiles::VERSION); info!("rog-platform v{}", rog_platform::VERSION); @@ -63,9 +56,9 @@ async fn main() -> Result<(), Box> { /// The actual main loop for the daemon async fn start_daemon() -> Result<(), Box> { - let supported = SupportedFunctions::get_supported(); + // let supported = SupportedFunctions::get_supported(); print_board_info(); - println!("{:?}", supported.supported_functions()); + // println!("{:?}", supported.supported_functions()); // Start zbus server let mut connection = Connection::system().await?; @@ -73,7 +66,7 @@ async fn start_daemon() -> Result<(), Box> { let config = Config::new().load(); let config = Arc::new(Mutex::new(config)); - supported.add_to_server(&mut connection).await; + // supported.add_to_server(&mut connection).await; match CtrlPlatform::new(config.clone()) { Ok(ctrl) => { @@ -85,32 +78,16 @@ async fn start_daemon() -> Result<(), Box> { } } - match CtrlPower::new(config.clone()) { + match CtrlFanCurveZbus::new() { Ok(ctrl) => { - let sig_ctx = CtrlPower::signal_context(&connection)?; + let sig_ctx = CtrlFanCurveZbus::signal_context(&connection)?; start_tasks(ctrl, &mut connection, sig_ctx).await?; } Err(err) => { - error!("CtrlPower: {}", err); + error!("FanCurves: {}", err); } } - if Profile::is_platform_profile_supported() { - let profile_config = ProfileConfig::new().load(); - match CtrlPlatformProfile::new(profile_config) { - Ok(ctrl) => { - let zbus = ProfileZbus(Arc::new(Mutex::new(ctrl))); - let sig_ctx = ProfileZbus::signal_context(&connection)?; - start_tasks(zbus, &mut connection, sig_ctx).await?; - } - Err(err) => { - error!("Profile control: {}", err); - } - } - } else { - warn!("platform_profile support not found"); - } - match CtrlAnime::new(AnimeConfig::new().load()) { Ok(ctrl) => { let zbus = CtrlAnimeZbus(Arc::new(Mutex::new(ctrl))); @@ -127,8 +104,8 @@ async fn start_daemon() -> Result<(), Box> { // detection first match CtrlKbdLed::new(laptop) { Ok(ctrl) => { - let zbus = CtrlKbdLedZbus(Arc::new(Mutex::new(ctrl))); - let sig_ctx = CtrlKbdLedZbus::signal_context(&connection)?; + let zbus = CtrlAuraZbus(Arc::new(Mutex::new(ctrl))); + let sig_ctx = CtrlAuraZbus::signal_context(&connection)?; start_tasks(zbus, &mut connection, sig_ctx).await?; } Err(err) => { diff --git a/asusd/src/lib.rs b/asusd/src/lib.rs index f1387a96..2364b332 100644 --- a/asusd/src/lib.rs +++ b/asusd/src/lib.rs @@ -5,15 +5,10 @@ pub mod config; pub mod ctrl_anime; /// Keyboard LED brightness control, RGB, and LED display modes pub mod ctrl_aura; +/// Control platform profiles + fan-curves if available +pub mod ctrl_fancurves; /// Control ASUS bios function such as boot sound, Optimus/Dedicated gfx mode pub mod ctrl_platform; -/// Control of battery charge level -pub mod ctrl_power; -/// Control platform profiles + fan-curves if available -pub mod ctrl_profiles; - -/// Fetch all supported functions for the laptop -pub mod ctrl_supported; pub mod error; @@ -32,6 +27,9 @@ use zbus::{CacheProperties, Connection, SignalContext}; use crate::error::RogError; const CONFIG_PATH_BASE: &str = "/etc/asusd/"; +pub static DBUS_NAME: &str = "org.asuslinux.Daemon"; +pub static DBUS_PATH: &str = "/org/asuslinux/Daemon"; +pub static DBUS_IFACE: &str = "org.asuslinux.Daemon"; /// This macro adds a function which spawns an `inotify` task on the passed in /// `Executor`. @@ -49,7 +47,7 @@ const CONFIG_PATH_BASE: &str = "/etc/asusd/"; /// # Example /// /// ```ignore -/// impl CtrlRogBios { +/// impl RogPlatform { /// task_watch_item!(panel_od platform); /// task_watch_item!(gpu_mux_mode platform); /// } @@ -72,14 +70,13 @@ macro_rules! task_watch_item { tokio::spawn(async move { let mut buffer = [0; 32]; watch.into_event_stream(&mut buffer).unwrap().for_each(|_| async { - if let Ok(value) = ctrl.$name(){ + if let Ok(value) = ctrl.$name() { // get new value from zbus method concat_idents::concat_idents!(notif_fn = $name, _changed { - Self::notif_fn(&ctrl, &signal_ctxt).await.ok(); + ctrl.notif_fn(&signal_ctxt).await.ok(); }); - if let Some(mut lock) = ctrl.config.try_lock() { - lock.$name = value; - lock.write(); - } + let mut lock = ctrl.config.lock().await; + lock.$name = value; + lock.write(); } }).await; }); @@ -93,6 +90,38 @@ macro_rules! task_watch_item { }; } +#[macro_export] +macro_rules! task_watch_item_notify { + ($name:ident $self_inner:ident) => { + concat_idents::concat_idents!(fn_name = watch_, $name { + async fn fn_name( + &self, + signal_ctxt: SignalContext<'static>, + ) -> Result<(), RogError> { + use zbus::export::futures_util::StreamExt; + + let ctrl = self.clone(); + concat_idents::concat_idents!(watch_fn = monitor_, $name { + match self.$self_inner.watch_fn() { + Ok(watch) => { + tokio::spawn(async move { + let mut buffer = [0; 32]; + watch.into_event_stream(&mut buffer).unwrap().for_each(|_| async { + concat_idents::concat_idents!(notif_fn = $name, _changed { + ctrl.notif_fn(&signal_ctxt).await.ok(); + }); + }).await; + }); + } + Err(e) => info!("inotify watch failed: {}. You can ignore this if your device does not support the feature", e), + } + }); + Ok(()) + } + }); + }; +} + pub const VERSION: &str = env!("CARGO_PKG_VERSION"); pub fn print_board_info() { @@ -192,18 +221,11 @@ pub trait CtrlTask { .await .expect("Controller could not create ManagerProxy"); + let manager1 = manager.clone(); tokio::spawn(async move { - if let Ok(mut notif) = manager.receive_prepare_for_sleep().await { - while let Some(event) = notif.next().await { - if let Ok(args) = event.args() { - debug!("Doing on_prepare_for_sleep({})", args.start); - on_prepare_for_sleep(args.start).await; - } - } - } - - if let Ok(mut notif) = manager.receive_prepare_for_shutdown().await { + if let Ok(mut notif) = manager1.receive_prepare_for_shutdown().await { while let Some(event) = notif.next().await { + // blocks thread :| if let Ok(args) = event.args() { debug!("Doing on_prepare_for_shutdown({})", args.start); on_prepare_for_shutdown(args.start).await; @@ -212,23 +234,38 @@ pub trait CtrlTask { } }); - let manager = ManagerProxy::builder(&connection) - .cache_properties(CacheProperties::No) - .build() - .await - .expect("Controller could not create ManagerProxy"); - + let manager2 = manager.clone(); tokio::spawn(async move { - let mut last_power = manager.on_external_power().await.unwrap_or_default(); - let mut last_lid = manager.lid_closed().await.unwrap_or_default(); - // need to loop on these as they don't emit signals + if let Ok(mut notif) = manager2.receive_prepare_for_sleep().await { + while let Some(event) = notif.next().await { + // blocks thread :| + if let Ok(args) = event.args() { + debug!("Doing on_prepare_for_sleep({})", args.start); + on_prepare_for_sleep(args.start).await; + } + } + } + }); + + let manager3 = manager.clone(); + tokio::spawn(async move { + let mut last_power = manager3.on_external_power().await.unwrap_or_default(); + loop { - if let Ok(next) = manager.on_external_power().await { + if let Ok(next) = manager3.on_external_power().await { if next != last_power { last_power = next; on_external_power_change(next).await; } } + sleep(Duration::from_secs(2)).await; + } + }); + + tokio::spawn(async move { + let mut last_lid = manager.lid_closed().await.unwrap_or_default(); + // need to loop on these as they don't emit signals + loop { if let Ok(next) = manager.lid_closed().await { if next != last_lid { last_lid = next; diff --git a/bindings/dbus-xml/org-asuslinux-anime-4.xml b/bindings/dbus-xml/org-asuslinux-anime-4.xml index 150d1e61..ea7dd253 100644 --- a/bindings/dbus-xml/org-asuslinux-anime-4.xml +++ b/bindings/dbus-xml/org-asuslinux-anime-4.xml @@ -2,57 +2,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + + + + + + + + + + + + diff --git a/bindings/dbus-xml/org-asuslinux-aura-4.xml b/bindings/dbus-xml/org-asuslinux-aura-4.xml index a72e02dd..a5fc046f 100644 --- a/bindings/dbus-xml/org-asuslinux-aura-4.xml +++ b/bindings/dbus-xml/org-asuslinux-aura-4.xml @@ -2,52 +2,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + + + + + + + + + + + + + + + diff --git a/bindings/dbus-xml/org-asuslinux-profile-4.xml b/bindings/dbus-xml/org-asuslinux-fan-curves-4.xml similarity index 54% rename from bindings/dbus-xml/org-asuslinux-profile-4.xml rename to bindings/dbus-xml/org-asuslinux-fan-curves-4.xml index 0986914b..35ae61e5 100644 --- a/bindings/dbus-xml/org-asuslinux-profile-4.xml +++ b/bindings/dbus-xml/org-asuslinux-fan-curves-4.xml @@ -2,49 +2,28 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + - + - + + + - - + + - - - - - - - - - - - - - - + + + + + + - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + diff --git a/bindings/dbus-xml/org-asuslinux-power-4.xml b/bindings/dbus-xml/org-asuslinux-power-4.xml deleted file mode 100644 index 8cd9b384..00000000 --- a/bindings/dbus-xml/org-asuslinux-power-4.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/bindings/dbus-xml/org-asuslinux-supported-4.xml b/bindings/dbus-xml/org-asuslinux-supported-4.xml deleted file mode 100644 index 1b230700..00000000 --- a/bindings/dbus-xml/org-asuslinux-supported-4.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/bindings/ts/anime.ts b/bindings/ts/anime.ts index 41957051..98d948b6 100644 --- a/bindings/ts/anime.ts +++ b/bindings/ts/anime.ts @@ -45,6 +45,7 @@ export interface DeviceState { off_when_unplugged: boolean; off_when_suspended: boolean; off_when_lid_closed: boolean; + brightness_on_battery: Brightness; } export enum AnimeType { diff --git a/bindings/ts/aura.ts b/bindings/ts/aura.ts index cc0edbf8..e2bc5b10 100644 --- a/bindings/ts/aura.ts +++ b/bindings/ts/aura.ts @@ -1,5 +1,5 @@ /* - Generated by typeshare 1.6.0 + Generated by typeshare 1.7.0 */ /** Represents the per-key raw USB packets */ @@ -227,6 +227,7 @@ export enum AuraDevice { X18c6 = "X18c6", X19b6 = "X19b6", X1a30 = "X1a30", + X1abe = "X1abe", Unknown = "Unknown", } diff --git a/bindings/ts/platform.ts b/bindings/ts/platform.ts index efef5411..f392e594 100644 --- a/bindings/ts/platform.ts +++ b/bindings/ts/platform.ts @@ -1,50 +1,7 @@ /* - Generated by typeshare 1.6.0 + Generated by typeshare 1.7.0 */ -export type AnimeSupportedFunctions = boolean; - -export interface ChargeSupportedFunctions { - charge_level_set: boolean; -} - -export interface PlatformProfileFunctions { - platform_profile: boolean; - fan_curves: boolean; -} - -export enum AdvancedAura { - None = "None", - Zoned = "Zoned", - PerKey = "PerKey", -} - -export interface LedSupportedFunctions { - dev_id: AuraDevice; - brightness: boolean; - basic_modes: AuraModeNum[]; - basic_zones: AuraZone[]; - advanced_type: AdvancedAura; - power_zones: PowerZones[]; -} - -export interface RogBiosSupportedFunctions { - post_sound: boolean; - gpu_mux: boolean; - panel_overdrive: boolean; - dgpu_disable: boolean; - egpu_enable: boolean; - mini_led_mode: boolean; -} - -export interface SupportedFunctions { - anime_ctrl: AnimeSupportedFunctions; - charge_ctrl: ChargeSupportedFunctions; - platform_profile: PlatformProfileFunctions; - keyboard_led: LedSupportedFunctions; - rog_bios_ctrl: RogBiosSupportedFunctions; -} - export enum GpuMode { Discrete = "Discrete", Optimus = "Optimus", @@ -56,3 +13,28 @@ export enum GpuMode { NotSupported = "NotSupported", } +export enum PlatformPolicy { + Balanced = "Balanced", + Performance = "Performance", + Quiet = "Quiet", +} + +/** CamelCase names of the properties. Intended for use with DBUS */ +export enum Properties { + ChargeControlEndThreshold = "ChargeControlEndThreshold", + DgpuDisable = "DgpuDisable", + GpuMuxMode = "GpuMuxMode", + PostAnimationSound = "PostAnimationSound", + PanelOd = "PanelOd", + MiniLedMode = "MiniLedMode", + EgpuEnable = "EgpuEnable", + PlatformPolicy = "PlatformPolicy", + PptPl1Spl = "PptPl1Spl", + PptPl2Sppt = "PptPl2Sppt", + PptFppt = "PptFppt", + PptApuSppt = "PptApuSppt", + PptPlatformSppt = "PptPlatformSppt", + NvDynamicBoost = "NvDynamicBoost", + NvTempTarget = "NvTempTarget", +} + diff --git a/bindings/ts/profiles.ts b/bindings/ts/profiles.ts index 0d7439f0..458ccaef 100644 --- a/bindings/ts/profiles.ts +++ b/bindings/ts/profiles.ts @@ -1,35 +1,24 @@ /* - Generated by typeshare 1.6.0 + Generated by typeshare 1.7.0 */ export enum FanCurvePU { CPU = "CPU", GPU = "GPU", + MID = "MID", } export interface CurveData { fan: FanCurvePU; pwm: [number, number, number, number, number, number, number, number]; temp: [number, number, number, number, number, number, number, number]; -} - -/** A `FanCurveSet` contains both CPU and GPU fan curve data */ -export interface FanCurveSet { enabled: boolean; - cpu: CurveData; - gpu: CurveData; } /** Main purpose of `FanCurves` is to enable restoring state on system boot */ export interface FanCurveProfiles { - balanced: FanCurveSet; - performance: FanCurveSet; - quiet: FanCurveSet; -} - -export enum Profile { - Balanced = "Balanced", - Performance = "Performance", - Quiet = "Quiet", + balanced: CurveData[]; + performance: CurveData[]; + quiet: CurveData[]; } diff --git a/data/asusd.rules b/data/asusd.rules index b1e5d36c..f12f69ff 100644 --- a/data/asusd.rules +++ b/data/asusd.rules @@ -1,6 +1,3 @@ -#ACTION=="add|change", SUBSYSTEM=="input", ENV{ID_VENDOR_ID}=="0b05", ENV{ID_MODEL_ID}=="1[89][a-zA-Z0-9][a-zA-Z0-9]|193b", ENV{ID_TYPE}=="hid", TAG+="systemd", ENV{SYSTEMD_WANTS}="asusd.service" -#ACTION=="add|remove", SUBSYSTEM=="input", ENV{ID_VENDOR_ID}=="0b05", ENV{ID_MODEL_ID}=="1[89][a-zA-Z0-9][a-zA-Z0-9]|193b", RUN+="systemctl restart asusd.service" - ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}" ENV{DMI_VENDOR}!="ASUSTeK COMPUTER INC.", GOTO="asusd_end" diff --git a/data/asusd.service b/data/asusd.service index 2a6d5fe7..dfd6b716 100644 --- a/data/asusd.service +++ b/data/asusd.service @@ -1,15 +1,13 @@ [Unit] Description=ASUS Notebook Control -StartLimitInterval=200 -StartLimitBurst=2 -Before=multi-user.target -After=power-profiles-daemon.service -After=nvidia-powerd.service +StartLimitInterval=500 +StartLimitBurst=5 +After=nvidia-powerd.service,systemd-udevd.service [Service] Environment=IS_SERVICE=1 Environment=RUST_LOG="info" -ExecStartPre=/bin/sleep 2 +# ExecStartPre=/bin/sleep 2 # was required only for slow devices ExecStart=/usr/bin/asusd Restart=on-failure RestartSec=1 diff --git a/desktop-extensions/gnome-44/.eslintrc.cjs b/desktop-extensions/gnome-44/.eslintrc.cjs deleted file mode 100644 index 4b387c2f..00000000 --- a/desktop-extensions/gnome-44/.eslintrc.cjs +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-env node */ -module.exports = { - extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], - parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint"], - root: true, - - "rules": { - // enable additional rules - "indent": ["error", 4], - "linebreak-style": ["error", "unix"], - "quotes": ["error", "double"], - "semi": ["error", "always"], - - // override configuration set by extending "eslint:recommended" - "no-empty": "warn", - "no-cond-assign": ["error", "always"], - - // disable rules from base configurations - "for-direction": "off", - - "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/ban-ts-comment": "off" - } -}; diff --git a/desktop-extensions/gnome-44/LICENSE b/desktop-extensions/gnome-44/LICENSE deleted file mode 100644 index fa0086a9..00000000 --- a/desktop-extensions/gnome-44/LICENSE +++ /dev/null @@ -1,373 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/desktop-extensions/gnome-44/README.md b/desktop-extensions/gnome-44/README.md deleted file mode 100644 index b565c743..00000000 --- a/desktop-extensions/gnome-44/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# asusctl - -Requires `asusd` to be installed and running. - -## build and install - -``` -npm install -npm run build && gnome-extensions install asusctl-gnome@asus-linux.org.zip --force -npm run build && gnome-extensions enable asusctl-gnome@asus-linux.org.zip -``` - -You will need to restart Gnome after installing or updating - -## development - -``` -npm run build -gnome-extensions install asusctl-gnome@asus-linux.org.zip --force -MUTTER_DEBUG_DUMMY_MODE_SPECS=1366x768 dbus-run-session -- gnome-shell --nested --wayland -``` \ No newline at end of file diff --git a/desktop-extensions/gnome-44/esbuild.js b/desktop-extensions/gnome-44/esbuild.js deleted file mode 100644 index 9c590214..00000000 --- a/desktop-extensions/gnome-44/esbuild.js +++ /dev/null @@ -1,65 +0,0 @@ -const { build } = require("esbuild"); -const fs = require("fs"); -const path = require("path"); -var exec = require('child_process').exec; -const AdmZip = require("adm-zip"); -const metadata = require("./src/metadata.json"); - -build({ - entryPoints: ['src/extension.ts'], - outdir: 'dist', - bundle: true, - // Do not remove the functions `enable()`, `disable()` and `init()` - treeShaking: false, - // firefox60 // Since GJS 1.53.90 - // firefox68 // Since GJS 1.63.90 - // firefox78 // Since GJS 1.65.90 - // firefox91 // Since GJS 1.71.1 - // firefox102 // Since GJS 1.73.2 - target: "firefox78", - platform: "node", - // platform: "neutral", - // mainFields: ['main'], - // conditions: ['require', 'default'], - // format: 'cjs', - external: ['gi://*', 'system', 'gettext', 'cairo'], -}).then(() => { - const metaSrc = path.resolve(__dirname, "src/metadata.json"); - const metaDist = path.resolve(__dirname, "dist/metadata.json"); - const schemaSrc = path.resolve(__dirname, "schemas"); - const schemaDist = path.resolve(__dirname, "dist/schemas"); - const dbusXmlSrc = path.resolve(__dirname, "../../bindings/dbus-xml"); - const dbusXmlDist = path.resolve(__dirname, "dist/resources/dbus"); - const zipFilename = `${metadata.uuid}.zip`; - const zipDist = path.resolve(__dirname, zipFilename); - - exec('glib-compile-schemas schemas/', - (error, stdout, stderr) => { - console.log('stdout: ' + stdout); - console.log('stderr: ' + stderr); - }); - - fs.copyFileSync(metaSrc, metaDist); - - fs.cpSync(schemaSrc, schemaDist, { recursive: true }, (err) => { - if (err) { - console.error(err); - } - }); - - fs.cpSync(dbusXmlSrc, dbusXmlDist, { recursive: true }, (err) => { - if (err) { - console.error(err); - } - }); - - const zip = new AdmZip(); - zip.addLocalFolder(path.resolve(__dirname, "dist")); - zip.writeZip(zipDist); - - console.log(`Build complete. Zip file: ${zipFilename}\n`); - console.log(`Install with: gnome-extensions install ${zipFilename}`) - console.log(`Update with: gnome-extensions install ${zipFilename} --force`) - console.log(`Enable with: gnome-extensions enable ${metadata.uuid} --user`) -}); - diff --git a/desktop-extensions/gnome-44/package-lock.json b/desktop-extensions/gnome-44/package-lock.json deleted file mode 100644 index 0e125e6b..00000000 --- a/desktop-extensions/gnome-44/package-lock.json +++ /dev/null @@ -1,2002 +0,0 @@ -{ - "name": "asusctl-gnome", - "version": "4.7.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "asusctl-gnome", - "version": "4.7.0", - "license": "MPL-2", - "devDependencies": { - "@typescript-eslint/eslint-plugin": "^5.60.1", - "@typescript-eslint/parser": "^5.60.1", - "adm-zip": "^0.5.10", - "esbuild": "^0.17.19", - "eslint": "^8.44.0", - "typescript": "^5.1.6" - } - }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", - "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", - "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", - "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", - "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", - "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", - "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", - "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", - "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", - "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", - "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", - "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", - "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", - "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", - "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", - "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", - "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", - "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", - "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", - "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", - "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", - "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", - "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz", - "integrity": "sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==", - "dev": true, - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", - "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", - "dev": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/js": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", - "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", - "dev": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@types/json-schema": { - "version": "7.0.12", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", - "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", - "dev": true - }, - "node_modules/@types/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", - "dev": true - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.60.1.tgz", - "integrity": "sha512-KSWsVvsJsLJv3c4e73y/Bzt7OpqMCADUO846bHcuWYSYM19bldbAeDv7dYyV0jwkbMfJ2XdlzwjhXtuD7OY6bw==", - "dev": true, - "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.60.1", - "@typescript-eslint/type-utils": "5.60.1", - "@typescript-eslint/utils": "5.60.1", - "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.60.1.tgz", - "integrity": "sha512-pHWlc3alg2oSMGwsU/Is8hbm3XFbcrb6P5wIxcQW9NsYBfnrubl/GhVVD/Jm/t8HXhA2WncoIRfBtnCgRGV96Q==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.60.1", - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/typescript-estree": "5.60.1", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.60.1.tgz", - "integrity": "sha512-Dn/LnN7fEoRD+KspEOV0xDMynEmR3iSHdgNsarlXNLGGtcUok8L4N71dxUgt3YvlO8si7E+BJ5Fe3wb5yUw7DQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/visitor-keys": "5.60.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.60.1.tgz", - "integrity": "sha512-vN6UztYqIu05nu7JqwQGzQKUJctzs3/Hg7E2Yx8rz9J+4LgtIDFWjjl1gm3pycH0P3mHAcEUBd23LVgfrsTR8A==", - "dev": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "5.60.1", - "@typescript-eslint/utils": "5.60.1", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.60.1.tgz", - "integrity": "sha512-zDcDx5fccU8BA0IDZc71bAtYIcG9PowaOwaD8rjYbqwK7dpe/UMQl3inJ4UtUK42nOCT41jTSCwg76E62JpMcg==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.60.1.tgz", - "integrity": "sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/visitor-keys": "5.60.1", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.60.1.tgz", - "integrity": "sha512-tiJ7FFdFQOWssFa3gqb94Ilexyw0JVxj6vBzaSpfN/8IhoKkDuSAenUKvsSHw2A/TMpJb26izIszTXaqygkvpQ==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.60.1", - "@typescript-eslint/types": "5.60.1", - "@typescript-eslint/typescript-estree": "5.60.1", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.60.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.60.1.tgz", - "integrity": "sha512-xEYIxKcultP6E/RMKqube11pGjXH1DCo60mQoWhVYyKfLkwbIVVjYxmOenNMxILx0TjCujPTjjnTIVzm09TXIw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.60.1", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/acorn": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz", - "integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/adm-zip": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz", - "integrity": "sha512-x0HvcHqVJNTPk/Bw8JbLWlWoo6Wwnsug0fnYYro1HBrjxZ3G7/AZk7Ahv8JwDe1uIcz8eBqvu86FuF1POiG7vQ==", - "dev": true, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/esbuild": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", - "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/android-arm": "0.17.19", - "@esbuild/android-arm64": "0.17.19", - "@esbuild/android-x64": "0.17.19", - "@esbuild/darwin-arm64": "0.17.19", - "@esbuild/darwin-x64": "0.17.19", - "@esbuild/freebsd-arm64": "0.17.19", - "@esbuild/freebsd-x64": "0.17.19", - "@esbuild/linux-arm": "0.17.19", - "@esbuild/linux-arm64": "0.17.19", - "@esbuild/linux-ia32": "0.17.19", - "@esbuild/linux-loong64": "0.17.19", - "@esbuild/linux-mips64el": "0.17.19", - "@esbuild/linux-ppc64": "0.17.19", - "@esbuild/linux-riscv64": "0.17.19", - "@esbuild/linux-s390x": "0.17.19", - "@esbuild/linux-x64": "0.17.19", - "@esbuild/netbsd-x64": "0.17.19", - "@esbuild/openbsd-x64": "0.17.19", - "@esbuild/sunos-x64": "0.17.19", - "@esbuild/win32-arm64": "0.17.19", - "@esbuild/win32-ia32": "0.17.19", - "@esbuild/win32-x64": "0.17.19" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.44.0.tgz", - "integrity": "sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.1.0", - "@eslint/js": "8.44.0", - "@humanwhocodes/config-array": "^0.11.10", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.0", - "eslint-visitor-keys": "^3.4.1", - "espree": "^9.6.0", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", - "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/espree": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz", - "integrity": "sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A==", - "dev": true, - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", - "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true - }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", - "dev": true, - "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/desktop-extensions/gnome-44/package.json b/desktop-extensions/gnome-44/package.json deleted file mode 100644 index cdb76f60..00000000 --- a/desktop-extensions/gnome-44/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "asusctl-gnome", - "version": "4.7.0", - "description": "asusctl-gnome a gnome extension exposing some of the base features of asusd in a helpful and easy to use way", - "main": "dist/extension.js", - "scripts": { - "clear": "rm -rf dist", - "build:app": "node esbuild.js", - "build": "yarn run clear && yarn run build:app", - "validate": "tsc --noEmit" - }, - "devDependencies": { - "@typescript-eslint/eslint-plugin": "^5.60.1", - "@typescript-eslint/parser": "^5.60.1", - "adm-zip": "^0.5.10", - "esbuild": "^0.17.19", - "eslint": "^8.44.0", - "typescript": "^5.1.6" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@gitlab.com/asus-linux/asusctl.git" - }, - "keywords": [ - "gnome-shell", - "extension", - "asusctl", - "asus", - "rog", - "gnome", - "gjs", - "typescript" - ], - "author": "Armas Spann, Marco Laux, Luke Jones", - "license": "MPL-2", - "bugs": { - "url": "https://gitlab.com/asus-linux/asusctl/issues" - }, - "homepage": "https://gitlab.com/asus-linux/asusctl/desktop-extensions/gnome#readme" -} diff --git a/desktop-extensions/gnome-44/schemas/org.gnome.shell.extensions.asusctl-gnome.gschema.xml b/desktop-extensions/gnome-44/schemas/org.gnome.shell.extensions.asusctl-gnome.gschema.xml deleted file mode 100644 index a531874b..00000000 --- a/desktop-extensions/gnome-44/schemas/org.gnome.shell.extensions.asusctl-gnome.gschema.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - false - - - false - - - false - - - - 100 - - - "mini-led" - - - \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/bindings b/desktop-extensions/gnome-44/src/bindings deleted file mode 120000 index ae0c7dbf..00000000 --- a/desktop-extensions/gnome-44/src/bindings +++ /dev/null @@ -1 +0,0 @@ -../../../bindings/ts \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/extension.ts b/desktop-extensions/gnome-44/src/extension.ts deleted file mode 100644 index e16e6075..00000000 --- a/desktop-extensions/gnome-44/src/extension.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { AnimeDbus } from "./modules/dbus/animatrix"; -import { Power } from "./modules/dbus/power"; -import { Supported } from "./modules/dbus/supported"; -import { Platform } from "./modules/dbus/platform"; - -import { QuickPanelOd } from "./modules/quick_toggles/panel_od"; -import { IndicateMiniLed } from "./modules/indicators/mini_led"; -import { QuickMiniLed } from "./modules/quick_toggles/mini_led"; -import { SliderChargeLevel } from "./modules/sliders/charge"; -import { QuickAnimePower } from "./modules/quick_toggles/anime_power"; -import { FeatureMenuToggle } from "./modules/quick_menus/laptop_features"; -import { AuraDbus } from "./modules/dbus/aura"; -import { AuraMenuToggle } from "./modules/quick_menus/aura"; - -class Extension { - private _indicateMiniLed: typeof IndicateMiniLed; - private _quickMiniLed: typeof QuickMiniLed; - private _quickPanelOd: typeof QuickPanelOd; - private _quickAnimePower: typeof QuickAnimePower; - private _featureMenuToggle: typeof FeatureMenuToggle; - private _auraModeMenuToggle: typeof AuraMenuToggle; - private _sliderCharge: typeof SliderChargeLevel; - - public dbus_supported: Supported = new Supported; - public dbus_power: Power = new Power; - public dbus_aura: AuraDbus = new AuraDbus; - public dbus_anime: AnimeDbus = new AnimeDbus; - public dbus_platform: Platform = new Platform; - - - constructor() { - this._indicateMiniLed = null; - this._quickMiniLed = null; - this._quickPanelOd = null; - this._quickAnimePower = null; - this._sliderCharge = null; - - this.dbus_supported.start(); - this.dbus_aura.start(); - this.dbus_platform.start(); - this.dbus_power.start(); - this.dbus_anime.start(); - } - - enable() { - if (this._featureMenuToggle == null) { - this._featureMenuToggle = new FeatureMenuToggle(this.dbus_supported, this.dbus_platform, this.dbus_anime); - } - if (this._auraModeMenuToggle == null) { - this._auraModeMenuToggle = new AuraMenuToggle(this.dbus_aura); - } - if (this.dbus_supported.supported.rog_bios_ctrl.mini_led_mode) { - // if (this._quickMiniLed == null) { - // this._quickMiniLed = new QuickMiniLed(this.dbus_platform); - // this.dbus_platform.notifyMiniLedSubscribers.push(this._quickMiniLed); - // } - if (this._indicateMiniLed == null) { - this._indicateMiniLed = new IndicateMiniLed(this.dbus_platform); - } - } - // if (this.dbus_supported.supported.rog_bios_ctrl.panel_overdrive) { - // if (this._quickPanelOd == null) { - // this._quickPanelOd = new QuickPanelOd(this.dbus_platform); - // this.dbus_platform.notifyPanelOdSubscribers.push(this._quickPanelOd); - // } - // } - // if (this.dbus_supported.supported.anime_ctrl) { - // if (this._quickAnimePower == null) { - // this._quickAnimePower = new QuickAnimePower(this._dbus_anime); - // } - // } - if (this.dbus_supported.supported.charge_ctrl.charge_level_set) { - if (this._sliderCharge == null) { - this._sliderCharge = new SliderChargeLevel(this.dbus_power); - } - } - } - - disable() { - if (this._indicateMiniLed != null) { - this._indicateMiniLed.destroy(); - this._indicateMiniLed = null; - } - if (this._quickMiniLed != null) { - this._quickMiniLed.destroy(); - this._quickMiniLed = null; - } - if (this._quickPanelOd != null) { - this._quickPanelOd.destroy(); - this._quickPanelOd = null; - } - if (this._quickAnimePower != null) { - this._quickAnimePower.destroy(); - this._quickAnimePower = null; - } - if (this._sliderCharge != null) { - this._sliderCharge.destroy(); - this._sliderCharge = null; - } - - this.dbus_power.stop(); - this.dbus_platform.stop(); - this.dbus_anime.stop(); - this.dbus_aura.stop(); - this.dbus_supported.stop(); - } -} - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function init() { - return new Extension(); -} \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/metadata.json b/desktop-extensions/gnome-44/src/metadata.json deleted file mode 100644 index a273536a..00000000 --- a/desktop-extensions/gnome-44/src/metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "asusctl-gnome", - "description": "asusctl-gnome a gnome extension exposing some of the base features of asusd in a helpful and easy to use way", - "uuid": "asusctl-gnome@asus-linux.org", - "uuid-dev": "asusctl-gnome-dev@asus-linux.org", - "settings-schema": "org.gnome.shell.extensions.asusctl-gnome", - "version": "4.3.2", - "shell-version": [ - "43", "44", "45" - ] -} diff --git a/desktop-extensions/gnome-44/src/modules/dbus/animatrix.ts b/desktop-extensions/gnome-44/src/modules/dbus/animatrix.ts deleted file mode 100644 index b7bc6e3e..00000000 --- a/desktop-extensions/gnome-44/src/modules/dbus/animatrix.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { DbusBase } from "./base"; -import { DeviceState, AnimBooting, Brightness, AnimAwake, AnimSleeping, AnimShutdown } from "../../bindings/anime"; - -export class AnimeDbus extends DbusBase { - deviceState: DeviceState = { - display_enabled: false, - display_brightness: Brightness.Med, - builtin_anims_enabled: false, - builtin_anims: { - boot: AnimBooting.GlitchConstruction, - awake: AnimAwake.BinaryBannerScroll, - sleep: AnimSleeping.BannerSwipe, - shutdown: AnimShutdown.GlitchOut - }, - }; - - // TODO: interface or something to enforce requirement of "sync()" method - public notifyAnimeStateSubscribers: any[] = []; - - constructor() { - super("org-asuslinux-anime-4", "/org/asuslinux/Anime"); - } - - public setEnableDisplay(state: boolean | null) { - if (this.isRunning()) { - try { - // if null, toggle the current state - state = (state == null ? !this.deviceState.display_enabled : state); - - if (this.deviceState.display_enabled !== state) { - this.deviceState.display_enabled = state; - } - return this.dbus_proxy.SetEnableDisplaySync(state); - } catch (e) { - //@ts-ignore - log("AniMe DBus set power failed!", e); - } - } - } - - public setPowersaveAnim(state: boolean | null) { - if (this.isRunning()) { - try { - // if null, toggle the current state - state = (state == null ? !this.deviceState.builtin_anims_enabled : state); - - if (this.deviceState.builtin_anims_enabled !== state) { - this.deviceState.builtin_anims_enabled = state; - } - return this.dbus_proxy.SetEnableBuiltinsSync(state); - } catch (e) { - //@ts-ignore - log("AniMe DBus set builtins failed!", e); - } - } - } - - public setBrightness(brightness: Brightness) { - if (this.isRunning()) { - try { - if (this.deviceState.display_brightness !== brightness) { - this.deviceState.display_brightness = brightness; - } - return this.dbus_proxy.SetBrightnessSync(brightness); - } catch (e) { - //@ts-ignore - log("AniMe DBus set brightness failed!", e); - } - } - } - - _parseData(data: any) { - if (data.length > 0) { - this.deviceState.display_enabled = data[0]; - this.deviceState.display_brightness = Brightness[data[1] as Brightness]; - this.deviceState.builtin_anims_enabled = data[2]; - this.deviceState.builtin_anims.boot = AnimBooting[data[3][0] as AnimBooting]; - this.deviceState.builtin_anims.awake = AnimAwake[data[3][1] as AnimAwake]; - this.deviceState.builtin_anims.sleep = AnimSleeping[data[3][2] as AnimSleeping]; - this.deviceState.builtin_anims.shutdown = AnimShutdown[data[3][2] as AnimShutdown]; - } - } - - public getDeviceState() { - if (this.isRunning()) { - try { - // janky shit going on with DeviceStateSync - this._parseData(this.dbus_proxy.DeviceStateSync()); - } catch (e) { - //@ts-ignore - log("Failed to fetch DeviceState!", e); - } - } - return this.deviceState; - } - - async start() { - await super.start(); - this.getDeviceState(); - - this.dbus_proxy.connectSignal( - "NotifyDeviceState", - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (proxy: any = null, name: string, data: string) => { - if (proxy) { - // idiot xml parsing mneans the get is not nested while this is - this._parseData(data[0]); - this.notifyAnimeStateSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - } - - async stop() { - await super.stop(); - } -} \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/dbus/aura.ts b/desktop-extensions/gnome-44/src/modules/dbus/aura.ts deleted file mode 100644 index 5828cadb..00000000 --- a/desktop-extensions/gnome-44/src/modules/dbus/aura.ts +++ /dev/null @@ -1,284 +0,0 @@ -import { AuraDevRog1, AuraDevTuf, AuraDevice, AuraEffect, AuraModeNum, AuraPower, AuraPowerDev, AuraZone, Direction, PowerZones, Speed } from "../../bindings/aura"; -import { DbusBase } from "./base"; - -export class AuraDbus extends DbusBase { - public device: AuraDevice = AuraDevice.Unknown; - public current_aura_mode: AuraModeNum = AuraModeNum.Static; - public aura_modes: Map = new Map; - public leds_powered: AuraPowerDev = { - tuf: [], - old_rog: [], - rog: { - keyboard: { - zone: PowerZones.Keyboard, - boot: false, - awake: false, - sleep: false, - shutdown: false - }, - logo: { - zone: PowerZones.Logo, - boot: false, - awake: false, - sleep: false, - shutdown: false - }, - lightbar: { - zone: PowerZones.Lightbar, - boot: false, - awake: false, - sleep: false, - shutdown: false - }, - lid: { - zone: PowerZones.Lid, - boot: false, - awake: false, - sleep: false, - shutdown: false - }, - rear_glow: { - zone: PowerZones.RearGlow, - boot: false, - awake: false, - sleep: false, - shutdown: false - }, - } - }; - // TODO: interface or something to enforce requirement of "sync()" method - public notifyAuraModeSubscribers: any[] = []; - public notifyAuraPowerSubscribers: any[] = []; - - constructor() { - super("org-asuslinux-aura-4", "/org/asuslinux/Aura"); - } - - public getDevice() { - if (this.isRunning()) { - try { - this.device = AuraDevice[this.dbus_proxy.DeviceTypeSync() as AuraDevice]; - //@ts-ignore - log("LED device: " + this.device); - } catch (e) { - //@ts-ignore - log("Failed to fetch supported functionalities", e); - } - } - } - - _parsePowerStates(data: any[]) { - const power: AuraPowerDev = this.leds_powered; - - power.tuf = data[0].map((value: string) => { - return AuraDevTuf[value as AuraDevTuf]; - }); - power.old_rog = data[1].map((value: string) => { - return AuraDevRog1[value as AuraDevRog1]; - }); - power.rog = { - keyboard: { - zone: PowerZones[data[2][0][0] as PowerZones], - boot: data[2][0][1], - awake: data[2][0][2], - sleep: data[2][0][3], - shutdown: data[2][0][4] - }, - logo: { - zone: PowerZones[data[2][1][0] as PowerZones], - boot: data[2][1][1], - awake: data[2][1][2], - sleep: data[2][1][3], - shutdown: data[2][1][4] - }, - lightbar: { - zone: PowerZones[data[2][2][0] as PowerZones], - boot: data[2][2][1], - awake: data[2][2][2], - sleep: data[2][2][3], - shutdown: data[2][2][4] - }, - lid: { - zone: PowerZones[data[2][3][0] as PowerZones], - boot: data[2][3][1], - awake: data[2][3][2], - sleep: data[2][3][3], - shutdown: data[2][3][4] - }, - rear_glow: { - zone: PowerZones[data[2][4][0] as PowerZones], - boot: data[2][4][1], - awake: data[2][4][2], - sleep: data[2][4][3], - shutdown: data[2][4][4] - } - }; - - return power; - } - - public getLedPower() { - if (this.isRunning()) { - try { - const data = this.dbus_proxy.LedPowerSync(); - this.leds_powered = this._parsePowerStates(data); - //@ts-ignore - log("LED power tuf: " + this.leds_powered.tuf); - //@ts-ignore - log("LED power x1866: " + this.leds_powered.old_rog); - //@ts-ignore - log("LED power x19b6: " + this.leds_powered.rog); - } catch (e) { - //@ts-ignore - log("Failed to fetch supported functionalities", e); - } - } - } - - public getLedMode() { - if (this.isRunning()) { - try { - this.current_aura_mode = AuraModeNum[this.dbus_proxy.LedModeSync() as AuraModeNum]; - //@ts-ignore - log("Current LED mode:", this.current_aura_mode); - } catch (e) { - //@ts-ignore - log("Failed to fetch supported functionalities", e); - } - } - } - - public setLedMode(mode: AuraEffect) { - if (this.isRunning()) { - try { - this.dbus_proxy.SetLedModeSync([ - mode.mode, - mode.zone, - [mode.colour1.r, mode.colour1.g, mode.colour1.b], - [mode.colour2.r, mode.colour2.g, mode.colour2.b], - mode.speed, - mode.direction]); - } catch (e) { - //@ts-ignore - log("Failed to fetch supported functionalities", e); - } - } - } - - _parseAuraEffect(data: any[]) { - const aura: AuraEffect = { - mode: AuraModeNum[data[0] as AuraModeNum], - zone: AuraZone[data[1] as AuraZone], - colour1: { - r: parseInt(data[2][0]), - g: parseInt(data[2][1]), - b: parseInt(data[2][2]), - }, - colour2: { - r: parseInt(data[3][0]), - g: parseInt(data[3][1]), - b: parseInt(data[3][2]), - }, - speed: Speed[data[4] as Speed], - direction: Direction[data[5] as Direction], - }; - return aura; - } - - // Return a list of the available modes, and the current settings for each - public getLedModes() { - // {'Breathe': ('Breathe', 'None', (166, 0, 0), (0, 0, 0), 'Med', 'Right'), - // 'Comet': ('Comet', 'None', (166, 0, 0), (0, 0, 0), 'Med', 'Right'), - // 'Static': ('Static', 'None', (78, 0, 0), (0, 0, 0), 'Med', 'Right'), - // 'Strobe': ('Strobe', 'None', (166, 0, 0), (0, 0, 0), 'Med', 'Right')} - if (this.isRunning()) { - try { - const _data = this.dbus_proxy.LedModesSync(); - for (const key in _data[0]) { - const data = _data[0][key]; - const aura: AuraEffect = this._parseAuraEffect(data); - this.aura_modes.set(AuraModeNum[key as AuraModeNum], aura); - } - - for (const [key, value] of this.aura_modes) { - //@ts-ignore - log(key, value.zone, value.colour1.r, value.speed, value.direction); - } - - } catch (e) { - //@ts-ignore - log("Failed to fetch supported functionalities", e); - } - } - } - - async start() { - try { - await super.start(); - this.getDevice(); - this.getLedPower(); - this.getLedMode(); - this.getLedModes(); - - //@ts-ignore - log("Current LED mode data:", this.aura_modes.get(this.current_aura_mode)?.speed); - - this.dbus_proxy.connectSignal( - "NotifyLed", - (proxy: any = null, name: string, data: any) => { - if (proxy) { - const aura: AuraEffect = this._parseAuraEffect(data[0]); - this.current_aura_mode = aura.mode; - this.aura_modes.set(aura.mode, aura); - //@ts-ignore - log("LED data has changed to ", aura.mode, aura.zone, aura.colour1.r, aura.speed, aura.direction); - this.notifyAuraModeSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - - this.dbus_proxy.connectSignal( - "NotifyPowerStates", - (proxy: any = null, name: string, data: any) => { - if (proxy) { - const power: AuraPowerDev = this._parsePowerStates(data[0]); - this.leds_powered = power; - switch (this.device) { - case AuraDevice.Tuf: - //@ts-ignore - log("LED power has changed to ", this.leds_powered.tuf); - break; - case AuraDevice.X1854: - case AuraDevice.X1869: - case AuraDevice.X18c6: - //@ts-ignore - log("LED power has changed to ", this.leds_powered.old_rog); - break; - case AuraDevice.X19b6: - case AuraDevice.X1a30: - //@ts-ignore - log("LED power has changed to ", this.leds_powered.rog); - break; - default: - break; - } - //@ts-ignore - log("LED power has changed to ", this.leds_powered.rog); - this.notifyAuraPowerSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - } catch (e) { - //@ts-ignore - log("Supported DBus initialization failed!", e); - } - } - - async stop() { - await super.stop(); - } -} \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/dbus/base.ts b/desktop-extensions/gnome-44/src/modules/dbus/base.ts deleted file mode 100644 index e3ca4ee9..00000000 --- a/desktop-extensions/gnome-44/src/modules/dbus/base.ts +++ /dev/null @@ -1,52 +0,0 @@ -declare const imports: any; - -import * as Resources from "../resources"; - -const { Gio } = imports.gi; - -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; - } -} \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/dbus/platform.ts b/desktop-extensions/gnome-44/src/modules/dbus/platform.ts deleted file mode 100644 index 1925ed01..00000000 --- a/desktop-extensions/gnome-44/src/modules/dbus/platform.ts +++ /dev/null @@ -1,202 +0,0 @@ -import * as bios from "../../bindings/platform"; -import { DbusBase } from "./base"; - -// TODO: add callbacks for notifications -export class Platform extends DbusBase { - bios: bios.RogBiosSupportedFunctions = { - post_sound: false, - gpu_mux: false, - panel_overdrive: false, - dgpu_disable: false, - egpu_enable: false, - mini_led_mode: false - }; - - // TODO: interface or something to enforce requirement of "sync()" method - public notifyPanelOdSubscribers: any[] = []; - public notifyPostBootSoundSubscribers: any[] = []; - public notifyMiniLedSubscribers: any[] = []; - public notifyGpuMuxSubscribers: any[] = []; - - constructor() { - super("org-asuslinux-platform-4", "/org/asuslinux/Platform"); - } - - public getPostBootSound() { - if (this.isRunning()) { - try { - this.bios.post_sound = this.dbus_proxy.PostBootSoundSync() == "true" ? true : false; - } catch (e) { - //@ts-ignore - log("Failed to get POST Boot Sound state!", e); - } - } - return this.bios.post_sound; - } - - public setPostBootSound(state: boolean) { - if (this.isRunning()) { - try { - if (state !== this.bios.post_sound) { - this.bios.post_sound = state; - } - return this.dbus_proxy.SetPostBootSoundSync(state); - } catch (e) { - //@ts-ignore - log("Platform DBus set Post Boot Sound failed!", e); - } - } - } - - public getGpuMuxMode() { - if (this.isRunning()) { - try { - this.bios.gpu_mux = this.dbus_proxy.GpuMuxModeSync() == "true" ? true : false; - } catch (e) { - //@ts-ignore - log("Failed to get MUX state!", e); - } - } - return this.bios.gpu_mux; - } - - public setGpuMuxMode(state: boolean) { - if (this.isRunning()) { - try { - if (!state !== this.bios.gpu_mux) { - this.bios.gpu_mux = !state; - } - return this.dbus_proxy.SetGpuMuxModeSync(!state); - } catch (e) { - //@ts-ignore - log("Switching the MUX failed!", e); - } - } - } - - public getPanelOd() { - if (this.isRunning()) { - try { - this.bios.panel_overdrive = this.dbus_proxy.PanelOdSync() == "true" ? true : false; - } catch (e) { - //@ts-ignore - log("Failed to get Overdrive state!", e); - } - } - return this.bios.panel_overdrive; - } - - public setPanelOd(state: boolean) { - if (this.isRunning()) { - try { - if (state !== this.bios.panel_overdrive) { - this.bios.panel_overdrive = state; - } - return this.dbus_proxy.SetPanelOdSync(state); - } catch (e) { - //@ts-ignore - log("Overdrive DBus set overdrive state failed!", e); - } - } - } - - public getMiniLedMode() { - if (this.isRunning()) { - try { - this.bios.mini_led_mode = this.dbus_proxy.MiniLedModeSync() == "true" ? true : false; - } catch (e) { - //@ts-ignore - log("Failed to get Overdrive state!", e); - } - } - return this.bios.mini_led_mode; - } - - public setMiniLedMode(state: boolean) { - if (this.isRunning()) { - try { - if (state !== this.bios.mini_led_mode) { - this.bios.mini_led_mode = state; - } - return this.dbus_proxy.SetMiniLedModeSync(state); - } catch (e) { - //@ts-ignore - log("setMiniLedMode failed!", e); - } - } - } - - async start() { - try { - await super.start(); - - this.getPostBootSound(); - this.dbus_proxy.connectSignal( - "NotifyPostBootSound", - (proxy: any = null, _name: string, data: boolean) => { - if (proxy) { - //@ts-ignore - log(`PostBootSound changed to ${data}`); - this.notifyPostBootSoundSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - - this.getPanelOd(); - this.dbus_proxy.connectSignal( - "NotifyPanelOd", - (proxy: any = null, _name: string, data: boolean) => { - if (proxy) { - //@ts-ignore - log(`NotifyPanelOd has changed to ${data}.`); - this.notifyPanelOdSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - - this.getMiniLedMode(); - this.dbus_proxy.connectSignal( - "NotifyMiniLedMode", - (proxy: any = null, _name: string, data: boolean) => { - if (proxy) { - //@ts-ignore - log(`MiniLedMode has changed to ${data}.`); - this.notifyMiniLedSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - - this.getGpuMuxMode(); - this.dbus_proxy.connectSignal( - "NotifyGpuMuxMode", - (proxy: any = null, _name: string, data: boolean) => { - if (proxy) { - //@ts-ignore - log(`MUX has changed to ${data}.`); - this.notifyGpuMuxSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - - } catch (e) { - //@ts-ignore - log("Platform DBus init failed!", e); - } - } - - async stop() { - await super.stop(); - this.bios.post_sound = false; - this.bios.panel_overdrive = false; - this.bios.mini_led_mode = false; - this.bios.gpu_mux = false; - } -} \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/dbus/power.ts b/desktop-extensions/gnome-44/src/modules/dbus/power.ts deleted file mode 100644 index f40a04ca..00000000 --- a/desktop-extensions/gnome-44/src/modules/dbus/power.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { DbusBase } from "./base"; - -// function getMethods(obj: { [x: string]: { toString: () => string; }; }) { -// var result = []; -// for (var id in obj) { -// try { -// if (typeof(obj[id]) == "function") { -// result.push(id + ": " + obj[id].toString()); -// } -// } catch (err) { -// result.push(id + ": inaccessible"); -// } -// } -// return result; -// } - -export class Power extends DbusBase { - chargeLimit = 100; - mainsOnline = false; - - constructor() { - super("org-asuslinux-power-4", "/org/asuslinux/Power"); - } - - public getChargingLimit() { - if (this.isRunning()) { - try { - this.chargeLimit = this.dbus_proxy.ChargeControlEndThresholdSync(); - } catch (e) { - //@ts-ignore - log("Failed to fetch Charging Limit!", e); - } - } - return this.chargeLimit; - } - - public setChargingLimit(limit: number) { - if (this.isRunning()) { - try { - if (limit > 0 && this.chargeLimit !== limit) { - // update state - this.chargeLimit = limit; - } - return this.dbus_proxy.SetChargeControlEndThresholdSync(limit); - } catch (e) { - //@ts-ignore - log("Profile DBus set power profile failed!", e); - } - } - } - - public getMainsOnline() { - if (this.isRunning()) { - try { - this.mainsOnline = this.dbus_proxy.MainsOnlineSync(); - } catch (e) { - //@ts-ignore - log("Failed to fetch MainsLonline!", e); - } - } - return this.mainsOnline; - } - - async start() { - try { - await super.start(); - this.getChargingLimit(); - - this.dbus_proxy.connectSignal( - "NotifyChargeControlEndThreshold", - (proxy: any = null, name: string, data: string) => { - if (proxy) { - //@ts-ignore - log(`Charging Limit has changed to ${data}% (${name}).`); - this.chargeLimit = parseInt(data); - } - } - ); - - this.dbus_proxy.connectSignal( - "NotifyMainsOnline", - (proxy: any = null, name: string, data: string) => { - if (proxy) { - //@ts-ignore - log(`NotifyMainsOnline has changed to ${data}% (${name}).`); - this.mainsOnline = parseInt(data) == 1 ? true : false; - } - } - ); - } catch (e) { - //@ts-ignore - log("Charging Limit DBus initialization failed!", e); - } - } - - async stop() { - await super.stop(); - } -} \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/dbus/supported.ts b/desktop-extensions/gnome-44/src/modules/dbus/supported.ts deleted file mode 100644 index 20a7d356..00000000 --- a/desktop-extensions/gnome-44/src/modules/dbus/supported.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { SupportedFunctions, AdvancedAura } from "../../bindings/platform"; -import { AuraDevice, AuraModeNum, AuraZone, PowerZones } from "../../bindings/aura"; -import { DbusBase } from "./base"; - -export class Supported extends DbusBase { - // False, - // (True,), - // (True, True), - // ('X19b6', - // True, - // ['Static', - // 'Breathe', - // 'Strobe', - // 'Rainbow', - // 'Star', - // 'Rain', - // 'Highlight', - // 'Laser', - // 'Ripple', - // 'Pulse', - // 'Comet', - // 'Flash'], - // [], - // 'PerKey', - // ['Keyboard', 'Lightbar', 'Logo', 'RearGlow']), - // (False, True, True, True, False, True) - - supported: SupportedFunctions = { - anime_ctrl: false, - charge_ctrl: { - charge_level_set: false - }, - platform_profile: { - platform_profile: false, - fan_curves: false - }, - keyboard_led: { - dev_id: AuraDevice.Unknown, - brightness: false, - basic_modes: [], - basic_zones: [], - advanced_type: AdvancedAura.None - }, - rog_bios_ctrl: { - post_sound: false, - gpu_mux: false, - panel_overdrive: false, - dgpu_disable: false, - egpu_enable: false, - mini_led_mode: false - } - }; - - constructor() { - super("org-asuslinux-supported-4", "/org/asuslinux/Supported"); - } - - public getSupported() { - if (this.isRunning()) { - try { - const _data = this.dbus_proxy.SupportedFunctionsSync(); - this.supported.anime_ctrl = _data[0]; - this.supported.charge_ctrl.charge_level_set = _data[1]; - this.supported.platform_profile.platform_profile = _data[2][0]; - this.supported.platform_profile.fan_curves = _data[2][1]; - this.supported.keyboard_led.dev_id = AuraDevice[_data[3][0] as AuraDevice]; - this.supported.keyboard_led.brightness = _data[3][1]; - - this.supported.keyboard_led.basic_modes = _data[3][2].map(function (value: string) { - return AuraModeNum[value as AuraModeNum]; - }); - this.supported.keyboard_led.basic_zones = _data[3][3].map(function (value: string) { - return AuraZone[value as AuraZone]; - }); - this.supported.keyboard_led.advanced_type = AdvancedAura[_data[3][4] as AdvancedAura]; - this.supported.keyboard_led.power_zones = _data[3][5].map(function (value: string) { - return PowerZones[value as PowerZones]; - }); - - this.supported.rog_bios_ctrl.post_sound = _data[4][0]; - this.supported.rog_bios_ctrl.gpu_mux = _data[4][1]; - this.supported.rog_bios_ctrl.panel_overdrive = _data[4][2]; - this.supported.rog_bios_ctrl.dgpu_disable = _data[4][3]; - this.supported.rog_bios_ctrl.egpu_enable = _data[4][4]; - this.supported.rog_bios_ctrl.mini_led_mode = _data[4][5]; - } catch (e) { - //@ts-ignore - log("Failed to fetch supported functionalities", e); - } - } - } - - async start() { - try { - await super.start(); - this.getSupported(); - } catch (e) { - //@ts-ignore - log("Supported DBus initialization failed!", e); - } - } - - async stop() { - await super.stop(); - } -} \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/helpers.ts b/desktop-extensions/gnome-44/src/modules/helpers.ts deleted file mode 100644 index e367a813..00000000 --- a/desktop-extensions/gnome-44/src/modules/helpers.ts +++ /dev/null @@ -1,15 +0,0 @@ -declare const imports: any; - -const { QuickToggle } = imports.ui.quickSettings; -const QuickSettingsMenu = imports.ui.main.panel.statusArea.quickSettings; - -export function addQuickSettingsItems(items: [typeof QuickToggle], width = 1) { - // Add the items with the built-in function - QuickSettingsMenu._addItems(items, width); - - // Ensure the tile(s) are above the background apps menu - for (const item of items) { - QuickSettingsMenu.menu._grid.set_child_below_sibling(item, - QuickSettingsMenu._backgroundApps.quickSettingsItems[0]); - } -} \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/indicators/mini_led.ts b/desktop-extensions/gnome-44/src/modules/indicators/mini_led.ts deleted file mode 100644 index e08704eb..00000000 --- a/desktop-extensions/gnome-44/src/modules/indicators/mini_led.ts +++ /dev/null @@ -1,28 +0,0 @@ -declare const imports: any; -// REF: https://gjs.guide/extensions/development/creating.html - -const { GObject, Gio } = imports.gi; -const ExtensionUtils = imports.misc.extensionUtils; - -const { SystemIndicator } = imports.ui.quickSettings; -const QuickSettingsMenu = imports.ui.main.panel.statusArea.quickSettings; - -export const IndicateMiniLed = GObject.registerClass( - class IndicateMiniLed extends SystemIndicator { - constructor() { - super(); - - // Create the icon for the indicator - this._indicator = this._addIndicator(); - this._indicator.icon_name = "selection-mode-symbolic"; - - // Showing the indicator when the feature is enabled - this._settings = ExtensionUtils.getSettings(); - this._settings.bind("mini-led-enabled", - this._indicator, "visible", - Gio.SettingsBindFlags.DEFAULT); - - // Add the indicator to the panel and the toggle to the menu - QuickSettingsMenu._indicators.add_child(this); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/menu_toggles/anime.ts b/desktop-extensions/gnome-44/src/modules/menu_toggles/anime.ts deleted file mode 100644 index 54d25085..00000000 --- a/desktop-extensions/gnome-44/src/modules/menu_toggles/anime.ts +++ /dev/null @@ -1,86 +0,0 @@ -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); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/menu_toggles/mini_led.ts b/desktop-extensions/gnome-44/src/modules/menu_toggles/mini_led.ts deleted file mode 100644 index 4bdcebec..00000000 --- a/desktop-extensions/gnome-44/src/modules/menu_toggles/mini_led.ts +++ /dev/null @@ -1,46 +0,0 @@ -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); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/menu_toggles/panel_od.ts b/desktop-extensions/gnome-44/src/modules/menu_toggles/panel_od.ts deleted file mode 100644 index 2ca8a3ca..00000000 --- a/desktop-extensions/gnome-44/src/modules/menu_toggles/panel_od.ts +++ /dev/null @@ -1,46 +0,0 @@ -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); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/quick_menus/aura.ts b/desktop-extensions/gnome-44/src/modules/quick_menus/aura.ts deleted file mode 100644 index 2df2eb76..00000000 --- a/desktop-extensions/gnome-44/src/modules/quick_menus/aura.ts +++ /dev/null @@ -1,86 +0,0 @@ -declare const imports: any; -// REF: https://gjs.guide/extensions/development/creating.html - -import { addQuickSettingsItems } from "../helpers"; -import { AuraDbus } from "../dbus/aura"; -import { AuraEffect, AuraModeNum } from "../../bindings/aura"; - -const { GObject } = imports.gi; -const ExtensionUtils = imports.misc.extensionUtils; -// const Me = ExtensionUtils.getCurrentExtension(); -// const Main = imports.ui.main; -const PopupMenu = imports.ui.popupMenu; -const QuickSettings = imports.ui.quickSettings; - -export const AuraMenuToggle = GObject.registerClass( - class AuraMenuToggle extends QuickSettings.QuickMenuToggle { - private _dbus_aura: AuraDbus; - private _last_mode: AuraModeNum = AuraModeNum.Static; - - constructor(dbus_aura: AuraDbus) { - super({ - title: "Aura Modes", - iconName: "selection-mode-symbolic", - toggleMode: true, - }); - this._dbus_aura = dbus_aura; - - this.connectObject( - "destroy", () => this._settings.run_dispose(), - this); - - this.menu.setHeader("selection-mode-symbolic", this._dbus_aura.current_aura_mode); - - this._settings = ExtensionUtils.getSettings(); - - this._itemsSection = new PopupMenu.PopupMenuSection(); - - this._dbus_aura.aura_modes.forEach((mode, key) => { - this._itemsSection.addAction(key, () => { - this._dbus_aura.setLedMode(mode); - this.sync(); - }, ""); - }); - - this.menu.addMenuItem(this._itemsSection); - - // Add an entry-point for more settings - // this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - // const settingsItem = this.menu.addAction("More Settings", - // () => ExtensionUtils.openPrefs()); - // // Ensure the settings are unavailable when the screen is locked - // settingsItem.visible = Main.sessionMode.allowSettings; - // this.menu._settingsActions[Me.uuid] = settingsItem; - - this.connectObject( - "clicked", () => { - let mode: AuraEffect | undefined; - if (this._dbus_aura.current_aura_mode == AuraModeNum.Static) { - mode = this._dbus_aura.aura_modes.get(this._last_mode); - } else { - mode = this._dbus_aura.aura_modes.get(AuraModeNum.Static); - } - if (mode != undefined) { - this._dbus_aura.setLedMode(mode); - this.sync(); - } - }, - this); - - this._dbus_aura.notifyAuraModeSubscribers.push(this); - this.sync(); - - addQuickSettingsItems([this]); - } - - sync() { - const checked = this._dbus_aura.current_aura_mode != AuraModeNum.Static; - this.title = this._dbus_aura.current_aura_mode; - if (this._last_mode != this._dbus_aura.current_aura_mode && this._dbus_aura.current_aura_mode != AuraModeNum.Static) { - this._last_mode = this._dbus_aura.current_aura_mode; - } - - if (this.checked !== checked) - this.set({ checked }); - } - }); diff --git a/desktop-extensions/gnome-44/src/modules/quick_menus/laptop_features.ts b/desktop-extensions/gnome-44/src/modules/quick_menus/laptop_features.ts deleted file mode 100644 index 71014e43..00000000 --- a/desktop-extensions/gnome-44/src/modules/quick_menus/laptop_features.ts +++ /dev/null @@ -1,179 +0,0 @@ -declare const imports: any; -// REF: https://gjs.guide/extensions/development/creating.html - -import { AnimeDbus } from "../dbus/animatrix"; -import { Supported } from "../dbus/supported"; -import { Platform } from "../dbus/platform"; - -import { addQuickSettingsItems } from "../helpers"; -import { MenuToggleAnimeBuiltins, MenuToggleAnimePower } from "../menu_toggles/anime"; -import { MenuTogglePanelOd } from "../menu_toggles/panel_od"; -import { MenuToggleMiniLed } from "../menu_toggles/mini_led"; - - -const { GObject } = imports.gi; - -const ExtensionUtils = imports.misc.extensionUtils; -// const Me = ExtensionUtils.getCurrentExtension(); -// const Main = imports.ui.main; -const PopupMenu = imports.ui.popupMenu; -const QuickSettings = imports.ui.quickSettings; - -export const FeatureMenuToggle = GObject.registerClass( - class FeatureMenuToggle extends QuickSettings.QuickMenuToggle { - private _dbus_supported: Supported; - private _dbus_platform: Platform; - private _dbus_anime: AnimeDbus; - - public miniLed: typeof MenuToggleMiniLed; - public panelOd: typeof MenuTogglePanelOd; - public animeDisplayPower: typeof MenuToggleAnimePower; - public animePowersaveAnim: typeof MenuToggleAnimeBuiltins; - private primary = "mini-led"; - - constructor(dbus_supported: Supported, dbus_platform: Platform, dbus_anime: AnimeDbus) { - super({ - title: "Laptop", - iconName: "selection-mode-symbolic", - toggleMode: true, - }); - this._dbus_supported = dbus_supported; - this._dbus_platform = dbus_platform; - this._dbus_anime = dbus_anime; - - this.menu.setHeader("selection-mode-symbolic", "Laptop features"); - - this._settings = ExtensionUtils.getSettings(); - this.primary = this._settings.get_string("primary-quickmenu-toggle"); - - // TODO: temporary block - if (this.primary == "mini-led" && !this._dbus_supported.supported.rog_bios_ctrl.mini_led_mode) { - this.primary = "panel-od"; - } else if (this.primary == "panel-od" && !this._dbus_supported.supported.rog_bios_ctrl.panel_overdrive) { - this.primary = "anime-power"; - } else if (this.primary == "anime-power" && !this._dbus_supported.supported.anime_ctrl) { - this.primary = "mini-led"; - } else if (this.primary.length == 0) { - this.primary = "panel-od"; - } - - this.connectObject( - "destroy", () => this._settings.run_dispose(), - this); - this._settings.connect('changed::primary-quickmenu-toggle', - this.sync); - this._settings.set_string("primary-quickmenu-toggle", this.primary); - - this._itemsSection = new PopupMenu.PopupMenuSection(); - if (this._dbus_supported.supported.rog_bios_ctrl.mini_led_mode) { - if (this.miniLed == null) { - this.miniLed = new MenuToggleMiniLed(this._dbus_platform); - this._dbus_platform.notifyMiniLedSubscribers.push(this.miniLed); - this._itemsSection.addMenuItem(this.miniLed); - this._dbus_platform.notifyMiniLedSubscribers.push(this); - this.miniLed.toggle_callback = () => { - this.primary = "mini-led"; - this.sync(); - } - } - } - - if (this._dbus_supported.supported.rog_bios_ctrl.panel_overdrive) { - if (this.panelOd == null) { - this.panelOd = new MenuTogglePanelOd(this._dbus_platform); - this._dbus_platform.notifyPanelOdSubscribers.push(this.panelOd); - this._itemsSection.addMenuItem(this.panelOd); - this._dbus_platform.notifyPanelOdSubscribers.push(this); - this.panelOd.toggle_callback = () => { - this.primary = "panel-od"; - this.sync(); - } - } - } - - if (this._dbus_supported.supported.anime_ctrl) { - if (this.animeDisplayPower == null) { - this.animeDisplayPower = new MenuToggleAnimePower(this._dbus_anime); - this._dbus_anime.notifyAnimeStateSubscribers.push(this.animeDisplayPower); - this._itemsSection.addMenuItem(this.animeDisplayPower); - this._dbus_anime.notifyAnimeStateSubscribers.push(this); - this.animeDisplayPower.toggle_callback = () => { - this.primary = "anime-power"; - this.sync(); - } - } - - if (this.animePowersaveAnim == null) { - this.animePowersaveAnim = new MenuToggleAnimeBuiltins(this._dbus_anime); - this._dbus_anime.notifyAnimeStateSubscribers.push(this.animePowersaveAnim); - this._itemsSection.addMenuItem(this.animePowersaveAnim); - } - } - - this.connectObject( - "clicked", () => { - this._toggle(); - }, - this); - - this.menu.addMenuItem(this._itemsSection); - - // // Add an entry-point for more settings - // this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - // const settingsItem = this.menu.addAction("More Settings", - // () => ExtensionUtils.openPrefs()); - // // Ensure the settings are unavailable when the screen is locked - // settingsItem.visible = Main.sessionMode.allowSettings; - // this.menu._settingsActions[Me.uuid] = settingsItem; - - this.sync(); - addQuickSettingsItems([this]); - } - - _toggle() { - if (this.primary == "mini-led" && this.miniLed != null) { - this._dbus_platform.getMiniLedMode(); - const checked = this._dbus_platform.bios.mini_led_mode; - if (this.checked !== checked) - this._dbus_platform.setMiniLedMode(this.checked); - } - - if (this.primary == "panel-od" && this.panelOd != null) { - this._dbus_platform.getPanelOd(); - const checked = this._dbus_platform.bios.panel_overdrive; - if (this.checked !== checked) - this._dbus_platform.setPanelOd(this.checked); - } - - if (this.primary == "anime-power" && this.animeDisplayPower != null) { - this._dbus_anime.getDeviceState(); - const checked = this._dbus_anime.deviceState.display_enabled; - if (this.checked !== checked) - this._dbus_anime.setEnableDisplay(this.checked); - } - } - - sync() { - let checked = false; - if (this.primary == "mini-led" && this.miniLed != null) { - this.title = this.miniLed.label; - checked = this._dbus_platform.bios.mini_led_mode; - } - - if (this.primary == "panel-od" && this.panelOd != null) { - this.title = this.panelOd.label; - checked = this._dbus_platform.bios.panel_overdrive; - } - - if (this.primary == "anime-power" && this.animeDisplayPower != null) { - this.title = this.animeDisplayPower.label; - checked = this._dbus_anime.deviceState.display_enabled; - } - - // if (this.animePowersaveAnim != null) { - // } - - if (this.checked !== checked) - this.set({ checked }); - } - }); diff --git a/desktop-extensions/gnome-44/src/modules/quick_toggles/anime_power.ts b/desktop-extensions/gnome-44/src/modules/quick_toggles/anime_power.ts deleted file mode 100644 index 217ce4fe..00000000 --- a/desktop-extensions/gnome-44/src/modules/quick_toggles/anime_power.ts +++ /dev/null @@ -1,56 +0,0 @@ -declare const imports: any; - -import { AnimeDbus } from "../dbus/animatrix"; -import { addQuickSettingsItems } from "../helpers"; - -const { GObject, Gio } = imports.gi; -const ExtensionUtils = imports.misc.extensionUtils; - -const { QuickToggle } = imports.ui.quickSettings; - -export const QuickAnimePower = GObject.registerClass( - class QuickAnimePower extends QuickToggle { - private _dbus_anime: AnimeDbus; - - constructor(dbus_anime: AnimeDbus) { - super({ - title: "AniMatrix Power", - iconName: "selection-mode-symbolic", - toggleMode: true, - }); - this._dbus_anime = dbus_anime; - this.label = "AniMatrix Power"; - this._settings = ExtensionUtils.getSettings(); - - this.connectObject( - "destroy", () => this._settings.run_dispose(), - "clicked", () => this._toggleMode(), - this); - - this.connect("destroy", () => { - this.destroy(); - }); - - this._settings.bind("anime-power", - this, "checked", - Gio.SettingsBindFlags.DEFAULT); - - this.sync(); - - addQuickSettingsItems([this]); - } - - _toggleMode() { - this._dbus_anime.getDeviceState(); - const checked = this._dbus_anime.deviceState.display_enabled; - if (this.checked !== checked) - this._dbus_anime.setEnableDisplay(this.checked); - } - - sync() { - this._dbus_anime.getDeviceState(); - const checked = this._dbus_anime.deviceState.display_enabled; - if (this.checked !== checked) - this.set({ checked }); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/quick_toggles/mini_led.ts b/desktop-extensions/gnome-44/src/modules/quick_toggles/mini_led.ts deleted file mode 100644 index 722d8d0a..00000000 --- a/desktop-extensions/gnome-44/src/modules/quick_toggles/mini_led.ts +++ /dev/null @@ -1,54 +0,0 @@ -declare const imports: any; - -import { Platform } from "../dbus/platform"; -import { addQuickSettingsItems } from "../helpers"; - -const { GObject, Gio } = imports.gi; -const ExtensionUtils = imports.misc.extensionUtils; - -const { QuickToggle } = imports.ui.quickSettings; - -export const QuickMiniLed = GObject.registerClass( - class QuickMiniLed extends QuickToggle { - private _dbus_platform: Platform; - - constructor(dbus_platform: Platform) { - super({ - title: "MiniLED", - iconName: "selection-mode-symbolic", - toggleMode: true, - }); - this._dbus_platform = dbus_platform; - this.label = "MiniLED"; - this._settings = ExtensionUtils.getSettings(); - - this.connectObject( - "destroy", () => this._settings.run_dispose(), - "clicked", () => this._toggleMode(), - this); - - this.connect("destroy", () => { - this.destroy(); - }); - - this._settings.bind("mini-led-enabled", - this, "checked", - Gio.SettingsBindFlags.DEFAULT); - - this.sync(); - - addQuickSettingsItems([this]); - } - - _toggleMode() { - const checked = this._dbus_platform.getMiniLedMode(); - if (this.checked !== checked) - this._dbus_platform.setMiniLedMode(this.checked); - } - - sync() { - const checked = this._dbus_platform.getMiniLedMode(); - if (this.checked !== checked) - this.set({ checked }); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/quick_toggles/panel_od.ts b/desktop-extensions/gnome-44/src/modules/quick_toggles/panel_od.ts deleted file mode 100644 index 15e9d18e..00000000 --- a/desktop-extensions/gnome-44/src/modules/quick_toggles/panel_od.ts +++ /dev/null @@ -1,54 +0,0 @@ -declare const imports: any; - -import { Platform } from "../dbus/platform"; -import { addQuickSettingsItems } from "../helpers"; - -const { GObject, Gio } = imports.gi; -const ExtensionUtils = imports.misc.extensionUtils; - -const { QuickToggle } = imports.ui.quickSettings; - -export const QuickPanelOd = GObject.registerClass( - class QuickPanelOd extends QuickToggle { - private _dbus_platform: Platform; - - constructor(dbus_platform: Platform) { - super({ - title: "Panel Overdrive", - iconName: "selection-mode-symbolic", - toggleMode: true, - }); - this._dbus_platform = dbus_platform; - this.label = "Panel Overdrive"; - this._settings = ExtensionUtils.getSettings(); - - this.connectObject( - "destroy", () => this._settings.run_dispose(), - "clicked", () => this._toggleMode(), - this); - - this.connect("destroy", () => { - this.destroy(); - }); - - this._settings.bind("panel-od-enabled", - this, "checked", - Gio.SettingsBindFlags.DEFAULT); - - this.sync(); - - addQuickSettingsItems([this]); - } - - _toggleMode() { - const checked = this._dbus_platform.getPanelOd(); - if (this.checked !== checked) - this._dbus_platform.setPanelOd(this.checked); - } - - sync() { - const checked = this._dbus_platform.getPanelOd(); - if (this.checked !== checked) - this.set({ checked }); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-44/src/modules/resources.ts b/desktop-extensions/gnome-44/src/modules/resources.ts deleted file mode 100644 index e4925f89..00000000 --- a/desktop-extensions/gnome-44/src/modules/resources.ts +++ /dev/null @@ -1,20 +0,0 @@ -declare const imports: any; -const Me = imports.misc.extensionUtils.getCurrentExtension(); - -const GLib = imports.gi.GLib; - -export class File { - public static DBus(name: string) { - const file = `${Me.path}/resources/dbus/${name}.xml`; - try { - const [_ok, bytes] = GLib.file_get_contents(file); - if (!_ok) - //@ts-ignore - log(`Couldn't read contents of "${file}"`); - return _ok ? imports.byteArray.toString(bytes) : null; - } catch (e) { - //@ts-ignore - log(`Failed to load "${file}"`, e); - } - } -} diff --git a/desktop-extensions/gnome-44/src/modules/sliders/charge.ts b/desktop-extensions/gnome-44/src/modules/sliders/charge.ts deleted file mode 100644 index 86f71e7e..00000000 --- a/desktop-extensions/gnome-44/src/modules/sliders/charge.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Power } from "../dbus/power"; -import { addQuickSettingsItems } from "../helpers"; - -declare const imports: any; - -const { GObject } = imports.gi; -const ExtensionUtils = imports.misc.extensionUtils; -const QuickSettings = imports.ui.quickSettings; - -export const SliderChargeLevel = GObject.registerClass( - class SliderChargeLevel extends QuickSettings.QuickSlider { - private _dbus_power: Power; - - constructor(dbus_power: Power) { - super({ - iconName: "selection-mode-symbolic", - }); - this._dbus_power = dbus_power; - - this._sliderChangedId = this.slider.connect("drag-end", - this._onSliderChanged.bind(this)); - - // Binding the slider to a GSettings key - this._settings = ExtensionUtils.getSettings(); - - this._settings.connect("changed::charge-level", - this._onSettingsChanged.bind(this)); - - // Set an accessible name for the slider - this.slider.accessible_name = "Charge level"; - - this._sync(); - this._onSettingsChanged(); - - addQuickSettingsItems([this], 2); - } - - _onSettingsChanged() { - // Prevent the slider from emitting a change signal while being updated - this.slider.block_signal_handler(this._sliderChangedId); - this.slider.value = this._settings.get_uint("charge-level") / 100.0; - this.slider.unblock_signal_handler(this._sliderChangedId); - } - - _onSliderChanged() { - // Assuming our GSettings holds values between 0..100, adjust for the - // slider taking values between 0..1 - const percent = Math.floor(this.slider.value * 100); - const stored = Math.floor(this._settings.get_uint("charge-level") / 100.0); - if (this.slider.value !== stored) - this._dbus_power.setChargingLimit(percent); - this._settings.set_uint("charge-level", percent); - } - - _sync() { - const value = this._dbus_power.getChargingLimit(); - if (this.slider.value !== value / 100) - this._settings.set_uint("charge-level", value); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-44/tsconfig.json b/desktop-extensions/gnome-44/tsconfig.json deleted file mode 100644 index ff66c5ce..00000000 --- a/desktop-extensions/gnome-44/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "lib": [ - "es2019" - ], - "types": [], - "target": "es2019", - "module": "CommonJS", - "moduleResolution": "node", - "declaration": true, - "removeComments": true, - "strict": true, - "allowJs": true - }, - "files": [ - "./src/extension.ts", - ], - "include": [ - "src/*.ts", - "src/**/*.ts" - ] -} \ No newline at end of file diff --git a/desktop-extensions/gnome-44/yarn.lock b/desktop-extensions/gnome-44/yarn.lock deleted file mode 100644 index 42c47fb6..00000000 --- a/desktop-extensions/gnome-44/yarn.lock +++ /dev/null @@ -1,940 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@aashutoshrathi/word-wrap@^1.2.3": - version "1.2.6" - resolved "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz" - integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== - -"@esbuild/linux-x64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz" - integrity sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw== - -"@eslint-community/eslint-utils@^4.2.0": - version "4.4.0" - resolved "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz" - integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== - dependencies: - eslint-visitor-keys "^3.3.0" - -"@eslint-community/regexpp@^4.4.0": - version "4.5.1" - resolved "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz" - integrity sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ== - -"@eslint/eslintrc@^2.1.0": - version "2.1.0" - resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz" - integrity sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A== - dependencies: - ajv "^6.12.4" - debug "^4.3.2" - espree "^9.6.0" - globals "^13.19.0" - ignore "^5.2.0" - import-fresh "^3.2.1" - js-yaml "^4.1.0" - minimatch "^3.1.2" - strip-json-comments "^3.1.1" - -"@eslint/js@8.44.0": - version "8.44.0" - resolved "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz" - integrity sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw== - -"@humanwhocodes/config-array@^0.11.10": - version "0.11.10" - resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz" - integrity sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ== - dependencies: - "@humanwhocodes/object-schema" "^1.2.1" - debug "^4.1.1" - minimatch "^3.0.5" - -"@humanwhocodes/module-importer@^1.0.1": - version "1.0.1" - resolved "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz" - integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== - -"@humanwhocodes/object-schema@^1.2.1": - version "1.2.1" - resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz" - integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@^2.0.2", "@nodelib/fs.stat@2.0.5": - version "2.0.5" - resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": - version "1.2.8" - resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@types/json-schema@^7.0.9": - version "7.0.12" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz" - integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== - -"@types/semver@^7.3.12": - version "7.5.0" - resolved "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz" - integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== - -"@typescript-eslint/eslint-plugin@^5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.60.1.tgz" - integrity sha512-KSWsVvsJsLJv3c4e73y/Bzt7OpqMCADUO846bHcuWYSYM19bldbAeDv7dYyV0jwkbMfJ2XdlzwjhXtuD7OY6bw== - dependencies: - "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.60.1" - "@typescript-eslint/type-utils" "5.60.1" - "@typescript-eslint/utils" "5.60.1" - debug "^4.3.4" - grapheme-splitter "^1.0.4" - ignore "^5.2.0" - natural-compare-lite "^1.4.0" - semver "^7.3.7" - tsutils "^3.21.0" - -"@typescript-eslint/parser@^5.0.0", "@typescript-eslint/parser@^5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.60.1.tgz" - integrity sha512-pHWlc3alg2oSMGwsU/Is8hbm3XFbcrb6P5wIxcQW9NsYBfnrubl/GhVVD/Jm/t8HXhA2WncoIRfBtnCgRGV96Q== - dependencies: - "@typescript-eslint/scope-manager" "5.60.1" - "@typescript-eslint/types" "5.60.1" - "@typescript-eslint/typescript-estree" "5.60.1" - debug "^4.3.4" - -"@typescript-eslint/scope-manager@5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.60.1.tgz" - integrity sha512-Dn/LnN7fEoRD+KspEOV0xDMynEmR3iSHdgNsarlXNLGGtcUok8L4N71dxUgt3YvlO8si7E+BJ5Fe3wb5yUw7DQ== - dependencies: - "@typescript-eslint/types" "5.60.1" - "@typescript-eslint/visitor-keys" "5.60.1" - -"@typescript-eslint/type-utils@5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.60.1.tgz" - integrity sha512-vN6UztYqIu05nu7JqwQGzQKUJctzs3/Hg7E2Yx8rz9J+4LgtIDFWjjl1gm3pycH0P3mHAcEUBd23LVgfrsTR8A== - dependencies: - "@typescript-eslint/typescript-estree" "5.60.1" - "@typescript-eslint/utils" "5.60.1" - debug "^4.3.4" - tsutils "^3.21.0" - -"@typescript-eslint/types@5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.60.1.tgz" - integrity sha512-zDcDx5fccU8BA0IDZc71bAtYIcG9PowaOwaD8rjYbqwK7dpe/UMQl3inJ4UtUK42nOCT41jTSCwg76E62JpMcg== - -"@typescript-eslint/typescript-estree@5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.60.1.tgz" - integrity sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw== - dependencies: - "@typescript-eslint/types" "5.60.1" - "@typescript-eslint/visitor-keys" "5.60.1" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - -"@typescript-eslint/utils@5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.60.1.tgz" - integrity sha512-tiJ7FFdFQOWssFa3gqb94Ilexyw0JVxj6vBzaSpfN/8IhoKkDuSAenUKvsSHw2A/TMpJb26izIszTXaqygkvpQ== - dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@types/json-schema" "^7.0.9" - "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.60.1" - "@typescript-eslint/types" "5.60.1" - "@typescript-eslint/typescript-estree" "5.60.1" - eslint-scope "^5.1.1" - semver "^7.3.7" - -"@typescript-eslint/visitor-keys@5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.60.1.tgz" - integrity sha512-xEYIxKcultP6E/RMKqube11pGjXH1DCo60mQoWhVYyKfLkwbIVVjYxmOenNMxILx0TjCujPTjjnTIVzm09TXIw== - dependencies: - "@typescript-eslint/types" "5.60.1" - eslint-visitor-keys "^3.3.0" - -acorn-jsx@^5.3.2: - version "5.3.2" - resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" - integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== - -"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.9.0: - version "8.9.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz" - integrity sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ== - -adm-zip@^0.5.10: - version "0.5.10" - resolved "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz" - integrity sha512-x0HvcHqVJNTPk/Bw8JbLWlWoo6Wwnsug0fnYYro1HBrjxZ3G7/AZk7Ahv8JwDe1uIcz8eBqvu86FuF1POiG7vQ== - -ajv@^6.10.0, ajv@^6.12.4: - version "6.12.6" - resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -chalk@^4.0.0: - version "4.1.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -cross-spawn@^7.0.2: - version "7.0.3" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: - version "4.3.4" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -deep-is@^0.1.3: - version "0.1.4" - resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -esbuild@^0.17.19: - version "0.17.19" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz" - integrity sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw== - optionalDependencies: - "@esbuild/android-arm" "0.17.19" - "@esbuild/android-arm64" "0.17.19" - "@esbuild/android-x64" "0.17.19" - "@esbuild/darwin-arm64" "0.17.19" - "@esbuild/darwin-x64" "0.17.19" - "@esbuild/freebsd-arm64" "0.17.19" - "@esbuild/freebsd-x64" "0.17.19" - "@esbuild/linux-arm" "0.17.19" - "@esbuild/linux-arm64" "0.17.19" - "@esbuild/linux-ia32" "0.17.19" - "@esbuild/linux-loong64" "0.17.19" - "@esbuild/linux-mips64el" "0.17.19" - "@esbuild/linux-ppc64" "0.17.19" - "@esbuild/linux-riscv64" "0.17.19" - "@esbuild/linux-s390x" "0.17.19" - "@esbuild/linux-x64" "0.17.19" - "@esbuild/netbsd-x64" "0.17.19" - "@esbuild/openbsd-x64" "0.17.19" - "@esbuild/sunos-x64" "0.17.19" - "@esbuild/win32-arm64" "0.17.19" - "@esbuild/win32-ia32" "0.17.19" - "@esbuild/win32-x64" "0.17.19" - -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - -eslint-scope@^7.2.0: - version "7.2.0" - resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz" - integrity sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw== - dependencies: - esrecurse "^4.3.0" - estraverse "^5.2.0" - -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: - version "3.4.1" - resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz" - integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== - -eslint@*, "eslint@^6.0.0 || ^7.0.0 || ^8.0.0", "eslint@^6.0.0 || ^7.0.0 || >=8.0.0", eslint@^8.44.0: - version "8.44.0" - resolved "https://registry.npmjs.org/eslint/-/eslint-8.44.0.tgz" - integrity sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A== - dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.4.0" - "@eslint/eslintrc" "^2.1.0" - "@eslint/js" "8.44.0" - "@humanwhocodes/config-array" "^0.11.10" - "@humanwhocodes/module-importer" "^1.0.1" - "@nodelib/fs.walk" "^1.2.8" - ajv "^6.10.0" - chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.3.2" - doctrine "^3.0.0" - escape-string-regexp "^4.0.0" - eslint-scope "^7.2.0" - eslint-visitor-keys "^3.4.1" - espree "^9.6.0" - esquery "^1.4.2" - esutils "^2.0.2" - fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" - find-up "^5.0.0" - glob-parent "^6.0.2" - globals "^13.19.0" - graphemer "^1.4.0" - ignore "^5.2.0" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - is-path-inside "^3.0.3" - js-yaml "^4.1.0" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash.merge "^4.6.2" - minimatch "^3.1.2" - natural-compare "^1.4.0" - optionator "^0.9.3" - strip-ansi "^6.0.1" - strip-json-comments "^3.1.0" - text-table "^0.2.0" - -espree@^9.6.0: - version "9.6.0" - resolved "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz" - integrity sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A== - dependencies: - acorn "^8.9.0" - acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.4.1" - -esquery@^1.4.2: - version "1.5.0" - resolved "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz" - integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0: - version "5.3.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== - -estraverse@^5.2.0: - version "5.3.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: - version "3.1.3" - resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-glob@^3.2.9: - version "3.3.0" - resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz" - integrity sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@^2.0.6: - version "2.0.6" - resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" - integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== - -fastq@^1.6.0: - version "1.15.0" - resolved "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz" - integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== - dependencies: - reusify "^1.0.4" - -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== - dependencies: - flat-cache "^3.0.4" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -flat-cache@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz" - integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== - dependencies: - flatted "^3.1.0" - rimraf "^3.0.2" - -flatted@^3.1.0: - version "3.2.7" - resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz" - integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - -glob-parent@^5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob-parent@^6.0.2: - version "6.0.2" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz" - integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== - dependencies: - is-glob "^4.0.3" - -glob@^7.1.3: - version "7.2.3" - resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^13.19.0: - version "13.20.0" - resolved "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz" - integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== - dependencies: - type-fest "^0.20.2" - -globby@^11.1.0: - version "11.1.0" - resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" - integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.2.9" - ignore "^5.2.0" - merge2 "^1.4.1" - slash "^3.0.0" - -grapheme-splitter@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz" - integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== - -graphemer@^1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz" - integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -ignore@^5.2.0: - version "5.2.4" - resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== - -import-fresh@^3.0.0, import-fresh@^3.2.1: - version "3.3.0" - resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" - integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: - version "4.0.3" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-path-inside@^3.0.3: - version "3.0.3" - resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz" - integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - -js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" - integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== - -levn@^0.4.1: - version "0.4.1" - resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz" - integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== - dependencies: - prelude-ls "^1.2.1" - type-check "~0.4.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash.merge@^4.6.2: - version "4.6.2" - resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" - integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -merge2@^1.3.0, merge2@^1.4.1: - version "1.4.1" - resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -micromatch@^4.0.4: - version "4.0.5" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - -minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: - version "3.1.2" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -natural-compare-lite@^1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz" - integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" - integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -optionator@^0.9.3: - version "0.9.3" - resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz" - integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== - dependencies: - "@aashutoshrathi/word-wrap" "^1.2.3" - deep-is "^0.1.3" - fast-levenshtein "^2.0.6" - levn "^0.4.1" - prelude-ls "^1.2.1" - type-check "^0.4.0" - -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -prelude-ls@^1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" - integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== - -punycode@^2.1.0: - version "2.3.0" - resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz" - integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -semver@^7.3.7: - version "7.5.3" - resolved "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz" - integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== - dependencies: - lru-cache "^6.0.0" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" - integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -tslib@^1.8.1: - version "1.14.1" - resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tsutils@^3.21.0: - version "3.21.0" - resolved "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz" - integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== - dependencies: - tslib "^1.8.1" - -type-check@^0.4.0, type-check@~0.4.0: - version "0.4.0" - resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz" - integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== - dependencies: - prelude-ls "^1.2.1" - -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - -typescript@^5.1.6, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta": - version "5.1.6" - resolved "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz" - integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/desktop-extensions/gnome-45/.eslintrc.cjs b/desktop-extensions/gnome-45/.eslintrc.cjs index 4b387c2f..28e18aed 100644 --- a/desktop-extensions/gnome-45/.eslintrc.cjs +++ b/desktop-extensions/gnome-45/.eslintrc.cjs @@ -1,25 +1,25 @@ /* eslint-env node */ module.exports = { - extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], - parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint"], - root: true, + extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], + parser: "@typescript-eslint/parser", + plugins: ["@typescript-eslint"], + root: true, - "rules": { + rules: { // enable additional rules - "indent": ["error", 4], - "linebreak-style": ["error", "unix"], - "quotes": ["error", "double"], - "semi": ["error", "always"], + indent: ["error", 4], + "linebreak-style": ["error", "unix"], + quotes: ["error", "double"], + semi: ["error", "always"], - // override configuration set by extending "eslint:recommended" - "no-empty": "warn", - "no-cond-assign": ["error", "always"], + // override configuration set by extending "eslint:recommended" + "no-empty": "warn", + "no-cond-assign": ["error", "always"], - // disable rules from base configurations - "for-direction": "off", + // disable rules from base configurations + "for-direction": "off", - "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/ban-ts-comment": "off" - } + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/ban-ts-comment": "off", + }, }; diff --git a/desktop-extensions/gnome-45/.prettierignore b/desktop-extensions/gnome-45/.prettierignore new file mode 100644 index 00000000..0da3ec75 --- /dev/null +++ b/desktop-extensions/gnome-45/.prettierignore @@ -0,0 +1,13 @@ +# Generated files +/@types/gir-generated/* + +# Build outputes +/dist/ +/build/ + +# Node configuration and modules +/package.json +/node_modules/ + +# Files I prefer not to be formatted +*.md \ No newline at end of file diff --git a/desktop-extensions/gnome-45/.prettierrc.json b/desktop-extensions/gnome-45/.prettierrc.json new file mode 100644 index 00000000..8fe08d18 --- /dev/null +++ b/desktop-extensions/gnome-45/.prettierrc.json @@ -0,0 +1,9 @@ +{ + "printWidth": 100, + "useTabs": false, + "semi": true, + "singleQuote": false, + "trailingComma": "all", + "bracketSpacing": true, + "arrowParens": "always" +} diff --git a/desktop-extensions/gnome-45/esbuild.js b/desktop-extensions/gnome-45/esbuild.js index 812c9659..ea0b8ae5 100644 --- a/desktop-extensions/gnome-45/esbuild.js +++ b/desktop-extensions/gnome-45/esbuild.js @@ -1,13 +1,14 @@ -const { build } = require("esbuild"); -const fs = require("fs"); -const path = require("path"); -var exec = require('child_process').exec; -const AdmZip = require("adm-zip"); -const metadata = require("./src/metadata.json"); +import { build } from "esbuild"; +import { exec } from "child_process"; +import { copyFileSync, cpSync } from "fs"; +import { resolve, dirname } from "path"; +import { fileURLToPath } from "url"; +import AdmZip from "adm-zip"; +import metadata from "./src/metadata.json" assert { type: "json" }; build({ - entryPoints: ['src/extension.ts'], - outdir: 'dist', + entryPoints: ["src/extension.ts"], + outdir: "dist", bundle: true, // Do not remove the functions `enable()`, `disable()` and `init()` treeShaking: false, @@ -17,49 +18,50 @@ build({ // firefox91 // Since GJS 1.71.1 // firefox102 // Since GJS 1.73.2 target: "firefox102", + //platform: "neutral", platform: "node", - // platform: "neutral", // mainFields: ['main'], // conditions: ['require', 'default'], - format: 'esm', - external: ['gi://*', 'resource:///*', 'system', 'gettext', 'cairo'], + format: "esm", + external: ["gi://*", "resource://*", "system", "gettext", "cairo"], }).then(() => { - const metaSrc = path.resolve(__dirname, "src/metadata.json"); - const metaDist = path.resolve(__dirname, "dist/metadata.json"); - const schemaSrc = path.resolve(__dirname, "schemas"); - const schemaDist = path.resolve(__dirname, "dist/schemas"); - const dbusXmlSrc = path.resolve(__dirname, "../../bindings/dbus-xml"); - const dbusXmlDist = path.resolve(__dirname, "dist/resources/dbus"); + const __filename = fileURLToPath(import.meta.url); + const __dirname = dirname(__filename); + + const metaSrc = resolve(__dirname, "src/metadata.json"); + const metaDist = resolve(__dirname, "dist/metadata.json"); + const schemaSrc = resolve(__dirname, "schemas"); + const schemaDist = resolve(__dirname, "dist/schemas"); + const dbusXmlSrc = resolve(__dirname, "../../bindings/dbus-xml"); + const dbusXmlDist = resolve(__dirname, "dist/resources/dbus"); const zipFilename = `${metadata.uuid}.zip`; - const zipDist = path.resolve(__dirname, zipFilename); + const zipDist = resolve(__dirname, zipFilename); - exec('glib-compile-schemas schemas/', - (error, stdout, stderr) => { - console.log('stdout: ' + stdout); - console.log('stderr: ' + stderr); - }); + exec("glib-compile-schemas schemas/", (error, stdout, stderr) => { + console.log("stdout: " + stdout); + console.log("stderr: " + stderr); + }); - fs.copyFileSync(metaSrc, metaDist); + copyFileSync(metaSrc, metaDist); - fs.cpSync(schemaSrc, schemaDist, { recursive: true }, (err) => { + cpSync(schemaSrc, schemaDist, { recursive: true }, (err) => { if (err) { console.error(err); } }); - fs.cpSync(dbusXmlSrc, dbusXmlDist, { recursive: true }, (err) => { + cpSync(dbusXmlSrc, dbusXmlDist, { recursive: true }, (err) => { if (err) { console.error(err); } }); const zip = new AdmZip(); - zip.addLocalFolder(path.resolve(__dirname, "dist")); + zip.addLocalFolder(resolve(__dirname, "dist")); zip.writeZip(zipDist); console.log(`Build complete. Zip file: ${zipFilename}\n`); - console.log(`Install with: gnome-extensions install ${zipFilename}`) - console.log(`Update with: gnome-extensions install ${zipFilename} --force`) - console.log(`Enable with: gnome-extensions enable ${metadata.uuid} --user`) + console.log(`Install with: gnome-extensions install ${zipFilename}`); + console.log(`Update with: gnome-extensions install ${zipFilename} --force`); + console.log(`Enable with: gnome-extensions enable ${metadata.uuid} --user`); }); - diff --git a/desktop-extensions/gnome-45/package-lock.json b/desktop-extensions/gnome-45/package-lock.json index 08f82879..444653de 100644 --- a/desktop-extensions/gnome-45/package-lock.json +++ b/desktop-extensions/gnome-45/package-lock.json @@ -1,20 +1,29 @@ { "name": "asusctl-gnome", - "version": "4.7.0", + "version": "5.0.0-RC1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "asusctl-gnome", - "version": "4.7.0", + "version": "5.0.0-RC1", "license": "MPL-2", + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/st-13": "^13.0.0-3.2.5" + }, "devDependencies": { + "@girs/gnome-shell": "^45.0.0-beta2", "@typescript-eslint/eslint-plugin": "^5.60.1", "@typescript-eslint/parser": "^5.60.1", "adm-zip": "^0.5.10", - "esbuild": "^0.17.19", - "eslint": "^8.44.0", - "typescript": "^5.1.6" + "esbuild": "^0.19.5", + "eslint": "^8.51.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-promise": "^6.1.1", + "prettier": "^3.0.3", + "typescript": "^5.2.2" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -27,9 +36,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", - "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.6.tgz", + "integrity": "sha512-muPzBqXJKCbMYoNbb1JpZh/ynl0xS6/+pLjrofcR3Nad82SbsCogYzUE6Aq9QT3cLP0jR/IVK/NHC9b90mSHtg==", "cpu": [ "arm" ], @@ -43,9 +52,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", - "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.6.tgz", + "integrity": "sha512-KQ/hbe9SJvIJ4sR+2PcZ41IBV+LPJyYp6V1K1P1xcMRup9iYsBoQn4MzE3mhMLOld27Au2eDcLlIREeKGUXpHQ==", "cpu": [ "arm64" ], @@ -59,9 +68,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", - "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.6.tgz", + "integrity": "sha512-VVJVZQ7p5BBOKoNxd0Ly3xUM78Y4DyOoFKdkdAe2m11jbh0LEU4bPles4e/72EMl4tapko8o915UalN/5zhspg==", "cpu": [ "x64" ], @@ -75,9 +84,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", - "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.6.tgz", + "integrity": "sha512-91LoRp/uZAKx6ESNspL3I46ypwzdqyDLXZH7x2QYCLgtnaU08+AXEbabY2yExIz03/am0DivsTtbdxzGejfXpA==", "cpu": [ "arm64" ], @@ -91,9 +100,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", - "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.6.tgz", + "integrity": "sha512-QCGHw770ubjBU1J3ZkFJh671MFajGTYMZumPs9E/rqU52md6lIil97BR0CbPq6U+vTh3xnTNDHKRdR8ggHnmxQ==", "cpu": [ "x64" ], @@ -107,9 +116,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", - "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.6.tgz", + "integrity": "sha512-J53d0jGsDcLzWk9d9SPmlyF+wzVxjXpOH7jVW5ae7PvrDst4kiAz6sX+E8btz0GB6oH12zC+aHRD945jdjF2Vg==", "cpu": [ "arm64" ], @@ -123,9 +132,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", - "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.6.tgz", + "integrity": "sha512-hn9qvkjHSIB5Z9JgCCjED6YYVGCNpqB7dEGavBdG6EjBD8S/UcNUIlGcB35NCkMETkdYwfZSvD9VoDJX6VeUVA==", "cpu": [ "x64" ], @@ -139,9 +148,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", - "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.6.tgz", + "integrity": "sha512-G8IR5zFgpXad/Zp7gr7ZyTKyqZuThU6z1JjmRyN1vSF8j0bOlGzUwFSMTbctLAdd7QHpeyu0cRiuKrqK1ZTwvQ==", "cpu": [ "arm" ], @@ -155,9 +164,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", - "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.6.tgz", + "integrity": "sha512-HQCOrk9XlH3KngASLaBfHpcoYEGUt829A9MyxaI8RMkfRA8SakG6YQEITAuwmtzFdEu5GU4eyhKcpv27dFaOBg==", "cpu": [ "arm64" ], @@ -171,9 +180,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", - "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.6.tgz", + "integrity": "sha512-22eOR08zL/OXkmEhxOfshfOGo8P69k8oKHkwkDrUlcB12S/sw/+COM4PhAPT0cAYW/gpqY2uXp3TpjQVJitz7w==", "cpu": [ "ia32" ], @@ -187,9 +196,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", - "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.6.tgz", + "integrity": "sha512-82RvaYAh/SUJyjWA8jDpyZCHQjmEggL//sC7F3VKYcBMumQjUL3C5WDl/tJpEiKtt7XrWmgjaLkrk205zfvwTA==", "cpu": [ "loong64" ], @@ -203,9 +212,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", - "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.6.tgz", + "integrity": "sha512-8tvnwyYJpR618vboIv2l8tK2SuK/RqUIGMfMENkeDGo3hsEIrpGldMGYFcWxWeEILe5Fi72zoXLmhZ7PR23oQA==", "cpu": [ "mips64el" ], @@ -219,9 +228,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", - "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.6.tgz", + "integrity": "sha512-Qt+D7xiPajxVNk5tQiEJwhmarNnLPdjXAoA5uWMpbfStZB0+YU6a3CtbWYSy+sgAsnyx4IGZjWsTzBzrvg/fMA==", "cpu": [ "ppc64" ], @@ -235,9 +244,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", - "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.6.tgz", + "integrity": "sha512-lxRdk0iJ9CWYDH1Wpnnnc640ajF4RmQ+w6oHFZmAIYu577meE9Ka/DCtpOrwr9McMY11ocbp4jirgGgCi7Ls/g==", "cpu": [ "riscv64" ], @@ -251,9 +260,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", - "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.6.tgz", + "integrity": "sha512-MopyYV39vnfuykHanRWHGRcRC3AwU7b0QY4TI8ISLfAGfK+tMkXyFuyT1epw/lM0pflQlS53JoD22yN83DHZgA==", "cpu": [ "s390x" ], @@ -267,9 +276,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", - "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.6.tgz", + "integrity": "sha512-UWcieaBzsN8WYbzFF5Jq7QULETPcQvlX7KL4xWGIB54OknXJjBO37sPqk7N82WU13JGWvmDzFBi1weVBajPovg==", "cpu": [ "x64" ], @@ -283,9 +292,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", - "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.6.tgz", + "integrity": "sha512-EpWiLX0fzvZn1wxtLxZrEW+oQED9Pwpnh+w4Ffv8ZLuMhUoqR9q9rL4+qHW8F4Mg5oQEKxAoT0G+8JYNqCiR6g==", "cpu": [ "x64" ], @@ -299,9 +308,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", - "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.6.tgz", + "integrity": "sha512-fFqTVEktM1PGs2sLKH4M5mhAVEzGpeZJuasAMRnvDZNCV0Cjvm1Hu35moL2vC0DOrAQjNTvj4zWrol/lwQ8Deg==", "cpu": [ "x64" ], @@ -315,9 +324,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", - "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.6.tgz", + "integrity": "sha512-M+XIAnBpaNvaVAhbe3uBXtgWyWynSdlww/JNZws0FlMPSBy+EpatPXNIlKAdtbFVII9OpX91ZfMb17TU3JKTBA==", "cpu": [ "x64" ], @@ -331,9 +340,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", - "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.6.tgz", + "integrity": "sha512-2DchFXn7vp/B6Tc2eKdTsLzE0ygqKkNUhUBCNtMx2Llk4POIVMUq5rUYjdcedFlGLeRe1uLCpVvCmE+G8XYybA==", "cpu": [ "arm64" ], @@ -347,9 +356,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", - "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.6.tgz", + "integrity": "sha512-PBo/HPDQllyWdjwAVX+Gl2hH0dfBydL97BAH/grHKC8fubqp02aL4S63otZ25q3sBdINtOBbz1qTZQfXbP4VBg==", "cpu": [ "ia32" ], @@ -363,9 +372,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", - "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.6.tgz", + "integrity": "sha512-OE7yIdbDif2kKfrGa+V0vx/B3FJv2L4KnIiLlvtibPyO9UkgO3rzYE0HhpREo2vmJ1Ixq1zwm9/0er+3VOSZJA==", "cpu": [ "x64" ], @@ -394,18 +403,18 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.7.0.tgz", - "integrity": "sha512-+HencqxU7CFJnQb7IKtuNBqS6Yx3Tz4kOL8BJXo+JyeiBm5MEX6pO8onXDkjrkCRlfYXS1Axro15ZjVFe9YgsA==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", - "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz", + "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -426,21 +435,703 @@ } }, "node_modules/@eslint/js": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", - "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", + "version": "8.54.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.54.0.tgz", + "integrity": "sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", + "node_modules/@girs/accountsservice-1.0": { + "version": "1.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/accountsservice-1.0/-/accountsservice-1.0-1.0.0-3.2.5.tgz", + "integrity": "sha512-1uSGJqw0tA0gMCiyOgscF/IBoI/eZt9ZbCakqSDKaQlUa8nauS0UnuItwt8SPj/AW5p2472ZMT3yBR7iKWaM7g==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/adw-1": { + "version": "1.4.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/adw-1/-/adw-1-1.4.0-3.2.5.tgz", + "integrity": "sha512-NSH5IXCFsLO9UGAcGL2+3uGB2zab/BswCbNZv+MUan1d3VNEZac/S3qv+eGRzbi/9LgEzHVP4Zv+B4fvNn3cWg==", + "dev": true, + "dependencies": { + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gdk-4.0": "^4.0.0-3.2.5", + "@girs/gdkpixbuf-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gmodule-2.0": "^2.0.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/graphene-1.0": "^1.0.0-3.2.5", + "@girs/gsk-4.0": "^4.0.0-3.2.5", + "@girs/gtk-4.0": "^4.12.3-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5", + "@girs/pango-1.0": "^1.51.0-3.2.5", + "@girs/pangocairo-1.0": "^1.0.0-3.2.5" + } + }, + "node_modules/@girs/atk-1.0": { + "version": "2.50.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/atk-1.0/-/atk-1.0-2.50.0-3.2.5.tgz", + "integrity": "sha512-L4ZP7+ChICTYNLPQo6ok3kgZFVV0lrpRSA3KRTgz1Xzosby7ATxN4lSp+FY62IPutR494xp7t76lzaetJOoA8A==", + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/cairo-1.0": { + "version": "1.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/cairo-1.0/-/cairo-1.0-1.0.0-3.2.5.tgz", + "integrity": "sha512-KUaNKNNgwh8MKqc/tzDQfW3DbXug4jPZtmnbazHfN1q34eBpOrtG5UaK7m3XKOeoFo1KbbKsPQHJyCAs7ZFIUQ==", + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/cally-13": { + "version": "13.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/cally-13/-/cally-13-13.0.0-3.2.5.tgz", + "integrity": "sha512-HTJrtk5e2wKzzlC/RowZmf14xIQ+EcX0L9ry68cM4zdlLYFC60HEZ0Wfu4yNElMCUvkc7HbrgXwCm0HVDvoaZA==", + "dependencies": { + "@girs/atk-1.0": "^2.50.0-3.2.5", + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/clutter-13": "^13.0.0-3.2.5", + "@girs/cogl-13": "^13.0.0-3.2.5", + "@girs/coglpango-13": "^13.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/gl-1.0": "^1.0.0-3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/graphene-1.0": "^1.0.0-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5", + "@girs/json-1.0": "^1.7.1-3.2.5", + "@girs/mtk-13": "^13.0.0-3.2.5", + "@girs/pango-1.0": "^1.51.0-3.2.5", + "@girs/pangocairo-1.0": "^1.0.0-3.2.5" + } + }, + "node_modules/@girs/clutter-13": { + "version": "13.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/clutter-13/-/clutter-13-13.0.0-3.2.5.tgz", + "integrity": "sha512-srWebm2+2HHeLUErBJ0z4zZT297mfh6uF4yUCgW/VEGU6nRDGzl+Me0gc+7a47oT8F0OLjqWAj1cxac8h/M0ew==", + "dependencies": { + "@girs/atk-1.0": "^2.50.0-3.2.5", + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/cogl-13": "^13.0.0-3.2.5", + "@girs/coglpango-13": "^13.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/gl-1.0": "^1.0.0-3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/graphene-1.0": "^1.0.0-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5", + "@girs/json-1.0": "^1.7.1-3.2.5", + "@girs/mtk-13": "^13.0.0-3.2.5", + "@girs/pango-1.0": "^1.51.0-3.2.5", + "@girs/pangocairo-1.0": "^1.0.0-3.2.5" + } + }, + "node_modules/@girs/cogl-13": { + "version": "13.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/cogl-13/-/cogl-13-13.0.0-3.2.5.tgz", + "integrity": "sha512-UWwe3RIuDSITuPt+EIWPl5V2TyUICSvLi3cd0BpbY2fRqi7xOKh1hqANHVCtSntbXN1Jm99ZPjdFz5j1f9+5xA==", + "dependencies": { + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/gl-1.0": "^1.0.0-3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/graphene-1.0": "^1.0.0-3.2.5" + } + }, + "node_modules/@girs/cogl-2.0": { + "version": "2.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/cogl-2.0/-/cogl-2.0-2.0.0-3.2.5.tgz", + "integrity": "sha512-R/M0AltgQqp0RKfe93RQTe/36wCpn9/Ff4qoLC/QGn9+6WUSvL276Rf27qo+cHDN0FIRX4TlR7A/zLdFoi1t+Q==", + "dev": true, + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/gl-1.0": "^1.0.0-3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/coglpango-13": { + "version": "13.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/coglpango-13/-/coglpango-13-13.0.0-3.2.5.tgz", + "integrity": "sha512-1U2Le2ULjDB6JY4BvfR7PyuXxvsMfiwHYCwNVgYDspHEGDofZzZgEAkNCs4m0uSVkvZtGwV/JdcOVxRdNmfZYA==", + "dependencies": { + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/cogl-13": "^13.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/gl-1.0": "^1.0.0-3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/graphene-1.0": "^1.0.0-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5", + "@girs/pango-1.0": "^1.51.0-3.2.5", + "@girs/pangocairo-1.0": "^1.0.0-3.2.5" + } + }, + "node_modules/@girs/freetype2-2.0": { + "version": "2.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/freetype2-2.0/-/freetype2-2.0-2.0.0-3.2.5.tgz", + "integrity": "sha512-JKcGqMYevEVybaT8RvK8UOnFhJCTNNFadpLhh9oPvkbc2NwORvCU5s/VmRyDFNgIKacoxhZK2ho9p+51VuSL+Q==", + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/gck-2": { + "version": "4.1.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gck-2/-/gck-2-4.1.0-3.2.5.tgz", + "integrity": "sha512-jDIsr0rN/6Y0pyqmaRonIr8c6aDU8a2I5o38kTVnzaRw4AkKW5iauj+gwlpWuOeBcpirWe8mz3BoXGqydUCIsA==", + "dev": true, + "dependencies": { + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/gcr-4": { + "version": "4.1.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gcr-4/-/gcr-4-4.1.0-3.2.5.tgz", + "integrity": "sha512-o9zQbLnFBIXn6fUp6AzpUrA5iVPf1waUQdCPxUqCgsIGztBNl868pRoGwlxxWlVEp73IrqJ/o7MST42rfPfr1A==", + "dev": true, + "dependencies": { + "@girs/gck-2": "^4.1.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/gdesktopenums-3.0": { + "version": "3.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gdesktopenums-3.0/-/gdesktopenums-3.0-3.0.0-3.2.5.tgz", + "integrity": "sha512-TrLalzuRXL4R+kIhY9TN5NPFWX22wr+UXUNGC4UCwNBykhs5kJ3iOUPLLWQkPGNjjDK6OyCo5iyT/8fnMqK+Ew==", + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/gdk-4.0": { + "version": "4.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gdk-4.0/-/gdk-4.0-4.0.0-3.2.5.tgz", + "integrity": "sha512-e/a/+6n729KVliT8IHWPANlKJAL3CP/gRP+fpT/1iOun3BzjPbix6aEd31OTPhfeRIE+gpFiDoO/nItS79/BKw==", + "dev": true, + "dependencies": { + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gdkpixbuf-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gmodule-2.0": "^2.0.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5", + "@girs/pango-1.0": "^1.51.0-3.2.5", + "@girs/pangocairo-1.0": "^1.0.0-3.2.5" + } + }, + "node_modules/@girs/gdkpixbuf-2.0": { + "version": "2.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gdkpixbuf-2.0/-/gdkpixbuf-2.0-2.0.0-3.2.5.tgz", + "integrity": "sha512-PvyxWzkZMsy/jQyqou7v/13/eZiYwLEIq5TgSO6LI4j5gDzEFbDErap9ELlaYoUW/PnsWWIgRVp5u4b+W2cnMA==", + "dependencies": { + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gmodule-2.0": "^2.0.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/gdm-1.0": { + "version": "1.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gdm-1.0/-/gdm-1.0-1.0.0-3.2.5.tgz", + "integrity": "sha512-xfJvdUuh9Hnxj2dDhrVSf0EHSZJ8vm9Gg6g5Pz/OTA8KmOVvaDWJ4HxWmP7bbBCuBognfejO30N1y69U8QP6tA==", + "dev": true, + "dependencies": { + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/gio-2.0": { + "version": "2.78.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gio-2.0/-/gio-2.0-2.78.0-3.2.5.tgz", + "integrity": "sha512-8QVn6rydZuevkkLbLTrURs9bHD8vbvfFZMzR/5iPsTrv6d5wCewUmMxiKEcMicnJmOIhBitu1ZboP8sljht90Q==", + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/gjs": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gjs/-/gjs-3.2.5.tgz", + "integrity": "sha512-ndrJQnRmkw6SicVQSwm9IMy7dDPd6kPu19Hp2DFlQWsICG4wKailzRkzsxI064j9uLWQOjO3ydHiiDRpAjwU1Q==", + "dependencies": { + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/gl-1.0": { + "version": "1.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gl-1.0/-/gl-1.0-1.0.0-3.2.5.tgz", + "integrity": "sha512-waBA2GbqHXGOLlufRTrKJDC44D1OERbCsXYzCGNI/G51RJTOrENBBY8/DO7hPVavHnOgGVnw2WVtNLx7CgcVpQ==", + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/glib-2.0": { + "version": "2.78.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/glib-2.0/-/glib-2.0-2.78.0-3.2.5.tgz", + "integrity": "sha512-VIfgmRPixvxh9i2FPE0ctvWgHMuzWkXjERtG4G8uxnBdH7HAL6+hcEFFYyn1JrkBm4XFVvikyUZYPPoahlDsaQ==", + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/gmodule-2.0": { + "version": "2.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gmodule-2.0/-/gmodule-2.0-2.0.0-3.2.5.tgz", + "integrity": "sha512-oSjlOXzEYlrtYOAyTW57bRigRjpwqV0faeou+iSGj7n1/T/ZxJsPK7rdwAv/7vVB8nev4JT9z3YZyqocHzjIFA==", + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/gnome-shell": { + "version": "45.0.0-beta2", + "resolved": "https://registry.npmjs.org/@girs/gnome-shell/-/gnome-shell-45.0.0-beta2.tgz", + "integrity": "sha512-rSO9p/+9dW+cTBTqfgfJgBsLXwOg1gd5MGvBFqHoQWNKXCTDiZ/G5RHget8EmQSnhr8XMSwEjXC/bGBVSD+H3w==", + "dev": true, + "dependencies": { + "@girs/accountsservice-1.0": "^1.0.0-3.2.5", + "@girs/adw-1": "^1.4.0-3.2.5", + "@girs/atk-1.0": "^2.50.0-3.2.5", + "@girs/cally-13": "^13.0.0-3.2.5", + "@girs/clutter-13": "^13.0.0-3.2.5", + "@girs/cogl-2.0": "^2.0.0-3.2.5", + "@girs/gcr-4": "^4.1.0-3.2.5", + "@girs/gdm-1.0": "^1.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gnomebg-4.0": "^4.0.0-3.2.5", + "@girs/gnomebluetooth-3.0": "^3.0.0-3.2.5", + "@girs/gnomedesktop-4.0": "^4.0.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/gvc-1.0": "^1.0.0-3.2.5", + "@girs/meta-13": "^13.0.0-3.2.5", + "@girs/polkit-1.0": "^1.0.0-3.2.5", + "@girs/shell-13": "^13.0.0-3.2.5", + "@girs/shew-0": "^0.0.0-3.2.5", + "@girs/st-13": "^13.0.0-3.2.5", + "@girs/upowerglib-1.0": "^0.99.1-3.2.5" + } + }, + "node_modules/@girs/gnomebg-4.0": { + "version": "4.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gnomebg-4.0/-/gnomebg-4.0-4.0.0-3.2.5.tgz", + "integrity": "sha512-tuNXWRo2WaYqv9sfCIoMym7j57yj1GwREdap3kKMvnJ53SBTltF5hAu73qRfzFTRbPvWGrVs2QNjqxi6zmzGEQ==", + "dev": true, + "dependencies": { + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gdesktopenums-3.0": "^3.0.0-3.2.5", + "@girs/gdk-4.0": "^4.0.0-3.2.5", + "@girs/gdkpixbuf-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gmodule-2.0": "^2.0.0-3.2.5", + "@girs/gnomedesktop-4.0": "^4.0.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5", + "@girs/pango-1.0": "^1.51.0-3.2.5", + "@girs/pangocairo-1.0": "^1.0.0-3.2.5" + } + }, + "node_modules/@girs/gnomebluetooth-3.0": { + "version": "3.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gnomebluetooth-3.0/-/gnomebluetooth-3.0-3.0.0-3.2.5.tgz", + "integrity": "sha512-tWLrAY+l5Zwp2JBEGluuWd8u+DfuriHRSxtjBzmtqneRnK4Vp8Mb4EvyWnMTAHbKqxMUGg06fkZ3oCWVf2Cebw==", + "dev": true, + "dependencies": { + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/gnomedesktop-4.0": { + "version": "4.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gnomedesktop-4.0/-/gnomedesktop-4.0-4.0.0-3.2.5.tgz", + "integrity": "sha512-JSsZ4r0VEoidAyYz8Y7afVZvTtxZyqNpmdSVf4Fi5cx5Ip/c+524zYVQN0G/FRVxw+uHlP/AsjYm6cVoUQTpHg==", + "dev": true, + "dependencies": { + "@girs/gdesktopenums-3.0": "^3.0.0-3.2.5", + "@girs/gdkpixbuf-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gmodule-2.0": "^2.0.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/gobject-2.0": { + "version": "2.78.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gobject-2.0/-/gobject-2.0-2.78.0-3.2.5.tgz", + "integrity": "sha512-xjplH7Slij+l2/QFO9MYLoe+lHtHsQvZVIccGVOdZtaVMqL6wq3J2JH9ul6czf5EFnApuhN2pXFeE77Jacwduw==", + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/graphene-1.0": { + "version": "1.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/graphene-1.0/-/graphene-1.0-1.0.0-3.2.5.tgz", + "integrity": "sha512-QI+HSiPeueAWk/A3Q7OasVFk/Iv3bLyrEuL50VE3LIiPlEOUAAwmfWaMk/gJlK8bs+Loc/f6fJPe231QV0Vijg==", + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/gsk-4.0": { + "version": "4.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gsk-4.0/-/gsk-4.0-4.0.0-3.2.5.tgz", + "integrity": "sha512-RdupAGlahhVGGQljxiW1ST5a0Ntc1CevDvLOuYGK2YarOC7qh5Wb7Y5D4fCXiEesxgum+DUY2kY8zHj4DHdqvQ==", + "dev": true, + "dependencies": { + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gdk-4.0": "^4.0.0-3.2.5", + "@girs/gdkpixbuf-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gmodule-2.0": "^2.0.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/graphene-1.0": "^1.0.0-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5", + "@girs/pango-1.0": "^1.51.0-3.2.5", + "@girs/pangocairo-1.0": "^1.0.0-3.2.5" + } + }, + "node_modules/@girs/gtk-4.0": { + "version": "4.12.3-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gtk-4.0/-/gtk-4.0-4.12.3-3.2.5.tgz", + "integrity": "sha512-Dkmcjty0hMuqHU2nlrIR0jKLjClgFRfxuZmsjEUIQjfEopogZpVah6YXPlS5ss9E3WnBOT19AfXj+Lj2+211wg==", + "dev": true, + "dependencies": { + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gdk-4.0": "^4.0.0-3.2.5", + "@girs/gdkpixbuf-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gmodule-2.0": "^2.0.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/graphene-1.0": "^1.0.0-3.2.5", + "@girs/gsk-4.0": "^4.0.0-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5", + "@girs/pango-1.0": "^1.51.0-3.2.5", + "@girs/pangocairo-1.0": "^1.0.0-3.2.5" + } + }, + "node_modules/@girs/gvc-1.0": { + "version": "1.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/gvc-1.0/-/gvc-1.0-1.0.0-3.2.5.tgz", + "integrity": "sha512-z+Q3NvKMc0V0HMa/JixSe0A6HP7g3Y7jihBoUWwRXQp5wuOgs9/WTVtCoLIp97osEFnvzS+yI/o+lDprQZFEnQ==", + "dev": true, + "dependencies": { + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/harfbuzz-0.0": { + "version": "8.2.1-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/harfbuzz-0.0/-/harfbuzz-0.0-8.2.1-3.2.5.tgz", + "integrity": "sha512-ybs7S1xPNZfZHAuu2uaS68Alarbod3aXpbj4WxrYJlsz9JCFO6xD1U29e9oAkglOcJmWi4DtF1AnzspuTu2iEw==", + "dependencies": { + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/json-1.0": { + "version": "1.7.1-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/json-1.0/-/json-1.0-1.7.1-3.2.5.tgz", + "integrity": "sha512-m7TxILvgcpSzKyMwFBJaRYpULvPuvu9kUxfl0cSnOV6J1zB+kCKkTto4Yg65u11RSbQ1e2WLUokHhzmcYHW5XQ==", + "dependencies": { + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/meta-13": { + "version": "13.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/meta-13/-/meta-13-13.0.0-3.2.5.tgz", + "integrity": "sha512-oaNnbPnwFD/6c4h4XjIgOypT80YqOWVALoTs0vGIC6JeVsmTPcKI4n2SBoqnomd3/QcAhLYj4jZYlUPeFUHyGw==", + "dependencies": { + "@girs/atk-1.0": "^2.50.0-3.2.5", + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/clutter-13": "^13.0.0-3.2.5", + "@girs/cogl-13": "^13.0.0-3.2.5", + "@girs/coglpango-13": "^13.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gdesktopenums-3.0": "^3.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/gl-1.0": "^1.0.0-3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/graphene-1.0": "^1.0.0-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5", + "@girs/json-1.0": "^1.7.1-3.2.5", + "@girs/mtk-13": "^13.0.0-3.2.5", + "@girs/pango-1.0": "^1.51.0-3.2.5", + "@girs/pangocairo-1.0": "^1.0.0-3.2.5", + "@girs/xfixes-4.0": "^4.0.0-3.2.5", + "@girs/xlib-2.0": "^2.0.0-3.2.5" + } + }, + "node_modules/@girs/mtk-13": { + "version": "13.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/mtk-13/-/mtk-13-13.0.0-3.2.5.tgz", + "integrity": "sha512-6iadZ1tjlTZ5BWBgH4jIujg/8ev0Oi9jcLRqhzPCIpuK5H0DWFJ7AAKMfy+97li5Ws/6SRX+kFgb9DsvQ0CFOQ==", + "dependencies": { + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/graphene-1.0": "^1.0.0-3.2.5" + } + }, + "node_modules/@girs/nm-1.0": { + "version": "1.45.1-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/nm-1.0/-/nm-1.0-1.45.1-3.2.5.tgz", + "integrity": "sha512-zJFOLfJpzJF5SAXOgGXN4diiwl/Z5e0Oo0INiUkg038nnq95N9eHBVbiqM+Q4l/YmcHw65rxPOr7hpPC9dSJwA==", + "dev": true, + "dependencies": { + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/pango-1.0": { + "version": "1.51.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/pango-1.0/-/pango-1.0-1.51.0-3.2.5.tgz", + "integrity": "sha512-ovr00FAEpbEhtsFb+dmZKgKcCrhNyAL26ypgaW+LswUQ7u6v5Qw1xQhWJSbQwEWxJ/ta48PyB/rrCVmNcHnDLg==", + "dependencies": { + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5" + } + }, + "node_modules/@girs/pangocairo-1.0": { + "version": "1.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/pangocairo-1.0/-/pangocairo-1.0-1.0.0-3.2.5.tgz", + "integrity": "sha512-bnzn8dbK5DVxtJdpL29oJ3UrlhABJ+8zazHudPHQrwuF6OOu3e37XFW6WCDucxHLQvvy9HTzNqm4xTYg4hAqbw==", + "dependencies": { + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5", + "@girs/pango-1.0": "^1.51.0-3.2.5" + } + }, + "node_modules/@girs/polkit-1.0": { + "version": "1.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/polkit-1.0/-/polkit-1.0-1.0.0-3.2.5.tgz", + "integrity": "sha512-sxn1dFyfcpbCYXRoSol9K9hgO5b13wpkxvY73Tmh4HxFVq1GA/V+w9nV05h6xDyAKlc6MsvqLpUCbDAsrkSbfA==", + "dev": true, + "dependencies": { + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/polkitagent-1.0": { + "version": "1.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/polkitagent-1.0/-/polkitagent-1.0-1.0.0-3.2.5.tgz", + "integrity": "sha512-0R/3qtM+l9DgVgyA4PxB77ohS28kcu5WrYLqdnJaZZVPxaDwnntwo+Tdpun3oH4gOtFtVuj9qJ0LthU88gyPww==", + "dev": true, + "dependencies": { + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/polkit-1.0": "^1.0.0-3.2.5" + } + }, + "node_modules/@girs/shell-13": { + "version": "13.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/shell-13/-/shell-13-13.0.0-3.2.5.tgz", + "integrity": "sha512-yuGmkpPG2gy0937D1xggslyg6kcwIFDUfYHLjQNcqLneXjrgyHUYQGRv90GDvdoD5Jl25YT36hb5Yt/cZFch4A==", + "dev": true, + "dependencies": { + "@girs/atk-1.0": "^2.50.0-3.2.5", + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/cally-13": "^13.0.0-3.2.5", + "@girs/clutter-13": "^13.0.0-3.2.5", + "@girs/cogl-13": "^13.0.0-3.2.5", + "@girs/coglpango-13": "^13.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gck-2": "^4.1.0-3.2.5", + "@girs/gcr-4": "^4.1.0-3.2.5", + "@girs/gdesktopenums-3.0": "^3.0.0-3.2.5", + "@girs/gdkpixbuf-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/gl-1.0": "^1.0.0-3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gmodule-2.0": "^2.0.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/graphene-1.0": "^1.0.0-3.2.5", + "@girs/gvc-1.0": "^1.0.0-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5", + "@girs/json-1.0": "^1.7.1-3.2.5", + "@girs/meta-13": "^13.0.0-3.2.5", + "@girs/mtk-13": "^13.0.0-3.2.5", + "@girs/nm-1.0": "^1.45.1-3.2.5", + "@girs/pango-1.0": "^1.51.0-3.2.5", + "@girs/pangocairo-1.0": "^1.0.0-3.2.5", + "@girs/polkit-1.0": "^1.0.0-3.2.5", + "@girs/polkitagent-1.0": "^1.0.0-3.2.5", + "@girs/st-13": "^13.0.0-3.2.5", + "@girs/xfixes-4.0": "^4.0.0-3.2.5", + "@girs/xlib-2.0": "^2.0.0-3.2.5" + } + }, + "node_modules/@girs/shew-0": { + "version": "0.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/shew-0/-/shew-0-0.0.0-3.2.5.tgz", + "integrity": "sha512-mfuD/PaZaUEvoxm/psn02J039AfgiukAy0LbTUQKIJPSTxkzNJoBgdb+RsQVWnLFha4rXgKRBDCD9T/qR20CGQ==", + "dev": true, + "dependencies": { + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gdk-4.0": "^4.0.0-3.2.5", + "@girs/gdkpixbuf-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gmodule-2.0": "^2.0.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/graphene-1.0": "^1.0.0-3.2.5", + "@girs/gsk-4.0": "^4.0.0-3.2.5", + "@girs/gtk-4.0": "^4.12.3-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5", + "@girs/pango-1.0": "^1.51.0-3.2.5", + "@girs/pangocairo-1.0": "^1.0.0-3.2.5" + } + }, + "node_modules/@girs/st-13": { + "version": "13.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/st-13/-/st-13-13.0.0-3.2.5.tgz", + "integrity": "sha512-cMG4VBbuPEP0auKkOfFiCcmRpbgpSn4/Z+IvP5m5f7XI1YX1gPYKZl8cEyIEW57+O/lh4mpkDL+AVvepIKFyww==", + "dependencies": { + "@girs/atk-1.0": "^2.50.0-3.2.5", + "@girs/cairo-1.0": "^1.0.0-3.2.5", + "@girs/cally-13": "^13.0.0-3.2.5", + "@girs/clutter-13": "^13.0.0-3.2.5", + "@girs/cogl-13": "^13.0.0-3.2.5", + "@girs/coglpango-13": "^13.0.0-3.2.5", + "@girs/freetype2-2.0": "^2.0.0-3.2.5", + "@girs/gdesktopenums-3.0": "^3.0.0-3.2.5", + "@girs/gdkpixbuf-2.0": "^2.0.0-3.2.5", + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/gl-1.0": "^1.0.0-3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gmodule-2.0": "^2.0.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/graphene-1.0": "^1.0.0-3.2.5", + "@girs/harfbuzz-0.0": "^8.2.1-3.2.5", + "@girs/json-1.0": "^1.7.1-3.2.5", + "@girs/meta-13": "^13.0.0-3.2.5", + "@girs/mtk-13": "^13.0.0-3.2.5", + "@girs/pango-1.0": "^1.51.0-3.2.5", + "@girs/pangocairo-1.0": "^1.0.0-3.2.5", + "@girs/xfixes-4.0": "^4.0.0-3.2.5", + "@girs/xlib-2.0": "^2.0.0-3.2.5" + } + }, + "node_modules/@girs/upowerglib-1.0": { + "version": "0.99.1-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/upowerglib-1.0/-/upowerglib-1.0-0.99.1-3.2.5.tgz", + "integrity": "sha512-jYSmmi5X5orddQVkpaS6RGDBi3k4bxrrducNiahnpaM6YdtIjET9BMcBRW+mDqLxZxPwGd0ThKM5eP6TX15CEA==", + "dev": true, + "dependencies": { + "@girs/gio-2.0": "^2.78.0-3.2.5", + "@girs/gjs": "^3.2.5", + "@girs/glib-2.0": "^2.78.0-3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/xfixes-4.0": { + "version": "4.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/xfixes-4.0/-/xfixes-4.0-4.0.0-3.2.5.tgz", + "integrity": "sha512-gUdBen1dAQTP+OfwS6/6swYp9+cuy3g0tZzAVzur48T62UB5prwnki/EBMYWbqaH1Hn+JGLTwKXHvGkdmTPxCQ==", + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@girs/xlib-2.0": { + "version": "2.0.0-3.2.5", + "resolved": "https://registry.npmjs.org/@girs/xlib-2.0/-/xlib-2.0-2.0.0-3.2.5.tgz", + "integrity": "sha512-nTfP70qGiVV+g13hxe7s923VSCNRLIbhetJQO0z8uSuvHXKGpQFVW/R4GcePNjizbVWu7FSArzF2vPkvfp8UsA==", + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", + "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.1", "debug": "^4.1.1", "minimatch": "^3.0.5" }, @@ -462,9 +1153,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", + "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", "dev": true }, "node_modules/@nodelib/fs.scandir": { @@ -503,15 +1194,15 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.12", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", - "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.5.tgz", + "integrity": "sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -702,10 +1393,16 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", + "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -926,9 +1623,9 @@ } }, "node_modules/esbuild": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", - "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", + "version": "0.19.6", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.6.tgz", + "integrity": "sha512-Xl7dntjA2OEIvpr9j0DVxxnog2fyTGnyVoQXAMQI6eR3mf9zCQds7VIKUDCotDgE/p4ncTgeRqgX8t5d6oP4Gw==", "dev": true, "hasInstallScript": true, "bin": { @@ -938,28 +1635,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.17.19", - "@esbuild/android-arm64": "0.17.19", - "@esbuild/android-x64": "0.17.19", - "@esbuild/darwin-arm64": "0.17.19", - "@esbuild/darwin-x64": "0.17.19", - "@esbuild/freebsd-arm64": "0.17.19", - "@esbuild/freebsd-x64": "0.17.19", - "@esbuild/linux-arm": "0.17.19", - "@esbuild/linux-arm64": "0.17.19", - "@esbuild/linux-ia32": "0.17.19", - "@esbuild/linux-loong64": "0.17.19", - "@esbuild/linux-mips64el": "0.17.19", - "@esbuild/linux-ppc64": "0.17.19", - "@esbuild/linux-riscv64": "0.17.19", - "@esbuild/linux-s390x": "0.17.19", - "@esbuild/linux-x64": "0.17.19", - "@esbuild/netbsd-x64": "0.17.19", - "@esbuild/openbsd-x64": "0.17.19", - "@esbuild/sunos-x64": "0.17.19", - "@esbuild/win32-arm64": "0.17.19", - "@esbuild/win32-ia32": "0.17.19", - "@esbuild/win32-x64": "0.17.19" + "@esbuild/android-arm": "0.19.6", + "@esbuild/android-arm64": "0.19.6", + "@esbuild/android-x64": "0.19.6", + "@esbuild/darwin-arm64": "0.19.6", + "@esbuild/darwin-x64": "0.19.6", + "@esbuild/freebsd-arm64": "0.19.6", + "@esbuild/freebsd-x64": "0.19.6", + "@esbuild/linux-arm": "0.19.6", + "@esbuild/linux-arm64": "0.19.6", + "@esbuild/linux-ia32": "0.19.6", + "@esbuild/linux-loong64": "0.19.6", + "@esbuild/linux-mips64el": "0.19.6", + "@esbuild/linux-ppc64": "0.19.6", + "@esbuild/linux-riscv64": "0.19.6", + "@esbuild/linux-s390x": "0.19.6", + "@esbuild/linux-x64": "0.19.6", + "@esbuild/netbsd-x64": "0.19.6", + "@esbuild/openbsd-x64": "0.19.6", + "@esbuild/sunos-x64": "0.19.6", + "@esbuild/win32-arm64": "0.19.6", + "@esbuild/win32-ia32": "0.19.6", + "@esbuild/win32-x64": "0.19.6" } }, "node_modules/escape-string-regexp": { @@ -975,18 +1672,19 @@ } }, "node_modules/eslint": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", - "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", + "version": "8.54.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz", + "integrity": "sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "^8.47.0", - "@humanwhocodes/config-array": "^0.11.10", + "@eslint/eslintrc": "^2.1.3", + "@eslint/js": "8.54.0", + "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -1028,6 +1726,30 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-prettier": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-promise": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", + "integrity": "sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -1162,9 +1884,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -1251,12 +1973,13 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, "dependencies": { - "flatted": "^3.1.0", + "flatted": "^3.2.9", + "keyv": "^4.5.3", "rimraf": "^3.0.2" }, "engines": { @@ -1264,9 +1987,9 @@ } }, "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", "dev": true }, "node_modules/fs.realpath": { @@ -1308,9 +2031,9 @@ } }, "node_modules/globals": { - "version": "13.21.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", - "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -1358,9 +2081,9 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", + "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", "dev": true, "engines": { "node": ">= 4" @@ -1464,6 +2187,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -1476,6 +2205,15 @@ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -1699,10 +2437,25 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", + "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "engines": { "node": ">=6" @@ -1930,9 +2683,9 @@ } }, "node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", + "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/desktop-extensions/gnome-45/package.json b/desktop-extensions/gnome-45/package.json index cdb76f60..7b60ecee 100644 --- a/desktop-extensions/gnome-45/package.json +++ b/desktop-extensions/gnome-45/package.json @@ -1,21 +1,36 @@ { "name": "asusctl-gnome", - "version": "4.7.0", + "version": "5.0.0-RC1", "description": "asusctl-gnome a gnome extension exposing some of the base features of asusd in a helpful and easy to use way", + "type": "module", "main": "dist/extension.js", "scripts": { "clear": "rm -rf dist", + "compile": "tsc --build tsconfig.json", "build:app": "node esbuild.js", "build": "yarn run clear && yarn run build:app", - "validate": "tsc --noEmit" + "validate": "tsc --noEmit", + "generate:gir-types": "ts-for-gir generate", + "check:types": "tsc --build tsconfig.types.json", + "lint": "eslint .", + "format": "prettier . -w" }, "devDependencies": { + "@girs/gnome-shell": "^45.0.0-beta2", "@typescript-eslint/eslint-plugin": "^5.60.1", "@typescript-eslint/parser": "^5.60.1", "adm-zip": "^0.5.10", - "esbuild": "^0.17.19", - "eslint": "^8.44.0", - "typescript": "^5.1.6" + "esbuild": "^0.19.5", + "eslint": "^8.51.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-promise": "^6.1.1", + "prettier": "^3.0.3", + "typescript": "^5.2.2" + }, + "dependencies": { + "@girs/gjs": "^3.2.5", + "@girs/gobject-2.0": "^2.78.0-3.2.5", + "@girs/st-13": "^13.0.0-3.2.5" }, "repository": { "type": "git", diff --git a/desktop-extensions/gnome-45/schemas/org.gnome.shell.extensions.asusctl-gnome.gschema.xml b/desktop-extensions/gnome-45/schemas/org.gnome.shell.extensions.asusctl-gnome.gschema.xml index a531874b..c33adee1 100644 --- a/desktop-extensions/gnome-45/schemas/org.gnome.shell.extensions.asusctl-gnome.gschema.xml +++ b/desktop-extensions/gnome-45/schemas/org.gnome.shell.extensions.asusctl-gnome.gschema.xml @@ -10,6 +10,9 @@ false + + false + 100 diff --git a/desktop-extensions/gnome-45/src/extension.ts b/desktop-extensions/gnome-45/src/extension.ts index 751cafff..25f9077a 100644 --- a/desktop-extensions/gnome-45/src/extension.ts +++ b/desktop-extensions/gnome-45/src/extension.ts @@ -1,117 +1,127 @@ -import {Extension, gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js'; - -import { AnimeDbus } from "./modules/dbus/animatrix"; -import { Power } from "./modules/dbus/power"; -import { Supported } from "./modules/dbus/supported"; -import { Platform } from "./modules/dbus/platform"; - -import { QuickPanelOd } from "./modules/quick_toggles/panel_od"; -import { IndicateMiniLed } from "./modules/indicators/mini_led"; -import { QuickMiniLed } from "./modules/quick_toggles/mini_led"; -import { SliderChargeLevel } from "./modules/sliders/charge"; -import { QuickAnimePower } from "./modules/quick_toggles/anime_power"; +import { Extension, gettext as _ } from "@girs/gnome-shell/extensions/extension"; +import * as platform from "./bindings/platform"; +import { AsusQuickToggle } from "./modules/rog_quick_toggle"; +import { AsusMenuToggle } from "./modules/rog_menu_toggle"; +import { AsusIndicator } from "./modules/rog_indicator"; +import { AsusSlider } from "./modules/rog_slider_100pc"; import { FeatureMenuToggle } from "./modules/quick_menus/laptop_features"; -import { AuraDbus } from "./modules/dbus/aura"; -import { AuraMenuToggle } from "./modules/quick_menus/aura"; - -export var extension; +import { DbusBase } from "./modules/dbus_proxy"; +import { main } from "@girs/gnome-shell/ui"; +export const uuid = "asusctl-gnome@asus-linux.org"; export default class AsusExtension extends Extension { - private _indicateMiniLed: typeof IndicateMiniLed; - private _quickMiniLed: typeof QuickMiniLed; - private _quickPanelOd: typeof QuickPanelOd; - private _quickAnimePower: typeof QuickAnimePower; - private _featureMenuToggle: typeof FeatureMenuToggle; - private _auraModeMenuToggle: typeof AuraMenuToggle; - private _sliderCharge: typeof SliderChargeLevel; + // public dbus_aura: AuraDbus = new AuraDbus; + // public dbus_anime: AnimeDbus = new AnimeDbus; + public dbus_platform: DbusBase | undefined; + public dbus_anime: DbusBase | undefined; - public dbus_supported: Supported = new Supported; - public dbus_power: Power = new Power; - public dbus_aura: AuraDbus = new AuraDbus; - public dbus_anime: AnimeDbus = new AnimeDbus; - public dbus_platform: Platform = new Platform; - public extensionPath: any = null; + private individual = false; + public supported_properties!: platform.Properties; + public supported_interfaces: string[] = []; + private feature_menu = null; + private panel_od = null; + private mini_led = null; + private anime_display = null; + private anime_builtins = null; + private charge_thres = null; + // private _feature: typeof FeatureMenuToggle; - settings() { - return this._settings; + async enable() { + log(this.path); + + if (this.dbus_platform == undefined) { + this.dbus_platform = new DbusBase("org-asuslinux-platform-4.xml", "/org/asuslinux/Platform"); + await this.dbus_platform.start(); } - async enable() { - this._settings = this.getSettings(); - this.extensionPath = this.path; - extension = this; + if (this.dbus_anime == undefined) { + this.dbus_anime = new DbusBase("org-asuslinux-anime-4.xml", "/org/asuslinux/Anime"); + await this.dbus_anime.start(); + } - this._indicateMiniLed = null; - this._quickMiniLed = null; - this._quickPanelOd = null; - this._quickAnimePower = null; - this._sliderCharge = null; + this.supported_interfaces = this.dbus_platform?.proxy.SupportedInterfacesSync()[0]; + this.supported_properties = this.dbus_platform?.proxy.SupportedPropertiesSync()[0]; + log(this.supported_interfaces); + log(this.supported_properties); - await this.dbus_supported.start(); - await this.dbus_aura.start(); - await this.dbus_platform.start(); - await this.dbus_power.start(); - await this.dbus_anime.start(); + // new AsusIndicator("selection-mode-symbolic", "mini-led-enabled"); + // new AsusIndicator("selection-mode-symbolic", "panel-od-enabled"); - if (this._featureMenuToggle == null) { - this._featureMenuToggle = new FeatureMenuToggle(this.dbus_supported, this.dbus_platform, this.dbus_anime); + if (!this.individual) { + if (this.feature_menu == null) + this.feature_menu = new FeatureMenuToggle(this.dbus_platform, this.dbus_anime); + } else { + if (this.supported_properties.includes("PanelOd") && this.dbus_platform.proxy.PanelOd != null) + if (this.panel_od == null) { + this.panel_od = new AsusQuickToggle( + this.dbus_platform, + "PanelOd", + "panel-od-enabled", + "Panel Overdrive", + ); } - if (this._auraModeMenuToggle == null) { - this._auraModeMenuToggle = new AuraMenuToggle(this.dbus_aura); + + if (this.supported_properties.includes("MiniLed") && this.dbus_platform.proxy.MiniLed != null) + if (this.mini_led == null) { + this.mini_led = new AsusQuickToggle( + this.dbus_platform, + "MiniLed", + "mini-led-enabled", + "Mini-LED", + ); } - if (this.dbus_supported.supported.rog_bios_ctrl.mini_led_mode) { - // if (this._quickMiniLed == null) { - // this._quickMiniLed = new QuickMiniLed(this.dbus_platform); - // this.dbus_platform.notifyMiniLedSubscribers.push(this._quickMiniLed); - // } - if (this._indicateMiniLed == null) { - this._indicateMiniLed = new IndicateMiniLed(this.dbus_platform); - } + + if ( + this.supported_interfaces.includes("Anime") && + this.dbus_anime.proxy.EnableDisplay != null + ) + if (this.anime_display == null) { + this.anime_display = new AsusQuickToggle( + this.dbus_anime, + "EnableDisplay", + "anime-power", + "AniMe Display", + ); } - // if (this.dbus_supported.supported.rog_bios_ctrl.panel_overdrive) { - // if (this._quickPanelOd == null) { - // this._quickPanelOd = new QuickPanelOd(this.dbus_platform); - // this.dbus_platform.notifyPanelOdSubscribers.push(this._quickPanelOd); - // } - // } - // if (this.dbus_supported.supported.anime_ctrl) { - // if (this._quickAnimePower == null) { - // this._quickAnimePower = new QuickAnimePower(this._dbus_anime); - // } - // } - if (this.dbus_supported.supported.charge_ctrl.charge_level_set) { - if (this._sliderCharge == null) { - this._sliderCharge = new SliderChargeLevel(this.dbus_power); - } + + if ( + this.supported_interfaces.includes("Anime") && + this.dbus_anime.proxy.BuiltinsEnabled != null + ) + if (this.anime_builtins == null) { + this.anime_builtins = new AsusQuickToggle( + this.dbus_anime, + "BuiltinsEnabled", + "anime-builtins", + "Use builtins", + ); } } - disable() { - if (this._indicateMiniLed != null) { - this._indicateMiniLed.destroy(); - this._indicateMiniLed = null; - } - if (this._quickMiniLed != null) { - this._quickMiniLed.destroy(); - this._quickMiniLed = null; - } - if (this._quickPanelOd != null) { - this._quickPanelOd.destroy(); - this._quickPanelOd = null; - } - if (this._quickAnimePower != null) { - this._quickAnimePower.destroy(); - this._quickAnimePower = null; - } - if (this._sliderCharge != null) { - this._sliderCharge.destroy(); - this._sliderCharge = null; - } + if ( + this.supported_properties.includes("ChargeControlEndThreshold") && + this.dbus_platform.proxy.ChargeControlEndThreshold != null + ) + if (this.charge_thres == null) { + this.charge_thres = new AsusSlider( + this.dbus_platform, + "ChargeControlEndThreshold", + "charge-level", + "Charge Level", + ); + } + } - this.dbus_power.stop(); - this.dbus_platform.stop(); - // this.dbus_anime.stop(); - this.dbus_aura.stop(); - this.dbus_supported.stop(); - } -} \ No newline at end of file + disable() { + this.dbus_platform?.stop(); + this.dbus_anime?.stop(); + + this.feature_menu?.destroy(); + feature_menu?.destroy(); + panel_od?.destroy(); + mini_led?.destroy(); + anime_display?.destroy(); + anime_builtins?.destroy(); + charge_thres?.destroy(); + } +} diff --git a/desktop-extensions/gnome-45/src/modules/dbus/animatrix.ts b/desktop-extensions/gnome-45/src/modules/dbus/animatrix.ts index e9bdff4e..833c04fe 100644 --- a/desktop-extensions/gnome-45/src/modules/dbus/animatrix.ts +++ b/desktop-extensions/gnome-45/src/modules/dbus/animatrix.ts @@ -1,139 +1,98 @@ -import { DbusBase } from "./base"; -import { DeviceState, AnimBooting, Brightness, AnimAwake, AnimSleeping, AnimShutdown } from "../../bindings/anime"; +import { DbusBase } from "../dbus_proxy"; +import { + DeviceState, + AnimBooting, + Brightness, + AnimAwake, + AnimSleeping, + AnimShutdown, +} from "../../bindings/anime"; export class AnimeDbus extends DbusBase { - deviceState: DeviceState = { - display_enabled: false, - display_brightness: Brightness.Med, - builtin_anims_enabled: false, - builtin_anims: { - boot: AnimBooting.GlitchConstruction, - awake: AnimAwake.BinaryBannerScroll, - sleep: AnimSleeping.BannerSwipe, - shutdown: AnimShutdown.GlitchOut - }, - off_when_unplugged: false, - off_when_suspended: false, - off_when_lid_closed: false, - }; + deviceState: DeviceState = { + display_enabled: false, + display_brightness: Brightness.Med, + builtin_anims_enabled: false, + builtin_anims: { + boot: AnimBooting.GlitchConstruction, + awake: AnimAwake.BinaryBannerScroll, + sleep: AnimSleeping.BannerSwipe, + shutdown: AnimShutdown.GlitchOut, + }, + off_when_unplugged: false, + off_when_suspended: false, + off_when_lid_closed: false, + }; - // TODO: interface or something to enforce requirement of "sync()" method - public notifyAnimeStateSubscribers: any[] = []; + // TODO: interface or something to enforce requirement of "sync()" method + public notifyAnimeStateSubscribers: any[] = []; - constructor() { - super("org-asuslinux-anime-4", "/org/asuslinux/Anime"); + constructor() { + super("org-asuslinux-anime-4", "/org/asuslinux/Anime"); + } + + _parseData(data: any) { + if (data.length > 0) { + this.deviceState.display_enabled = data[0]; + this.deviceState.display_brightness = Brightness[data[1] as Brightness]; + this.deviceState.builtin_anims_enabled = data[2]; + this.deviceState.builtin_anims.boot = AnimBooting[data[3][0] as AnimBooting]; + this.deviceState.builtin_anims.awake = AnimAwake[data[3][1] as AnimAwake]; + this.deviceState.builtin_anims.sleep = AnimSleeping[data[3][2] as AnimSleeping]; + this.deviceState.builtin_anims.shutdown = AnimShutdown[data[3][3] as AnimShutdown]; + this.deviceState.off_when_unplugged = data[4]; + this.deviceState.off_when_suspended = data[5]; + this.deviceState.off_when_lid_closed = data[6]; } + } - public setEnableDisplay(state: boolean | null) { - if (this.isRunning()) { - try { - // if null, toggle the current state - state = (state == null ? !this.deviceState.display_enabled : state); + public getDeviceState() { + if (this.isRunning()) { + try { + // janky shit going on with DeviceStateSync + this._parseData(this.dbus_proxy.DeviceStateSync()); + //@ts-ignore + log("Anime Matrix: display_enabled: " + this.deviceState.display_enabled); + //@ts-ignore + log("Anime Matrix: display_brightness: " + this.deviceState.display_brightness); + //@ts-ignore + log("Anime Matrix: builtin_anims_enabled: " + this.deviceState.builtin_anims_enabled); + //@ts-ignore + log("Anime Matrix: builtin_anims: " + this.deviceState.builtin_anims); + //@ts-ignore + log("Anime Matrix: off_when_unplugged: " + this.deviceState.off_when_unplugged); + //@ts-ignore + log("Anime Matrix: off_when_suspended: " + this.deviceState.off_when_suspended); + //@ts-ignore + log("Anime Matrix: off_when_lid_closed: " + this.deviceState.off_when_lid_closed); + } catch (e) { + //@ts-ignore + log("Failed to fetch DeviceState!", e); + } + } + return this.deviceState; + } - if (this.deviceState.display_enabled !== state) { - this.deviceState.display_enabled = state; - } - return this.dbus_proxy.SetEnableDisplaySync(state); - } catch (e) { - //@ts-ignore - log("AniMe DBus set power failed!", e); - } + async start() { + await super.start(); + this.getDeviceState(); + + this.dbus_proxy.connectSignal( + "NotifyDeviceState", + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (proxy: any = null, name: string, data: string) => { + if (proxy) { + // idiot xml parsing mneans the get is not nested while this is + this._parseData(data[0]); + this.notifyAnimeStateSubscribers.forEach((sub) => { + sub.sync(); + }); } - } + }, + ); + } - public setPowersaveAnim(state: boolean | null) { - if (this.isRunning()) { - try { - // if null, toggle the current state - state = (state == null ? !this.deviceState.builtin_anims_enabled : state); - - if (this.deviceState.builtin_anims_enabled !== state) { - this.deviceState.builtin_anims_enabled = state; - } - return this.dbus_proxy.SetBuiltinsEnabledSync(state); - } catch (e) { - //@ts-ignore - log("AniMe DBus set builtins failed!", e); - } - } - } - - public setBrightness(brightness: Brightness) { - if (this.isRunning()) { - try { - if (this.deviceState.display_brightness !== brightness) { - this.deviceState.display_brightness = brightness; - } - return this.dbus_proxy.SetBrightnessSync(brightness); - } catch (e) { - //@ts-ignore - log("AniMe DBus set brightness failed!", e); - } - } - } - - _parseData(data: any) { - if (data.length > 0) { - this.deviceState.display_enabled = data[0]; - this.deviceState.display_brightness = Brightness[data[1] as Brightness]; - this.deviceState.builtin_anims_enabled = data[2]; - this.deviceState.builtin_anims.boot = AnimBooting[data[3][0] as AnimBooting]; - this.deviceState.builtin_anims.awake = AnimAwake[data[3][1] as AnimAwake]; - this.deviceState.builtin_anims.sleep = AnimSleeping[data[3][2] as AnimSleeping]; - this.deviceState.builtin_anims.shutdown = AnimShutdown[data[3][3] as AnimShutdown]; - this.deviceState.off_when_unplugged = data[4]; - this.deviceState.off_when_suspended = data[5]; - this.deviceState.off_when_lid_closed = data[6]; - } - } - - public getDeviceState() { - if (this.isRunning()) { - try { - // janky shit going on with DeviceStateSync - this._parseData(this.dbus_proxy.DeviceStateSync()); - //@ts-ignore - log("Anime Matrix: display_enabled: " + this.deviceState.display_enabled); - //@ts-ignore - log("Anime Matrix: display_brightness: " + this.deviceState.display_brightness); - //@ts-ignore - log("Anime Matrix: builtin_anims_enabled: " + this.deviceState.builtin_anims_enabled); - //@ts-ignore - log("Anime Matrix: builtin_anims: " + this.deviceState.builtin_anims); - //@ts-ignore - log("Anime Matrix: off_when_unplugged: " + this.deviceState.off_when_unplugged); - //@ts-ignore - log("Anime Matrix: off_when_suspended: " + this.deviceState.off_when_suspended); - //@ts-ignore - log("Anime Matrix: off_when_lid_closed: " + this.deviceState.off_when_lid_closed); - } catch (e) { - //@ts-ignore - log("Failed to fetch DeviceState!", e); - } - } - return this.deviceState; - } - - async start() { - await super.start(); - this.getDeviceState(); - - this.dbus_proxy.connectSignal( - "NotifyDeviceState", - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (proxy: any = null, name: string, data: string) => { - if (proxy) { - // idiot xml parsing mneans the get is not nested while this is - this._parseData(data[0]); - this.notifyAnimeStateSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - } - - async stop() { - await super.stop(); - } -} \ No newline at end of file + async stop() { + await super.stop(); + } +} diff --git a/desktop-extensions/gnome-45/src/modules/dbus/aura.ts b/desktop-extensions/gnome-45/src/modules/dbus/aura.ts index 5828cadb..c3bf0208 100644 --- a/desktop-extensions/gnome-45/src/modules/dbus/aura.ts +++ b/desktop-extensions/gnome-45/src/modules/dbus/aura.ts @@ -1,284 +1,300 @@ -import { AuraDevRog1, AuraDevTuf, AuraDevice, AuraEffect, AuraModeNum, AuraPower, AuraPowerDev, AuraZone, Direction, PowerZones, Speed } from "../../bindings/aura"; +import { + AuraDevRog1, + AuraDevTuf, + AuraDevice, + AuraEffect, + AuraModeNum, + AuraPower, + AuraPowerDev, + AuraZone, + Direction, + PowerZones, + Speed, +} from "../../bindings/aura"; import { DbusBase } from "./base"; export class AuraDbus extends DbusBase { - public device: AuraDevice = AuraDevice.Unknown; - public current_aura_mode: AuraModeNum = AuraModeNum.Static; - public aura_modes: Map = new Map; - public leds_powered: AuraPowerDev = { - tuf: [], - old_rog: [], - rog: { - keyboard: { - zone: PowerZones.Keyboard, - boot: false, - awake: false, - sleep: false, - shutdown: false - }, - logo: { - zone: PowerZones.Logo, - boot: false, - awake: false, - sleep: false, - shutdown: false - }, - lightbar: { - zone: PowerZones.Lightbar, - boot: false, - awake: false, - sleep: false, - shutdown: false - }, - lid: { - zone: PowerZones.Lid, - boot: false, - awake: false, - sleep: false, - shutdown: false - }, - rear_glow: { - zone: PowerZones.RearGlow, - boot: false, - awake: false, - sleep: false, - shutdown: false - }, - } + public device: AuraDevice = AuraDevice.Unknown; + public current_aura_mode: AuraModeNum = AuraModeNum.Static; + public aura_modes: Map = new Map(); + public leds_powered: AuraPowerDev = { + tuf: [], + old_rog: [], + rog: { + keyboard: { + zone: PowerZones.Keyboard, + boot: false, + awake: false, + sleep: false, + shutdown: false, + }, + logo: { + zone: PowerZones.Logo, + boot: false, + awake: false, + sleep: false, + shutdown: false, + }, + lightbar: { + zone: PowerZones.Lightbar, + boot: false, + awake: false, + sleep: false, + shutdown: false, + }, + lid: { + zone: PowerZones.Lid, + boot: false, + awake: false, + sleep: false, + shutdown: false, + }, + rear_glow: { + zone: PowerZones.RearGlow, + boot: false, + awake: false, + sleep: false, + shutdown: false, + }, + }, + }; + // TODO: interface or something to enforce requirement of "sync()" method + public notifyAuraModeSubscribers: any[] = []; + public notifyAuraPowerSubscribers: any[] = []; + + constructor() { + super("org-asuslinux-aura-4", "/org/asuslinux/Aura"); + } + + public getDevice() { + if (this.isRunning()) { + try { + this.device = AuraDevice[this.dbus_proxy.DeviceTypeSync() as AuraDevice]; + //@ts-ignore + log("LED device: " + this.device); + } catch (e) { + //@ts-ignore + log("Failed to fetch supported functionalities", e); + } + } + } + + _parsePowerStates(data: any[]) { + const power: AuraPowerDev = this.leds_powered; + + power.tuf = data[0].map((value: string) => { + return AuraDevTuf[value as AuraDevTuf]; + }); + power.old_rog = data[1].map((value: string) => { + return AuraDevRog1[value as AuraDevRog1]; + }); + power.rog = { + keyboard: { + zone: PowerZones[data[2][0][0] as PowerZones], + boot: data[2][0][1], + awake: data[2][0][2], + sleep: data[2][0][3], + shutdown: data[2][0][4], + }, + logo: { + zone: PowerZones[data[2][1][0] as PowerZones], + boot: data[2][1][1], + awake: data[2][1][2], + sleep: data[2][1][3], + shutdown: data[2][1][4], + }, + lightbar: { + zone: PowerZones[data[2][2][0] as PowerZones], + boot: data[2][2][1], + awake: data[2][2][2], + sleep: data[2][2][3], + shutdown: data[2][2][4], + }, + lid: { + zone: PowerZones[data[2][3][0] as PowerZones], + boot: data[2][3][1], + awake: data[2][3][2], + sleep: data[2][3][3], + shutdown: data[2][3][4], + }, + rear_glow: { + zone: PowerZones[data[2][4][0] as PowerZones], + boot: data[2][4][1], + awake: data[2][4][2], + sleep: data[2][4][3], + shutdown: data[2][4][4], + }, }; - // TODO: interface or something to enforce requirement of "sync()" method - public notifyAuraModeSubscribers: any[] = []; - public notifyAuraPowerSubscribers: any[] = []; - constructor() { - super("org-asuslinux-aura-4", "/org/asuslinux/Aura"); + return power; + } + + public getLedPower() { + if (this.isRunning()) { + try { + const data = this.dbus_proxy.LedPowerSync(); + this.leds_powered = this._parsePowerStates(data); + //@ts-ignore + log("LED power tuf: " + this.leds_powered.tuf); + //@ts-ignore + log("LED power x1866: " + this.leds_powered.old_rog); + //@ts-ignore + log("LED power x19b6: " + this.leds_powered.rog); + } catch (e) { + //@ts-ignore + log("Failed to fetch supported functionalities", e); + } } + } - public getDevice() { - if (this.isRunning()) { - try { - this.device = AuraDevice[this.dbus_proxy.DeviceTypeSync() as AuraDevice]; - //@ts-ignore - log("LED device: " + this.device); - } catch (e) { - //@ts-ignore - log("Failed to fetch supported functionalities", e); - } + public getLedMode() { + if (this.isRunning()) { + try { + this.current_aura_mode = AuraModeNum[this.dbus_proxy.LedModeSync() as AuraModeNum]; + //@ts-ignore + log("Current LED mode:", this.current_aura_mode); + } catch (e) { + //@ts-ignore + log("Failed to fetch supported functionalities", e); + } + } + } + + public setLedMode(mode: AuraEffect) { + if (this.isRunning()) { + try { + this.dbus_proxy.SetLedModeSync([ + mode.mode, + mode.zone, + [mode.colour1.r, mode.colour1.g, mode.colour1.b], + [mode.colour2.r, mode.colour2.g, mode.colour2.b], + mode.speed, + mode.direction, + ]); + } catch (e) { + //@ts-ignore + log("Failed to fetch supported functionalities", e); + } + } + } + + _parseAuraEffect(data: any[]) { + const aura: AuraEffect = { + mode: AuraModeNum[data[0] as AuraModeNum], + zone: AuraZone[data[1] as AuraZone], + colour1: { + r: parseInt(data[2][0]), + g: parseInt(data[2][1]), + b: parseInt(data[2][2]), + }, + colour2: { + r: parseInt(data[3][0]), + g: parseInt(data[3][1]), + b: parseInt(data[3][2]), + }, + speed: Speed[data[4] as Speed], + direction: Direction[data[5] as Direction], + }; + return aura; + } + + // Return a list of the available modes, and the current settings for each + public getLedModes() { + // {'Breathe': ('Breathe', 'None', (166, 0, 0), (0, 0, 0), 'Med', 'Right'), + // 'Comet': ('Comet', 'None', (166, 0, 0), (0, 0, 0), 'Med', 'Right'), + // 'Static': ('Static', 'None', (78, 0, 0), (0, 0, 0), 'Med', 'Right'), + // 'Strobe': ('Strobe', 'None', (166, 0, 0), (0, 0, 0), 'Med', 'Right')} + if (this.isRunning()) { + try { + const _data = this.dbus_proxy.LedModesSync(); + for (const key in _data[0]) { + const data = _data[0][key]; + const aura: AuraEffect = this._parseAuraEffect(data); + this.aura_modes.set(AuraModeNum[key as AuraModeNum], aura); } - } - _parsePowerStates(data: any[]) { - const power: AuraPowerDev = this.leds_powered; - - power.tuf = data[0].map((value: string) => { - return AuraDevTuf[value as AuraDevTuf]; - }); - power.old_rog = data[1].map((value: string) => { - return AuraDevRog1[value as AuraDevRog1]; - }); - power.rog = { - keyboard: { - zone: PowerZones[data[2][0][0] as PowerZones], - boot: data[2][0][1], - awake: data[2][0][2], - sleep: data[2][0][3], - shutdown: data[2][0][4] - }, - logo: { - zone: PowerZones[data[2][1][0] as PowerZones], - boot: data[2][1][1], - awake: data[2][1][2], - sleep: data[2][1][3], - shutdown: data[2][1][4] - }, - lightbar: { - zone: PowerZones[data[2][2][0] as PowerZones], - boot: data[2][2][1], - awake: data[2][2][2], - sleep: data[2][2][3], - shutdown: data[2][2][4] - }, - lid: { - zone: PowerZones[data[2][3][0] as PowerZones], - boot: data[2][3][1], - awake: data[2][3][2], - sleep: data[2][3][3], - shutdown: data[2][3][4] - }, - rear_glow: { - zone: PowerZones[data[2][4][0] as PowerZones], - boot: data[2][4][1], - awake: data[2][4][2], - sleep: data[2][4][3], - shutdown: data[2][4][4] - } - }; - - return power; - } - - public getLedPower() { - if (this.isRunning()) { - try { - const data = this.dbus_proxy.LedPowerSync(); - this.leds_powered = this._parsePowerStates(data); - //@ts-ignore - log("LED power tuf: " + this.leds_powered.tuf); - //@ts-ignore - log("LED power x1866: " + this.leds_powered.old_rog); - //@ts-ignore - log("LED power x19b6: " + this.leds_powered.rog); - } catch (e) { - //@ts-ignore - log("Failed to fetch supported functionalities", e); - } + for (const [key, value] of this.aura_modes) { + //@ts-ignore + log(key, value.zone, value.colour1.r, value.speed, value.direction); } + } catch (e) { + //@ts-ignore + log("Failed to fetch supported functionalities", e); + } } + } - public getLedMode() { - if (this.isRunning()) { - try { - this.current_aura_mode = AuraModeNum[this.dbus_proxy.LedModeSync() as AuraModeNum]; - //@ts-ignore - log("Current LED mode:", this.current_aura_mode); - } catch (e) { - //@ts-ignore - log("Failed to fetch supported functionalities", e); - } + async start() { + try { + await super.start(); + this.getDevice(); + this.getLedPower(); + this.getLedMode(); + this.getLedModes(); + + //@ts-ignore + log("Current LED mode data:", this.aura_modes.get(this.current_aura_mode)?.speed); + + this.dbus_proxy.connectSignal("NotifyLed", (proxy: any = null, name: string, data: any) => { + if (proxy) { + const aura: AuraEffect = this._parseAuraEffect(data[0]); + this.current_aura_mode = aura.mode; + this.aura_modes.set(aura.mode, aura); + //@ts-ignore + log( + "LED data has changed to ", + aura.mode, + aura.zone, + aura.colour1.r, + aura.speed, + aura.direction, + ); + this.notifyAuraModeSubscribers.forEach((sub) => { + sub.sync(); + }); } - } + }); - public setLedMode(mode: AuraEffect) { - if (this.isRunning()) { - try { - this.dbus_proxy.SetLedModeSync([ - mode.mode, - mode.zone, - [mode.colour1.r, mode.colour1.g, mode.colour1.b], - [mode.colour2.r, mode.colour2.g, mode.colour2.b], - mode.speed, - mode.direction]); - } catch (e) { + this.dbus_proxy.connectSignal( + "NotifyPowerStates", + (proxy: any = null, name: string, data: any) => { + if (proxy) { + const power: AuraPowerDev = this._parsePowerStates(data[0]); + this.leds_powered = power; + switch (this.device) { + case AuraDevice.Tuf: //@ts-ignore - log("Failed to fetch supported functionalities", e); - } - } - } - - _parseAuraEffect(data: any[]) { - const aura: AuraEffect = { - mode: AuraModeNum[data[0] as AuraModeNum], - zone: AuraZone[data[1] as AuraZone], - colour1: { - r: parseInt(data[2][0]), - g: parseInt(data[2][1]), - b: parseInt(data[2][2]), - }, - colour2: { - r: parseInt(data[3][0]), - g: parseInt(data[3][1]), - b: parseInt(data[3][2]), - }, - speed: Speed[data[4] as Speed], - direction: Direction[data[5] as Direction], - }; - return aura; - } - - // Return a list of the available modes, and the current settings for each - public getLedModes() { - // {'Breathe': ('Breathe', 'None', (166, 0, 0), (0, 0, 0), 'Med', 'Right'), - // 'Comet': ('Comet', 'None', (166, 0, 0), (0, 0, 0), 'Med', 'Right'), - // 'Static': ('Static', 'None', (78, 0, 0), (0, 0, 0), 'Med', 'Right'), - // 'Strobe': ('Strobe', 'None', (166, 0, 0), (0, 0, 0), 'Med', 'Right')} - if (this.isRunning()) { - try { - const _data = this.dbus_proxy.LedModesSync(); - for (const key in _data[0]) { - const data = _data[0][key]; - const aura: AuraEffect = this._parseAuraEffect(data); - this.aura_modes.set(AuraModeNum[key as AuraModeNum], aura); - } - - for (const [key, value] of this.aura_modes) { - //@ts-ignore - log(key, value.zone, value.colour1.r, value.speed, value.direction); - } - - } catch (e) { + log("LED power has changed to ", this.leds_powered.tuf); + break; + case AuraDevice.X1854: + case AuraDevice.X1869: + case AuraDevice.X18c6: //@ts-ignore - log("Failed to fetch supported functionalities", e); + log("LED power has changed to ", this.leds_powered.old_rog); + break; + case AuraDevice.X19b6: + case AuraDevice.X1a30: + //@ts-ignore + log("LED power has changed to ", this.leds_powered.rog); + break; + default: + break; } - } - } - - async start() { - try { - await super.start(); - this.getDevice(); - this.getLedPower(); - this.getLedMode(); - this.getLedModes(); - //@ts-ignore - log("Current LED mode data:", this.aura_modes.get(this.current_aura_mode)?.speed); - - this.dbus_proxy.connectSignal( - "NotifyLed", - (proxy: any = null, name: string, data: any) => { - if (proxy) { - const aura: AuraEffect = this._parseAuraEffect(data[0]); - this.current_aura_mode = aura.mode; - this.aura_modes.set(aura.mode, aura); - //@ts-ignore - log("LED data has changed to ", aura.mode, aura.zone, aura.colour1.r, aura.speed, aura.direction); - this.notifyAuraModeSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - - this.dbus_proxy.connectSignal( - "NotifyPowerStates", - (proxy: any = null, name: string, data: any) => { - if (proxy) { - const power: AuraPowerDev = this._parsePowerStates(data[0]); - this.leds_powered = power; - switch (this.device) { - case AuraDevice.Tuf: - //@ts-ignore - log("LED power has changed to ", this.leds_powered.tuf); - break; - case AuraDevice.X1854: - case AuraDevice.X1869: - case AuraDevice.X18c6: - //@ts-ignore - log("LED power has changed to ", this.leds_powered.old_rog); - break; - case AuraDevice.X19b6: - case AuraDevice.X1a30: - //@ts-ignore - log("LED power has changed to ", this.leds_powered.rog); - break; - default: - break; - } - //@ts-ignore - log("LED power has changed to ", this.leds_powered.rog); - this.notifyAuraPowerSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - } catch (e) { - //@ts-ignore - log("Supported DBus initialization failed!", e); - } + log("LED power has changed to ", this.leds_powered.rog); + this.notifyAuraPowerSubscribers.forEach((sub) => { + sub.sync(); + }); + } + }, + ); + } catch (e) { + //@ts-ignore + log("Supported DBus initialization failed!", e); } + } - async stop() { - await super.stop(); - } -} \ No newline at end of file + async stop() { + await super.stop(); + } +} diff --git a/desktop-extensions/gnome-45/src/modules/dbus/base.ts b/desktop-extensions/gnome-45/src/modules/dbus/base.ts deleted file mode 100644 index 62f53f2a..00000000 --- a/desktop-extensions/gnome-45/src/modules/dbus/base.ts +++ /dev/null @@ -1,49 +0,0 @@ -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; - } -} \ No newline at end of file diff --git a/desktop-extensions/gnome-45/src/modules/dbus/platform.ts b/desktop-extensions/gnome-45/src/modules/dbus/platform.ts deleted file mode 100644 index 1925ed01..00000000 --- a/desktop-extensions/gnome-45/src/modules/dbus/platform.ts +++ /dev/null @@ -1,202 +0,0 @@ -import * as bios from "../../bindings/platform"; -import { DbusBase } from "./base"; - -// TODO: add callbacks for notifications -export class Platform extends DbusBase { - bios: bios.RogBiosSupportedFunctions = { - post_sound: false, - gpu_mux: false, - panel_overdrive: false, - dgpu_disable: false, - egpu_enable: false, - mini_led_mode: false - }; - - // TODO: interface or something to enforce requirement of "sync()" method - public notifyPanelOdSubscribers: any[] = []; - public notifyPostBootSoundSubscribers: any[] = []; - public notifyMiniLedSubscribers: any[] = []; - public notifyGpuMuxSubscribers: any[] = []; - - constructor() { - super("org-asuslinux-platform-4", "/org/asuslinux/Platform"); - } - - public getPostBootSound() { - if (this.isRunning()) { - try { - this.bios.post_sound = this.dbus_proxy.PostBootSoundSync() == "true" ? true : false; - } catch (e) { - //@ts-ignore - log("Failed to get POST Boot Sound state!", e); - } - } - return this.bios.post_sound; - } - - public setPostBootSound(state: boolean) { - if (this.isRunning()) { - try { - if (state !== this.bios.post_sound) { - this.bios.post_sound = state; - } - return this.dbus_proxy.SetPostBootSoundSync(state); - } catch (e) { - //@ts-ignore - log("Platform DBus set Post Boot Sound failed!", e); - } - } - } - - public getGpuMuxMode() { - if (this.isRunning()) { - try { - this.bios.gpu_mux = this.dbus_proxy.GpuMuxModeSync() == "true" ? true : false; - } catch (e) { - //@ts-ignore - log("Failed to get MUX state!", e); - } - } - return this.bios.gpu_mux; - } - - public setGpuMuxMode(state: boolean) { - if (this.isRunning()) { - try { - if (!state !== this.bios.gpu_mux) { - this.bios.gpu_mux = !state; - } - return this.dbus_proxy.SetGpuMuxModeSync(!state); - } catch (e) { - //@ts-ignore - log("Switching the MUX failed!", e); - } - } - } - - public getPanelOd() { - if (this.isRunning()) { - try { - this.bios.panel_overdrive = this.dbus_proxy.PanelOdSync() == "true" ? true : false; - } catch (e) { - //@ts-ignore - log("Failed to get Overdrive state!", e); - } - } - return this.bios.panel_overdrive; - } - - public setPanelOd(state: boolean) { - if (this.isRunning()) { - try { - if (state !== this.bios.panel_overdrive) { - this.bios.panel_overdrive = state; - } - return this.dbus_proxy.SetPanelOdSync(state); - } catch (e) { - //@ts-ignore - log("Overdrive DBus set overdrive state failed!", e); - } - } - } - - public getMiniLedMode() { - if (this.isRunning()) { - try { - this.bios.mini_led_mode = this.dbus_proxy.MiniLedModeSync() == "true" ? true : false; - } catch (e) { - //@ts-ignore - log("Failed to get Overdrive state!", e); - } - } - return this.bios.mini_led_mode; - } - - public setMiniLedMode(state: boolean) { - if (this.isRunning()) { - try { - if (state !== this.bios.mini_led_mode) { - this.bios.mini_led_mode = state; - } - return this.dbus_proxy.SetMiniLedModeSync(state); - } catch (e) { - //@ts-ignore - log("setMiniLedMode failed!", e); - } - } - } - - async start() { - try { - await super.start(); - - this.getPostBootSound(); - this.dbus_proxy.connectSignal( - "NotifyPostBootSound", - (proxy: any = null, _name: string, data: boolean) => { - if (proxy) { - //@ts-ignore - log(`PostBootSound changed to ${data}`); - this.notifyPostBootSoundSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - - this.getPanelOd(); - this.dbus_proxy.connectSignal( - "NotifyPanelOd", - (proxy: any = null, _name: string, data: boolean) => { - if (proxy) { - //@ts-ignore - log(`NotifyPanelOd has changed to ${data}.`); - this.notifyPanelOdSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - - this.getMiniLedMode(); - this.dbus_proxy.connectSignal( - "NotifyMiniLedMode", - (proxy: any = null, _name: string, data: boolean) => { - if (proxy) { - //@ts-ignore - log(`MiniLedMode has changed to ${data}.`); - this.notifyMiniLedSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - - this.getGpuMuxMode(); - this.dbus_proxy.connectSignal( - "NotifyGpuMuxMode", - (proxy: any = null, _name: string, data: boolean) => { - if (proxy) { - //@ts-ignore - log(`MUX has changed to ${data}.`); - this.notifyGpuMuxSubscribers.forEach(sub => { - sub.sync(); - }); - } - } - ); - - } catch (e) { - //@ts-ignore - log("Platform DBus init failed!", e); - } - } - - async stop() { - await super.stop(); - this.bios.post_sound = false; - this.bios.panel_overdrive = false; - this.bios.mini_led_mode = false; - this.bios.gpu_mux = false; - } -} \ No newline at end of file diff --git a/desktop-extensions/gnome-45/src/modules/dbus/power.ts b/desktop-extensions/gnome-45/src/modules/dbus/power.ts deleted file mode 100644 index f40a04ca..00000000 --- a/desktop-extensions/gnome-45/src/modules/dbus/power.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { DbusBase } from "./base"; - -// function getMethods(obj: { [x: string]: { toString: () => string; }; }) { -// var result = []; -// for (var id in obj) { -// try { -// if (typeof(obj[id]) == "function") { -// result.push(id + ": " + obj[id].toString()); -// } -// } catch (err) { -// result.push(id + ": inaccessible"); -// } -// } -// return result; -// } - -export class Power extends DbusBase { - chargeLimit = 100; - mainsOnline = false; - - constructor() { - super("org-asuslinux-power-4", "/org/asuslinux/Power"); - } - - public getChargingLimit() { - if (this.isRunning()) { - try { - this.chargeLimit = this.dbus_proxy.ChargeControlEndThresholdSync(); - } catch (e) { - //@ts-ignore - log("Failed to fetch Charging Limit!", e); - } - } - return this.chargeLimit; - } - - public setChargingLimit(limit: number) { - if (this.isRunning()) { - try { - if (limit > 0 && this.chargeLimit !== limit) { - // update state - this.chargeLimit = limit; - } - return this.dbus_proxy.SetChargeControlEndThresholdSync(limit); - } catch (e) { - //@ts-ignore - log("Profile DBus set power profile failed!", e); - } - } - } - - public getMainsOnline() { - if (this.isRunning()) { - try { - this.mainsOnline = this.dbus_proxy.MainsOnlineSync(); - } catch (e) { - //@ts-ignore - log("Failed to fetch MainsLonline!", e); - } - } - return this.mainsOnline; - } - - async start() { - try { - await super.start(); - this.getChargingLimit(); - - this.dbus_proxy.connectSignal( - "NotifyChargeControlEndThreshold", - (proxy: any = null, name: string, data: string) => { - if (proxy) { - //@ts-ignore - log(`Charging Limit has changed to ${data}% (${name}).`); - this.chargeLimit = parseInt(data); - } - } - ); - - this.dbus_proxy.connectSignal( - "NotifyMainsOnline", - (proxy: any = null, name: string, data: string) => { - if (proxy) { - //@ts-ignore - log(`NotifyMainsOnline has changed to ${data}% (${name}).`); - this.mainsOnline = parseInt(data) == 1 ? true : false; - } - } - ); - } catch (e) { - //@ts-ignore - log("Charging Limit DBus initialization failed!", e); - } - } - - async stop() { - await super.stop(); - } -} \ No newline at end of file diff --git a/desktop-extensions/gnome-45/src/modules/dbus/supported.ts b/desktop-extensions/gnome-45/src/modules/dbus/supported.ts deleted file mode 100644 index 5a59a5e7..00000000 --- a/desktop-extensions/gnome-45/src/modules/dbus/supported.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { SupportedFunctions, AdvancedAura } from "../../bindings/platform"; -import { AuraDevice, AuraModeNum, AuraZone, PowerZones } from "../../bindings/aura"; -import { DbusBase } from "./base"; - -export class Supported extends DbusBase { - // False, - // (True,), - // (True, True), - // ('X19b6', - // True, - // ['Static', - // 'Breathe', - // 'Strobe', - // 'Rainbow', - // 'Star', - // 'Rain', - // 'Highlight', - // 'Laser', - // 'Ripple', - // 'Pulse', - // 'Comet', - // 'Flash'], - // [], - // 'PerKey', - // ['Keyboard', 'Lightbar', 'Logo', 'RearGlow']), - // (False, True, True, True, False, True) - - supported: SupportedFunctions = { - anime_ctrl: false, - charge_ctrl: { - charge_level_set: false - }, - platform_profile: { - platform_profile: false, - fan_curves: false - }, - keyboard_led: { - dev_id: AuraDevice.Unknown, - brightness: false, - basic_modes: [], - basic_zones: [], - advanced_type: AdvancedAura.None, - power_zones: [], - }, - rog_bios_ctrl: { - post_sound: false, - gpu_mux: false, - panel_overdrive: false, - dgpu_disable: false, - egpu_enable: false, - mini_led_mode: false - } - }; - - constructor() { - super("org-asuslinux-supported-4", "/org/asuslinux/Supported"); - } - - public getSupported() { - if (this.isRunning()) { - try { - const _data = this.dbus_proxy.SupportedFunctionsSync(); - this.supported.anime_ctrl = _data[0]; - this.supported.charge_ctrl.charge_level_set = _data[1]; - this.supported.platform_profile.platform_profile = _data[2][0]; - this.supported.platform_profile.fan_curves = _data[2][1]; - this.supported.keyboard_led.dev_id = AuraDevice[_data[3][0] as AuraDevice]; - this.supported.keyboard_led.brightness = _data[3][1]; - - this.supported.keyboard_led.basic_modes = _data[3][2].map(function (value: string) { - return AuraModeNum[value as AuraModeNum]; - }); - this.supported.keyboard_led.basic_zones = _data[3][3].map(function (value: string) { - return AuraZone[value as AuraZone]; - }); - this.supported.keyboard_led.advanced_type = AdvancedAura[_data[3][4] as AdvancedAura]; - this.supported.keyboard_led.power_zones = _data[3][5].map(function (value: string) { - return PowerZones[value as PowerZones]; - }); - - this.supported.rog_bios_ctrl.post_sound = _data[4][0]; - this.supported.rog_bios_ctrl.gpu_mux = _data[4][1]; - this.supported.rog_bios_ctrl.panel_overdrive = _data[4][2]; - this.supported.rog_bios_ctrl.dgpu_disable = _data[4][3]; - this.supported.rog_bios_ctrl.egpu_enable = _data[4][4]; - this.supported.rog_bios_ctrl.mini_led_mode = _data[4][5]; - } catch (e) { - //@ts-ignore - log("Failed to fetch supported functionalities", e); - } - } - } - - async start() { - try { - await super.start(); - this.getSupported(); - } catch (e) { - //@ts-ignore - log("Supported DBus initialization failed!", e); - } - } - - async stop() { - await super.stop(); - } -} \ No newline at end of file diff --git a/desktop-extensions/gnome-45/src/modules/dbus_proxy.ts b/desktop-extensions/gnome-45/src/modules/dbus_proxy.ts new file mode 100644 index 00000000..4a9fe43b --- /dev/null +++ b/desktop-extensions/gnome-45/src/modules/dbus_proxy.ts @@ -0,0 +1,64 @@ +import { Extension, gettext as _ } from "@girs/gnome-shell/extensions/extension"; +import { Gio } from "@girs/gio-2.0"; +import { GLib } from "@girs/glib-2.0"; +import { imports } from "@girs/gjs"; + +// Reads the contents of a file contained in the global resources archive. The data +// is returned as a string. +export function getStringResource(path: string | null) { + const data = Gio.resources_lookup_data(path, 0); + return new TextDecoder().decode(data.get_data()?.buffer); +} + +export class DbusBase { + proxy!: Gio.DBusProxy; + connected = false; + ifaceXml = ""; + dbus_path = ""; + + constructor(file_name: string, dbus_path: string) { + let extensionObject = Extension.lookupByUUID("asusctl-gnome@asus-linux.org"); + const path = extensionObject?.path + "/resources/dbus/" + file_name; + const [ok, data] = GLib.file_get_contents(path); + if (!ok) { + throw new Error("could not read interface file"); + } + this.ifaceXml = imports.byteArray.toString(data); + this.dbus_path = dbus_path; + } + + async start() { + //@ts-ignore + log(`Starting ${this.dbus_path} dbus module`); + try { + log(this.ifaceXml); + this.proxy = Gio.DBusProxy.makeProxyWrapper(this.ifaceXml)( + 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.proxy != undefined) { + this.proxy.run_dispose(); + this.proxy = undefined; + this.connected = false; + } + } + + isRunning(): boolean { + return this.connected; + } +} diff --git a/desktop-extensions/gnome-45/src/modules/helpers.ts b/desktop-extensions/gnome-45/src/modules/helpers.ts index 338bed98..1ab79f8e 100644 --- a/desktop-extensions/gnome-45/src/modules/helpers.ts +++ b/desktop-extensions/gnome-45/src/modules/helpers.ts @@ -1,12 +1,14 @@ -import * as Main from 'resource:///org/gnome/shell/ui/main.js'; -import { QuickToggle } from 'resource:///org/gnome/shell/ui/quickSettings.js'; +import * as Main from "resource:///org/gnome/shell/ui/main.js"; +import { QuickToggle } from "resource:///org/gnome/shell/ui/quickSettings.js"; export function addQuickSettingsItems(items: [typeof QuickToggle], width = 1) { - const QuickSettingsMenu = Main.panel.statusArea.quickSettings; - items.forEach(item => QuickSettingsMenu.menu.addItem(item, width)); - // Ensure the tile(s) are above the background apps menu - for (const item of items) { - QuickSettingsMenu.menu._grid.set_child_below_sibling(item, - QuickSettingsMenu._backgroundApps.quickSettingsItems[0]); - } -} \ No newline at end of file + const QuickSettingsMenu = Main.panel.statusArea.quickSettings; + items.forEach((item) => QuickSettingsMenu.menu.addItem(item, width)); + // Ensure the tile(s) are above the background apps menu + for (const item of items) { + QuickSettingsMenu.menu._grid.set_child_below_sibling( + item, + QuickSettingsMenu._backgroundApps.quickSettingsItems[0], + ); + } +} diff --git a/desktop-extensions/gnome-45/src/modules/indicators/gpu_status.ts b/desktop-extensions/gnome-45/src/modules/indicators/gpu_status.ts deleted file mode 100644 index 5c55be35..00000000 --- a/desktop-extensions/gnome-45/src/modules/indicators/gpu_status.ts +++ /dev/null @@ -1,22 +0,0 @@ -import GObject from 'gi://GObject'; -import {QuickSettingsMenu, SystemIndicator} from 'resource:///org/gnome/shell/ui/quickSettings.js'; - -export const IndicateGpuStatus = GObject.registerClass( - class IndicateGpuStatus extends SystemIndicator { - constructor() { - super(); - - // Create the icon for the indicator - this._indicator = this._addIndicator(); - this._indicator.icon_name = "selection-mode-symbolic"; - this._indicator.visible = true; - - this.sync(); - // Add the indicator to the panel and the toggle to the menu - QuickSettingsMenu._indicators.add_child(this); - } - - sync() { - // TODO: - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-45/src/modules/indicators/mini_led.ts b/desktop-extensions/gnome-45/src/modules/indicators/mini_led.ts deleted file mode 100644 index 91d90799..00000000 --- a/desktop-extensions/gnome-45/src/modules/indicators/mini_led.ts +++ /dev/null @@ -1,23 +0,0 @@ -import Gio from 'gi://Gio'; -import GObject from 'gi://GObject'; -import * as AsusExtension from '../../extension'; -import {QuickSettingsMenu, SystemIndicator} from 'resource:///org/gnome/shell/ui/quickSettings.js'; - -export const IndicateMiniLed = GObject.registerClass( - class IndicateMiniLed extends SystemIndicator { - constructor() { - super(); - - // Create the icon for the indicator - this._indicator = this._addIndicator(); - this._indicator.icon_name = "selection-mode-symbolic"; - - // Showing the indicator when the feature is enabled - AsusExtension.extension._settings.bind("mini-led-enabled", - this._indicator, "visible", - Gio.SettingsBindFlags.DEFAULT); - - // Add the indicator to the panel and the toggle to the menu - QuickSettingsMenu._indicators.add_child(this); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-45/src/modules/menu_toggles/anime.ts b/desktop-extensions/gnome-45/src/modules/menu_toggles/anime.ts deleted file mode 100644 index ed312d99..00000000 --- a/desktop-extensions/gnome-45/src/modules/menu_toggles/anime.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { AnimeDbus } from "../dbus/animatrix"; - -import GObject from 'gi://GObject'; -import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; - -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.connectObject( - "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.connectObject( - "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); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-45/src/modules/menu_toggles/mini_led.ts b/desktop-extensions/gnome-45/src/modules/menu_toggles/mini_led.ts deleted file mode 100644 index 8148d9e0..00000000 --- a/desktop-extensions/gnome-45/src/modules/menu_toggles/mini_led.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Platform } from "../dbus/platform"; -import GObject from 'gi://GObject'; -import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; - -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.connectObject( - "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); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-45/src/modules/menu_toggles/panel_od.ts b/desktop-extensions/gnome-45/src/modules/menu_toggles/panel_od.ts deleted file mode 100644 index 807e8ee1..00000000 --- a/desktop-extensions/gnome-45/src/modules/menu_toggles/panel_od.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Platform } from "../dbus/platform"; - -import GObject from 'gi://GObject'; -import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; - -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.connectObject( - "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); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-45/src/modules/quick_menus/aura.ts b/desktop-extensions/gnome-45/src/modules/quick_menus/aura.ts index 19370385..eede0915 100644 --- a/desktop-extensions/gnome-45/src/modules/quick_menus/aura.ts +++ b/desktop-extensions/gnome-45/src/modules/quick_menus/aura.ts @@ -1,77 +1,85 @@ import { addQuickSettingsItems } from "../helpers"; import { AuraDbus } from "../dbus/aura"; import { AuraEffect, AuraModeNum } from "../../bindings/aura"; -import GObject from 'gi://GObject'; +import GObject from "gi://GObject"; -import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; -import * as QuickSettings from 'resource:///org/gnome/shell/ui/quickSettings.js'; +import * as PopupMenu from "resource:///org/gnome/shell/ui/popupMenu.js"; +import * as QuickSettings from "resource:///org/gnome/shell/ui/quickSettings.js"; export const AuraMenuToggle = GObject.registerClass( - class AuraMenuToggle extends QuickSettings.QuickMenuToggle { - private _dbus_aura: AuraDbus; - private _last_mode: AuraModeNum = AuraModeNum.Static; + class AuraMenuToggle extends QuickSettings.QuickMenuToggle { + private _dbus_aura: AuraDbus; + private _last_mode: AuraModeNum = AuraModeNum.Static; - constructor(dbus_aura: AuraDbus) { - super({ - title: "Aura Modes", - iconName: "selection-mode-symbolic", - toggleMode: true, - }); - this._dbus_aura = dbus_aura; + constructor(dbus_aura: AuraDbus) { + super({ + title: "Aura Modes", + iconName: "selection-mode-symbolic", + toggleMode: true, + }); + this._dbus_aura = dbus_aura; - this.connectObject( - this); + this.connectObject(this); - this.menu.setHeader("selection-mode-symbolic", this._dbus_aura.current_aura_mode); + this.menu.setHeader("selection-mode-symbolic", this._dbus_aura.current_aura_mode); - this._itemsSection = new PopupMenu.PopupMenuSection(); + this._itemsSection = new PopupMenu.PopupMenuSection(); - this._dbus_aura.aura_modes.forEach((mode, key) => { - this._itemsSection.addAction(key, () => { - this._dbus_aura.setLedMode(mode); - this.sync(); - }, ""); - }); - - this.menu.addMenuItem(this._itemsSection); - - // Add an entry-point for more settings - // this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - // const settingsItem = this.menu.addAction("More Settings", - // () => ExtensionUtils.openPrefs()); - // // Ensure the settings are unavailable when the screen is locked - // settingsItem.visible = Main.sessionMode.allowSettings; - // this.menu._settingsActions[Me.uuid] = settingsItem; - - this.connectObject( - "clicked", () => { - let mode: AuraEffect | undefined; - if (this._dbus_aura.current_aura_mode == AuraModeNum.Static) { - mode = this._dbus_aura.aura_modes.get(this._last_mode); - } else { - mode = this._dbus_aura.aura_modes.get(AuraModeNum.Static); - } - if (mode != undefined) { - this._dbus_aura.setLedMode(mode); - this.sync(); - } - }, - this); - - this._dbus_aura.notifyAuraModeSubscribers.push(this); + this._dbus_aura.aura_modes.forEach((mode, key) => { + this._itemsSection.addAction( + key, + () => { + this._dbus_aura.setLedMode(mode); this.sync(); + }, + "", + ); + }); - addQuickSettingsItems([this]); - } + this.menu.addMenuItem(this._itemsSection); - sync() { - const checked = this._dbus_aura.current_aura_mode != AuraModeNum.Static; - this.title = this._dbus_aura.current_aura_mode; - if (this._last_mode != this._dbus_aura.current_aura_mode && this._dbus_aura.current_aura_mode != AuraModeNum.Static) { - this._last_mode = this._dbus_aura.current_aura_mode; - } + // Add an entry-point for more settings + // this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); + // const settingsItem = this.menu.addAction("More Settings", + // () => ExtensionUtils.openPrefs()); + // // Ensure the settings are unavailable when the screen is locked + // settingsItem.visible = Main.sessionMode.allowSettings; + // this.menu._settingsActions[Me.uuid] = settingsItem; - if (this.checked !== checked) - this.set({ checked }); - } - }); + this.connectObject( + "clicked", + () => { + let mode: AuraEffect | undefined; + if (this._dbus_aura.current_aura_mode == AuraModeNum.Static) { + mode = this._dbus_aura.aura_modes.get(this._last_mode); + } else { + mode = this._dbus_aura.aura_modes.get(AuraModeNum.Static); + } + if (mode != undefined) { + this._dbus_aura.setLedMode(mode); + this.sync(); + } + }, + this, + ); + + this._dbus_aura.notifyAuraModeSubscribers.push(this); + this.sync(); + + addQuickSettingsItems([this]); + } + + sync() { + const checked = this._dbus_aura.current_aura_mode != AuraModeNum.Static; + this.title = this._dbus_aura.current_aura_mode; + if ( + this._last_mode != this._dbus_aura.current_aura_mode && + this._dbus_aura.current_aura_mode != AuraModeNum.Static + ) { + this._last_mode = this._dbus_aura.current_aura_mode; + } + + if (this.checked !== checked) this.set({ checked }); + } + }, +); diff --git a/desktop-extensions/gnome-45/src/modules/quick_menus/laptop_features.ts b/desktop-extensions/gnome-45/src/modules/quick_menus/laptop_features.ts index 159e3a98..c39bb2a4 100644 --- a/desktop-extensions/gnome-45/src/modules/quick_menus/laptop_features.ts +++ b/desktop-extensions/gnome-45/src/modules/quick_menus/laptop_features.ts @@ -1,169 +1,216 @@ -import { AnimeDbus } from "../dbus/animatrix"; -import { Supported } from "../dbus/supported"; -import { Platform } from "../dbus/platform"; +import { Extension, gettext as _ } from "@girs/gnome-shell/extensions/extension"; +import { quickSettings, popupMenu } from "@girs/gnome-shell/ui"; +import { GObject } from "@girs/gobject-2.0"; + +import { DbusBase } from "../../modules/dbus_proxy"; import { addQuickSettingsItems } from "../helpers"; -import { MenuToggleAnimeBuiltins, MenuToggleAnimePower } from "../menu_toggles/anime"; -import { MenuTogglePanelOd } from "../menu_toggles/panel_od"; -import { MenuToggleMiniLed } from "../menu_toggles/mini_led"; - -import GObject from 'gi://GObject'; import * as AsusExtension from "../../extension"; -// import {PopupMenu, PopupMenuSection} from 'resource:///org/gnome/shell/ui/popupMenu.js'; -import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; -import {QuickMenuToggle} from 'resource:///org/gnome/shell/ui/quickSettings.js'; +import * as platform from "../../bindings/platform"; +import { uuid } from "../../extension"; +import { AsusMenuToggle } from "../rog_menu_toggle"; export const FeatureMenuToggle = GObject.registerClass( - class FeatureMenuToggle extends QuickMenuToggle { - private _dbus_supported: Supported; - private _dbus_platform: Platform; - private _dbus_anime: AnimeDbus; + class FeatureMenuToggle extends quickSettings.QuickMenuToggle { + private dbus_platform: DbusBase; + private dbus_anime: DbusBase; + private last_selection = "mini-led"; + private supported_properties!: platform.Properties; + private supported_interfaces: string[] = []; - public miniLed: typeof MenuToggleMiniLed; - public panelOd: typeof MenuTogglePanelOd; - public animeDisplayPower: typeof MenuToggleAnimePower; - public animePowersaveAnim: typeof MenuToggleAnimeBuiltins; - private primary = "mini-led"; + private miniLed?: typeof AsusMenuToggle; + private panelOd?: typeof AsusMenuToggle; + private animeDisplayPower?: typeof AsusMenuToggle; + private animePowersaveAnim?: typeof AsusMenuToggle; + _itemsSection: popupMenu.PopupMenuSection; - constructor(dbus_supported: Supported, dbus_platform: Platform, dbus_anime: AnimeDbus) { - super({ - title: "Laptop", - iconName: "selection-mode-symbolic", - toggleMode: true, - }); - this._dbus_supported = dbus_supported; - this._dbus_platform = dbus_platform; - this._dbus_anime = dbus_anime; + constructor(dbus_platform: DbusBase, dbus_anime: DbusBase) { + super({ + label: "Laptop", + toggle_mode: true, + icon_name: "selection-mode-symbolic", + }); + this.label = "Laptop"; + this.title = "Laptop"; + this.dbus_platform = dbus_platform; + this.dbus_anime = dbus_anime; - this.menu.setHeader("selection-mode-symbolic", "Laptop features"); + this.menu.setHeader("selection-mode-symbolic", "Laptop features"); - this.primary = AsusExtension.extension._settings.get_string("primary-quickmenu-toggle"); + this.last_selection = Extension.lookupByUUID(AsusExtension.uuid) + ?.getSettings() + .get_string("primary-quickmenu-toggle")!; - // TODO: temporary block - if (this.primary == "mini-led" && !this._dbus_supported.supported.rog_bios_ctrl.mini_led_mode) { - this.primary = "panel-od"; - } else if (this.primary == "panel-od" && !this._dbus_supported.supported.rog_bios_ctrl.panel_overdrive) { - this.primary = "anime-power"; - } else if (this.primary == "anime-power" && !this._dbus_supported.supported.anime_ctrl) { - this.primary = "mini-led"; - } else if (this.primary.length == 0) { - this.primary = "panel-od"; - } + this.supported_interfaces = this.dbus_platform?.proxy.SupportedInterfacesSync()[0]; + this.supported_properties = this.dbus_platform?.proxy.SupportedPropertiesSync()[0]; - // AsusExtension.extension._settings.connect('changed::primary-quickmenu-toggle', this.sync); - AsusExtension.extension._settings.set_string("primary-quickmenu-toggle", this.primary); + // TODO: temporary block + if (this.last_selection == "mini-led" && !this.supported_properties.includes("MiniLed")) { + this.last_selection = "panel-od"; + } else if ( + this.last_selection == "panel-od" && + !this.supported_properties.includes("PanelOd") + ) { + this.last_selection = "anime-power"; + } else if ( + this.last_selection == "anime-power" && + !this.supported_interfaces.includes("Anime") + ) { + this.last_selection = "mini-led"; + } else if (this.last_selection.length == 0) { + this.last_selection = "panel-od"; + } - this._itemsSection = new PopupMenu.PopupMenuSection(); - if (this._dbus_supported.supported.rog_bios_ctrl.mini_led_mode) { - if (this.miniLed == null) { - this.miniLed = new MenuToggleMiniLed(this._dbus_platform); - this._dbus_platform.notifyMiniLedSubscribers.push(this.miniLed); - this._itemsSection.addMenuItem(this.miniLed, 0); - this._dbus_platform.notifyMiniLedSubscribers.push(this); - this.miniLed.toggle_callback = () => { - this.primary = "mini-led"; - this.sync(); - } - } - } + // AsusExtension.extension._settings.connect('changed::primary-quickmenu-toggle', this.sync); + Extension.lookupByUUID(uuid) + ?.getSettings() + .set_string("primary-quickmenu-toggle", this.last_selection); - if (this._dbus_supported.supported.rog_bios_ctrl.panel_overdrive) { - if (this.panelOd == null) { - this.panelOd = new MenuTogglePanelOd(this._dbus_platform); - this._dbus_platform.notifyPanelOdSubscribers.push(this.panelOd); - this._itemsSection.addMenuItem(this.panelOd, 1); - this._dbus_platform.notifyPanelOdSubscribers.push(this); - this.panelOd.toggle_callback = () => { - this.primary = "panel-od"; - this.sync(); - } - } - } + this._itemsSection = new popupMenu.PopupMenuSection(); + if (this.supported_properties.includes("MiniLed")) { + if (this.miniLed == null) { + this.miniLed = new AsusMenuToggle( + this.dbus_platform, + "MiniLed", + "mini-led-enabled", + "Mini-LED Enabled", + ); + this._itemsSection.addMenuItem(this.miniLed, 0); + this.miniLed.toggle_callback = () => { + this.last_selection = "mini-led"; + }; + } + } - if (this._dbus_supported.supported.anime_ctrl) { - if (this.animeDisplayPower == null) { - this.animeDisplayPower = new MenuToggleAnimePower(this._dbus_anime); - this._dbus_anime.notifyAnimeStateSubscribers.push(this.animeDisplayPower); - this._itemsSection.addMenuItem(this.animeDisplayPower, 2); - this._dbus_anime.notifyAnimeStateSubscribers.push(this); - this.animeDisplayPower.toggle_callback = () => { - this.primary = "anime-power"; - this.sync(); - } - } + if (this.supported_properties.includes("PanelOd")) { + if (this.panelOd == null) { + this.panelOd = new AsusMenuToggle( + this.dbus_platform, + "PanelOd", + "panel-od-enabled", + "Panel Overdrive Enabled", + ); + this._itemsSection.addMenuItem(this.panelOd, 1); + this.panelOd.toggle_callback = () => { + this.last_selection = "panel-od"; + }; + } + } - if (this.animePowersaveAnim == null) { - this.animePowersaveAnim = new MenuToggleAnimeBuiltins(this._dbus_anime); - this._dbus_anime.notifyAnimeStateSubscribers.push(this.animePowersaveAnim); - this._itemsSection.addMenuItem(this.animePowersaveAnim, 3); - } - } - - this.connectObject( - "clicked", () => { - this._toggle(); - }, - this); - - this.menu.addMenuItem(this._itemsSection, 0); - - // // Add an entry-point for more extension._settings - // this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - // const settingsItem = this.menu.addAction("More Settings", - // () => ExtensionUtils.openPrefs()); - // // Ensure the extension._settings are unavailable when the screen is locked - // settingsItem.visible = Main.sessionMode.allowSettings; - // this.menu._settingsActions[Me.uuid] = settingsItem; - - this.sync(); - addQuickSettingsItems([this]); + if (this.supported_interfaces.includes("Anime")) { + if (this.animeDisplayPower == null) { + this.animeDisplayPower = new AsusMenuToggle( + this.dbus_anime, + "EnableDisplay", + "anime-power", + "AniMe Display Enabled", + ); + this._itemsSection.addMenuItem(this.animeDisplayPower, 2); + this.animeDisplayPower.toggle_callback = () => { + this.last_selection = "anime-power"; + }; } - _toggle() { - if (this.primary == "mini-led" && this.miniLed != null) { - this._dbus_platform.getMiniLedMode(); - const checked = this._dbus_platform.bios.mini_led_mode; - if (this.checked !== checked) - this._dbus_platform.setMiniLedMode(this.checked); - } - - if (this.primary == "panel-od" && this.panelOd != null) { - this._dbus_platform.getPanelOd(); - const checked = this._dbus_platform.bios.panel_overdrive; - if (this.checked !== checked) - this._dbus_platform.setPanelOd(this.checked); - } - - if (this.primary == "anime-power" && this.animeDisplayPower != null) { - this._dbus_anime.getDeviceState(); - const checked = this._dbus_anime.deviceState.display_enabled; - if (this.checked !== checked) - this._dbus_anime.setEnableDisplay(this.checked); - } + if (this.animePowersaveAnim == null) { + this.animePowersaveAnim = new AsusMenuToggle( + this.dbus_anime, + "BuiltinsEnabled", + "anime-builtins", + "AniMe Built-in Animations", + ); + this._itemsSection.addMenuItem(this.animePowersaveAnim, 3); + this.animePowersaveAnim.toggle_callback = () => { + this.last_selection = "anime-builtins"; + }; } + } - sync() { - let checked = false; - if (this.primary == "mini-led" && this.miniLed != null) { - this.title = this.miniLed.label; - checked = this._dbus_platform.bios.mini_led_mode; - } + this.connectObject( + "clicked", + () => { + this._toggle(); + }, + this, + ); - if (this.primary == "panel-od" && this.panelOd != null) { - this.title = this.panelOd.label; - checked = this._dbus_platform.bios.panel_overdrive; - } + this.menu.addMenuItem(this._itemsSection, 0); - if (this.primary == "anime-power" && this.animeDisplayPower != null) { - this.title = this.animeDisplayPower.label; - checked = this._dbus_anime.deviceState.display_enabled; - } + this.dbus_platform?.proxy.connect("g-properties-changed", (_proxy, changed, invalidated) => { + //const properties = changed.deepUnpack(); + this.sync(); + }); - // if (this.animePowersaveAnim != null) { - // } + this.dbus_anime?.proxy.connect("g-properties-changed", (_proxy, changed, invalidated) => { + //const properties = changed.deepUnpack(); + this.sync(); + }); - if (this.checked !== checked) - this.set({ checked }); + // // Add an entry-point for more extension._settings + // this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); + // const settingsItem = this.menu.addAction("More Settings", + // () => ExtensionUtils.openPrefs()); + // // Ensure the extension._settings are unavailable when the screen is locked + // settingsItem.visible = Main.sessionMode.allowSettings; + // this.menu._settingsActions[Me.uuid] = settingsItem; + + this.sync(); + addQuickSettingsItems([this]); + } + + _toggle() { + if (this.last_selection == "mini-led" && this.miniLed != null) { + if (this.checked !== this.dbus_platform.proxy.MiniLed) + this.dbus_platform.proxy.MiniLed = this.checked; + } + + if (this.last_selection == "panel-od" && this.panelOd != null) { + if (this.checked !== this.dbus_platform.proxy.PanelOd) { + this.dbus_platform.proxy.PanelOd = this.checked; } - }); + } + + if (this.last_selection == "anime-power" && this.animeDisplayPower != null) { + if (this.checked !== this.dbus_anime.proxy.EnableDisplay) + this.dbus_anime.proxy.EnableDisplay = this.checked; + } + + if (this.last_selection == "anime-builtins" && this.animePowersaveAnim != null) { + if (this.checked !== this.dbus_anime.proxy.BuiltinsEnabled) + this.dbus_anime.proxy.BuiltinsEnabled = this.checked; + } + } + + sync() { + let checked = false; + if (this.last_selection == "mini-led" && this.miniLed != null) { + this.title = this.miniLed.title; + checked = this.dbus_platform.proxy.MiniLed; + } + + if (this.last_selection == "panel-od" && this.panelOd != null) { + this.title = this.panelOd.title; + checked = this.dbus_platform.proxy.PanelOd; + } + + if (this.last_selection == "anime-power" && this.animeDisplayPower != null) { + this.title = this.animeDisplayPower.title; + checked = this.dbus_anime.proxy.EnableDisplay; + } + + if (this.last_selection == "anime-builtins" && this.animePowersaveAnim != null) { + this.title = this.animePowersaveAnim.title; + checked = this.dbus_anime.proxy.BuiltinsEnabled; + } + + // if (this.animePowersaveAnim != null) { + // } + + if (this.checked !== checked) this.set({ checked }); + } + + destroy() { + // this.panelOd?.destroy(); + } + }, +); diff --git a/desktop-extensions/gnome-45/src/modules/quick_toggles/anime_power.ts b/desktop-extensions/gnome-45/src/modules/quick_toggles/anime_power.ts deleted file mode 100644 index c6c260c4..00000000 --- a/desktop-extensions/gnome-45/src/modules/quick_toggles/anime_power.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { AnimeDbus } from "../dbus/animatrix"; -import { addQuickSettingsItems } from "../helpers"; - -import Gio from 'gi://Gio'; -import GObject from 'gi://GObject'; -import * as QuickToggle from 'resource:///org/gnome/shell/ui/quickSettings.js'; - -import * as AsusExtension from "../../extension.js"; - -export const QuickAnimePower = GObject.registerClass( - class QuickAnimePower extends QuickToggle { - private _dbus_anime: AnimeDbus; - - constructor(dbus_anime: AnimeDbus) { - super({ - title: "AniMatrix Power", - iconName: "selection-mode-symbolic", - toggleMode: true, - }); - this._dbus_anime = dbus_anime; - this.label = "AniMatrix Power"; - - this.connectObject( - "clicked", () => this._toggleMode(), - this); - - this.connect("destroy", () => { - this.destroy(); - }); - - AsusExtension.extension._settings.bind("anime-power", - this, "checked", - Gio.SettingsBindFlags.DEFAULT); - - this.sync(); - - addQuickSettingsItems([this]); - } - - _toggleMode() { - this._dbus_anime.getDeviceState(); - const checked = this._dbus_anime.deviceState.display_enabled; - if (this.checked !== checked) - this._dbus_anime.setEnableDisplay(this.checked); - } - - sync() { - this._dbus_anime.getDeviceState(); - const checked = this._dbus_anime.deviceState.display_enabled; - if (this.checked !== checked) - this.set({ checked }); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-45/src/modules/quick_toggles/mini_led.ts b/desktop-extensions/gnome-45/src/modules/quick_toggles/mini_led.ts deleted file mode 100644 index 987d0d57..00000000 --- a/desktop-extensions/gnome-45/src/modules/quick_toggles/mini_led.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { Platform } from "../dbus/platform"; -import { addQuickSettingsItems } from "../helpers"; -import Gio from 'gi://Gio'; -import GObject from 'gi://GObject'; -import * as QuickToggle from 'resource:///org/gnome/shell/ui/quickSettings.js'; -import * as AsusExtension from "../../extension.js"; - -export const QuickMiniLed = GObject.registerClass( - class QuickMiniLed extends QuickToggle { - private _dbus_platform: Platform; - - constructor(dbus_platform: Platform) { - super({ - title: "MiniLED", - iconName: "selection-mode-symbolic", - toggleMode: true, - }); - this._dbus_platform = dbus_platform; - this.label = "MiniLED"; - - this.connectObject( - "destroy", () => AsusExtension.extension._settings.run_dispose(), - "clicked", () => this._toggleMode(), - this); - - this.connect("destroy", () => { - this.destroy(); - }); - - AsusExtension.extension._settings.bind("mini-led-enabled", - this, "checked", - Gio.SettingsBindFlags.DEFAULT); - - this.sync(); - - addQuickSettingsItems([this]); - } - - _toggleMode() { - const checked = this._dbus_platform.getMiniLedMode(); - if (this.checked !== checked) - this._dbus_platform.setMiniLedMode(this.checked); - } - - sync() { - const checked = this._dbus_platform.getMiniLedMode(); - if (this.checked !== checked) - this.set({ checked }); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-45/src/modules/quick_toggles/panel_od.ts b/desktop-extensions/gnome-45/src/modules/quick_toggles/panel_od.ts deleted file mode 100644 index e85b28c6..00000000 --- a/desktop-extensions/gnome-45/src/modules/quick_toggles/panel_od.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Platform } from "../dbus/platform"; -import { addQuickSettingsItems } from "../helpers"; -import Gio from 'gi://Gio'; -import GObject from 'gi://GObject'; -import * as QuickToggle from 'resource:///org/gnome/shell/ui/quickSettings.js'; -import * as AsusExtension from "../../extension.js"; - -export const QuickPanelOd = GObject.registerClass( - class QuickPanelOd extends QuickToggle { - private _dbus_platform: Platform; - - constructor(dbus_platform: Platform) { - super({ - title: "Panel Overdrive", - iconName: "selection-mode-symbolic", - toggleMode: true, - }); - this._dbus_platform = dbus_platform; - this.label = "Panel Overdrive"; - - this.connectObject( - "clicked", () => this._toggleMode(), - this); - - this.connect("destroy", () => { - this.destroy(); - }); - - AsusExtension.extension._settings.bind("panel-od-enabled", - this, "checked", - Gio.SettingsBindFlags.DEFAULT); - - this.sync(); - - addQuickSettingsItems([this]); - } - - _toggleMode() { - const checked = this._dbus_platform.getPanelOd(); - if (this.checked !== checked) - this._dbus_platform.setPanelOd(this.checked); - } - - sync() { - const checked = this._dbus_platform.getPanelOd(); - if (this.checked !== checked) - this.set({ checked }); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-45/src/modules/resources.ts b/desktop-extensions/gnome-45/src/modules/resources.ts deleted file mode 100644 index 7adbea1d..00000000 --- a/desktop-extensions/gnome-45/src/modules/resources.ts +++ /dev/null @@ -1,20 +0,0 @@ -import GLib from 'gi://GLib'; -import * as AsusExtension from '../extension.js'; - -export class File { - public static DBus(name: string) { - const file = `${AsusExtension.extension.path}/resources/dbus/${name}.xml`; - try { - const [_ok, bytes] = GLib.file_get_contents(file); - if (!_ok) - //@ts-ignore - log(`Couldn't read contents of "${file}"`); - - const decoder = new TextDecoder(); - return _ok ? decoder.decode(bytes) : null; - } catch (e) { - //@ts-ignore - log(`Failed to load "${file}"`, e); - } - } -} diff --git a/desktop-extensions/gnome-45/src/modules/rog_indicator.ts b/desktop-extensions/gnome-45/src/modules/rog_indicator.ts new file mode 100644 index 00000000..7485c2b5 --- /dev/null +++ b/desktop-extensions/gnome-45/src/modules/rog_indicator.ts @@ -0,0 +1,26 @@ +import { Extension, gettext as _ } from "@girs/gnome-shell/extensions/extension"; +import { quickSettings, main } from "@girs/gnome-shell/ui"; +import { Gio } from "@girs/gio-2.0"; +import { GObject } from "@girs/gobject-2.0"; +import { uuid } from "../extension"; +//import { DbusBase } from '../dbus_proxy'; + +export const AsusIndicator = GObject.registerClass( + class AsusIndicator extends quickSettings.SystemIndicator { + private _indicator: any; + private _settings: Gio.Settings | undefined; + + constructor(icon_name: string, setting_name: string) { + super(); + // Create an icon for the indicator + this._indicator = this._addIndicator(); + this._indicator.icon_name = icon_name; + + // Showing an indicator when the feature is enabled + this._settings = Extension.lookupByUUID(uuid)?.getSettings(); + this._settings?.bind(setting_name, this._indicator, "visible", Gio.SettingsBindFlags.DEFAULT); + + main.panel.statusArea.quickSettings.addExternalIndicator(this); + } + }, +); diff --git a/desktop-extensions/gnome-45/src/modules/rog_menu_toggle.ts b/desktop-extensions/gnome-45/src/modules/rog_menu_toggle.ts new file mode 100644 index 00000000..79e81e63 --- /dev/null +++ b/desktop-extensions/gnome-45/src/modules/rog_menu_toggle.ts @@ -0,0 +1,50 @@ +import { popupMenu } from "@girs/gnome-shell/ui"; +import { GObject } from "@girs/gobject-2.0"; +import { DbusBase } from "./dbus_proxy"; + +export const AsusMenuToggle = GObject.registerClass( + class AsusMenuToggle extends popupMenu.PopupSwitchMenuItem { + public title: string = ""; + dbus!: DbusBase; + prop_name: string = ""; + public toggle_callback = () => {}; + + constructor(dbus: DbusBase, prop_name: string, setting: string, title: string) { + super(title, true); + this.prop_name = prop_name; + this.dbus = dbus; + this.title = title; + + this.dbus?.proxy.connect("g-properties-changed", (_proxy, changed, invalidated) => { + const properties = changed.deepUnpack(); + // .find() fails on some shit for some reason + for (const v of Object.entries(properties)) { + if (v[0] == this.prop_name) { + this.sync(); + break; + } + } + }); + + this.connectObject("toggled", () => this._toggleMode(), this); + + this.connect("destroy", () => { + this.destroy(); + }); + + this.sync(); + } + + _toggleMode() { + // hacky shit, index to get base object property and set it + const state = this.dbus.proxy[this.prop_name]; + if (this.state !== state) this.dbus.proxy[this.prop_name] = this.state; + this.toggle_callback(); + } + + sync() { + const state = this.dbus.proxy[this.prop_name]; + if (this.state !== state) this.setToggleState(state); + } + }, +); diff --git a/desktop-extensions/gnome-45/src/modules/rog_quick_toggle.ts b/desktop-extensions/gnome-45/src/modules/rog_quick_toggle.ts new file mode 100644 index 00000000..d21e0c12 --- /dev/null +++ b/desktop-extensions/gnome-45/src/modules/rog_quick_toggle.ts @@ -0,0 +1,64 @@ +import { Extension, gettext as _ } from "@girs/gnome-shell/extensions/extension"; +import { addQuickSettingsItems } from "./helpers"; +import { quickSettings } from "@girs/gnome-shell/ui"; +import { Gio } from "@girs/gio-2.0"; +import { GObject } from "@girs/gobject-2.0"; +import { uuid } from "../extension"; +import { DbusBase } from "./dbus_proxy"; + +export const AsusQuickToggle = GObject.registerClass( + class AsusQuickToggle extends quickSettings.QuickToggle { + dbus!: DbusBase; + prop_name: string = ""; + public toggle_callback = () => {}; + + constructor(dbus: DbusBase, prop_name: string, setting: string, title: string) { + super({ + label: title, + icon_name: "selection-mode-symbolic", + toggle_mode: true, + }); + this.prop_name = prop_name; + this.label = title; + this.dbus = dbus; + + this.dbus?.proxy.connect("g-properties-changed", (_proxy, changed, invalidated) => { + const properties = changed.deepUnpack(); + // .find() fails on some shit for some reason + for (const v of Object.entries(properties)) { + if (v[0] == this.prop_name) { + const checked = v[1].unpack(); + if (this.checked !== checked) this.checked = checked; + break; + } + } + }); + + this.connectObject("clicked", () => this._toggleMode(), this); + + this.connect("destroy", () => { + this.destroy(); + }); + + Extension.lookupByUUID(uuid) + ?.getSettings() + .bind(setting, this, "checked", Gio.SettingsBindFlags.DEFAULT); + + this.sync(); + + addQuickSettingsItems([this]); + } + + _toggleMode() { + // hacky shit, index to get base object property and set it + const checked = this.dbus.proxy[this.prop_name]; + if (this.checked !== checked) this.dbus.proxy[this.prop_name] = this.checked; + this.toggle_callback(); + } + + sync() { + const checked = this.dbus.proxy[this.prop_name]; + if (this.checked !== checked) this.set({ checked }); + } + }, +); diff --git a/desktop-extensions/gnome-45/src/modules/rog_slider_100pc.ts b/desktop-extensions/gnome-45/src/modules/rog_slider_100pc.ts new file mode 100644 index 00000000..37ff3de2 --- /dev/null +++ b/desktop-extensions/gnome-45/src/modules/rog_slider_100pc.ts @@ -0,0 +1,75 @@ +import { Extension, gettext as _ } from "@girs/gnome-shell/extensions/extension"; +import { addQuickSettingsItems } from "./helpers"; +import { quickSettings } from "@girs/gnome-shell/ui"; +import { Gio } from "@girs/gio-2.0"; +import { GObject } from "@girs/gobject-2.0"; +import { uuid } from "../extension"; +import { DbusBase } from "./dbus_proxy"; + +export const AsusSlider = GObject.registerClass( + class AsusSlider extends quickSettings.QuickSlider { + private dbus: DbusBase; + private settings: any = undefined; + private setting = ""; + private prop_name = ""; + + constructor(dbus: DbusBase, prop_name: string, setting: string, title: string) { + super({ + label: title, + icon_name: "selection-mode-symbolic", + }); + this.label = title; + this.dbus = dbus; + this.setting = setting; + this.prop_name = prop_name; + this.settings = Extension.lookupByUUID(uuid)?.getSettings(); + + this._sliderChangedId = this.slider.connect("drag-end", this._onSliderChanged.bind(this)); + + // Binding the slider to a GSettings key + + this.settings.connect(`changed::${this.setting}`, this._onSettingsChanged.bind(this)); + + // Set an accessible name for the slider + this.slider.accessible_name = title; + + this.dbus?.proxy.connect("g-properties-changed", (_proxy, changed, invalidated) => { + const properties = changed.deepUnpack(); + // .find() fails on some shit for some reason + for (const v of Object.entries(properties)) { + if (v[0] == this.prop_name) { + const checked = v[1].unpack(); + this._sync(); + break; + } + } + }); + + this._sync(); + this._onSettingsChanged(); + + addQuickSettingsItems([this], 2); + } + + _onSettingsChanged() { + // Prevent the slider from emitting a change signal while being updated + this.slider.block_signal_handler(this._sliderChangedId); + this.slider.value = this.settings.get_uint(this.setting) / 100.0; + this.slider.unblock_signal_handler(this._sliderChangedId); + } + + _onSliderChanged() { + // Assuming our GSettings holds values between 0..100, adjust for the + // slider taking values between 0..1 + const percent = Math.floor(this.slider.value * 100); + const stored = Math.floor(this.settings.get_uint(this.setting) / 100.0); + if (this.slider.value !== stored) this.dbus.proxy[this.prop_name] = percent; + this.settings.set_uint(this.setting, percent); + } + + _sync() { + const value = this.dbus.proxy[this.prop_name]; + if (this.slider.value !== value / 100) this.settings.set_uint(this.setting, value); + } + }, +); diff --git a/desktop-extensions/gnome-45/src/modules/sliders/charge.ts b/desktop-extensions/gnome-45/src/modules/sliders/charge.ts deleted file mode 100644 index 8e1f9a24..00000000 --- a/desktop-extensions/gnome-45/src/modules/sliders/charge.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { Power } from "../dbus/power"; -import { addQuickSettingsItems } from "../helpers"; -import GObject from 'gi://GObject'; -import * as QuickSettings from 'resource:///org/gnome/shell/ui/quickSettings.js'; -import * as AsusExtension from "../../extension.js"; - -export const SliderChargeLevel = GObject.registerClass( - class SliderChargeLevel extends QuickSettings.QuickSlider { - private _dbus_power: Power; - - constructor(dbus_power: Power) { - super({ - iconName: "selection-mode-symbolic", - }); - this._dbus_power = dbus_power; - - this._sliderChangedId = this.slider.connect("drag-end", - this._onSliderChanged.bind(this)); - - // Binding the slider to a GSettings key - - AsusExtension.extension._settings.connect("changed::charge-level", - this._onSettingsChanged.bind(this)); - - // Set an accessible name for the slider - this.slider.accessible_name = "Charge level"; - - this._sync(); - this._onSettingsChanged(); - - addQuickSettingsItems([this], 2); - } - - _onSettingsChanged() { - // Prevent the slider from emitting a change signal while being updated - this.slider.block_signal_handler(this._sliderChangedId); - this.slider.value = AsusExtension.extension._settings.get_uint("charge-level") / 100.0; - this.slider.unblock_signal_handler(this._sliderChangedId); - } - - _onSliderChanged() { - // Assuming our GSettings holds values between 0..100, adjust for the - // slider taking values between 0..1 - const percent = Math.floor(this.slider.value * 100); - const stored = Math.floor( AsusExtension.extension._settings.get_uint("charge-level") / 100.0); - if (this.slider.value !== stored) - this._dbus_power.setChargingLimit(percent); - AsusExtension.extension._settings.set_uint("charge-level", percent); - } - - _sync() { - const value = this._dbus_power.getChargingLimit(); - if (this.slider.value !== value / 100) - AsusExtension.extension._settings.set_uint("charge-level", value); - } - }); \ No newline at end of file diff --git a/desktop-extensions/gnome-45/tsconfig.json b/desktop-extensions/gnome-45/tsconfig.json index cf48caee..92e3af15 100644 --- a/desktop-extensions/gnome-45/tsconfig.json +++ b/desktop-extensions/gnome-45/tsconfig.json @@ -1,22 +1,19 @@ { + // "extends": "@tsconfig/strictest/tsconfig.json", "compilerOptions": { - "lib": [ - "es2019" - ], + "lib": ["ESNext"], "types": [], - "target": "es2019", - "module": "ES2022", - "moduleResolution": "node", + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "Bundler", "declaration": true, "removeComments": true, "strict": true, - "allowJs": true + "allowJs": true, + "paths": {}, + "skipLibCheck": true }, - "files": [ - "./src/extension.ts", - ], - "include": [ - "src/*.ts", - "src/**/*.ts" - ] -} \ No newline at end of file + "files": ["./src/extension.ts"], + "include": ["src/*.ts"], + "exclude": [".ts-for-girrc.js", ".eslintrc.cjs"] +} diff --git a/desktop-extensions/gnome-45/yarn.lock b/desktop-extensions/gnome-45/yarn.lock index 42c47fb6..64bececc 100644 --- a/desktop-extensions/gnome-45/yarn.lock +++ b/desktop-extensions/gnome-45/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@esbuild/linux-x64@0.17.19": - version "0.17.19" - resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz" - integrity sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw== +"@esbuild/linux-x64@0.19.6": + version "0.19.6" + resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.6.tgz" + integrity sha512-UWcieaBzsN8WYbzFF5Jq7QULETPcQvlX7KL4xWGIB54OknXJjBO37sPqk7N82WU13JGWvmDzFBi1weVBajPovg== "@eslint-community/eslint-utils@^4.2.0": version "4.4.0" @@ -19,15 +19,15 @@ dependencies: eslint-visitor-keys "^3.3.0" -"@eslint-community/regexpp@^4.4.0": - version "4.5.1" - resolved "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz" - integrity sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ== +"@eslint-community/regexpp@^4.4.0", "@eslint-community/regexpp@^4.6.1": + version "4.10.0" + resolved "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz" + integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== -"@eslint/eslintrc@^2.1.0": - version "2.1.0" - resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz" - integrity sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A== +"@eslint/eslintrc@^2.1.3": + version "2.1.3" + resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz" + integrity sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -39,17 +39,634 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.44.0": - version "8.44.0" - resolved "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz" - integrity sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw== +"@eslint/js@8.54.0": + version "8.54.0" + resolved "https://registry.npmjs.org/@eslint/js/-/js-8.54.0.tgz" + integrity sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ== -"@humanwhocodes/config-array@^0.11.10": - version "0.11.10" - resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz" - integrity sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ== +"@girs/accountsservice-1.0@^1.0.0-3.2.5": + version "1.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/accountsservice-1.0/-/accountsservice-1.0-1.0.0-3.2.5.tgz" + integrity sha512-1uSGJqw0tA0gMCiyOgscF/IBoI/eZt9ZbCakqSDKaQlUa8nauS0UnuItwt8SPj/AW5p2472ZMT3yBR7iKWaM7g== dependencies: - "@humanwhocodes/object-schema" "^1.2.1" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/adw-1@^1.4.0-3.2.5": + version "1.4.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/adw-1/-/adw-1-1.4.0-3.2.5.tgz" + integrity sha512-NSH5IXCFsLO9UGAcGL2+3uGB2zab/BswCbNZv+MUan1d3VNEZac/S3qv+eGRzbi/9LgEzHVP4Zv+B4fvNn3cWg== + dependencies: + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gdk-4.0" "^4.0.0-3.2.5" + "@girs/gdkpixbuf-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gmodule-2.0" "^2.0.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/graphene-1.0" "^1.0.0-3.2.5" + "@girs/gsk-4.0" "^4.0.0-3.2.5" + "@girs/gtk-4.0" "^4.12.3-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + "@girs/pango-1.0" "^1.51.0-3.2.5" + "@girs/pangocairo-1.0" "^1.0.0-3.2.5" + +"@girs/atk-1.0@^2.50.0-3.2.5": + version "2.50.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/atk-1.0/-/atk-1.0-2.50.0-3.2.5.tgz" + integrity sha512-L4ZP7+ChICTYNLPQo6ok3kgZFVV0lrpRSA3KRTgz1Xzosby7ATxN4lSp+FY62IPutR494xp7t76lzaetJOoA8A== + dependencies: + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/cairo-1.0@^1.0.0-3.2.5": + version "1.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/cairo-1.0/-/cairo-1.0-1.0.0-3.2.5.tgz" + integrity sha512-KUaNKNNgwh8MKqc/tzDQfW3DbXug4jPZtmnbazHfN1q34eBpOrtG5UaK7m3XKOeoFo1KbbKsPQHJyCAs7ZFIUQ== + dependencies: + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/cally-13@^13.0.0-3.2.5": + version "13.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/cally-13/-/cally-13-13.0.0-3.2.5.tgz" + integrity sha512-HTJrtk5e2wKzzlC/RowZmf14xIQ+EcX0L9ry68cM4zdlLYFC60HEZ0Wfu4yNElMCUvkc7HbrgXwCm0HVDvoaZA== + dependencies: + "@girs/atk-1.0" "^2.50.0-3.2.5" + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/clutter-13" "^13.0.0-3.2.5" + "@girs/cogl-13" "^13.0.0-3.2.5" + "@girs/coglpango-13" "^13.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/gl-1.0" "^1.0.0-3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/graphene-1.0" "^1.0.0-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + "@girs/json-1.0" "^1.7.1-3.2.5" + "@girs/mtk-13" "^13.0.0-3.2.5" + "@girs/pango-1.0" "^1.51.0-3.2.5" + "@girs/pangocairo-1.0" "^1.0.0-3.2.5" + +"@girs/clutter-13@^13.0.0-3.2.5": + version "13.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/clutter-13/-/clutter-13-13.0.0-3.2.5.tgz" + integrity sha512-srWebm2+2HHeLUErBJ0z4zZT297mfh6uF4yUCgW/VEGU6nRDGzl+Me0gc+7a47oT8F0OLjqWAj1cxac8h/M0ew== + dependencies: + "@girs/atk-1.0" "^2.50.0-3.2.5" + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/cogl-13" "^13.0.0-3.2.5" + "@girs/coglpango-13" "^13.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/gl-1.0" "^1.0.0-3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/graphene-1.0" "^1.0.0-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + "@girs/json-1.0" "^1.7.1-3.2.5" + "@girs/mtk-13" "^13.0.0-3.2.5" + "@girs/pango-1.0" "^1.51.0-3.2.5" + "@girs/pangocairo-1.0" "^1.0.0-3.2.5" + +"@girs/cogl-13@^13.0.0-3.2.5": + version "13.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/cogl-13/-/cogl-13-13.0.0-3.2.5.tgz" + integrity sha512-UWwe3RIuDSITuPt+EIWPl5V2TyUICSvLi3cd0BpbY2fRqi7xOKh1hqANHVCtSntbXN1Jm99ZPjdFz5j1f9+5xA== + dependencies: + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/gl-1.0" "^1.0.0-3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/graphene-1.0" "^1.0.0-3.2.5" + +"@girs/cogl-2.0@^2.0.0-3.2.5": + version "2.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/cogl-2.0/-/cogl-2.0-2.0.0-3.2.5.tgz" + integrity sha512-R/M0AltgQqp0RKfe93RQTe/36wCpn9/Ff4qoLC/QGn9+6WUSvL276Rf27qo+cHDN0FIRX4TlR7A/zLdFoi1t+Q== + dependencies: + "@girs/gjs" "^3.2.5" + "@girs/gl-1.0" "^1.0.0-3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/coglpango-13@^13.0.0-3.2.5": + version "13.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/coglpango-13/-/coglpango-13-13.0.0-3.2.5.tgz" + integrity sha512-1U2Le2ULjDB6JY4BvfR7PyuXxvsMfiwHYCwNVgYDspHEGDofZzZgEAkNCs4m0uSVkvZtGwV/JdcOVxRdNmfZYA== + dependencies: + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/cogl-13" "^13.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/gl-1.0" "^1.0.0-3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/graphene-1.0" "^1.0.0-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + "@girs/pango-1.0" "^1.51.0-3.2.5" + "@girs/pangocairo-1.0" "^1.0.0-3.2.5" + +"@girs/freetype2-2.0@^2.0.0-3.2.5": + version "2.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/freetype2-2.0/-/freetype2-2.0-2.0.0-3.2.5.tgz" + integrity sha512-JKcGqMYevEVybaT8RvK8UOnFhJCTNNFadpLhh9oPvkbc2NwORvCU5s/VmRyDFNgIKacoxhZK2ho9p+51VuSL+Q== + dependencies: + "@girs/gjs" "^3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/gck-2@^4.1.0-3.2.5": + version "4.1.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gck-2/-/gck-2-4.1.0-3.2.5.tgz" + integrity sha512-jDIsr0rN/6Y0pyqmaRonIr8c6aDU8a2I5o38kTVnzaRw4AkKW5iauj+gwlpWuOeBcpirWe8mz3BoXGqydUCIsA== + dependencies: + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/gcr-4@^4.1.0-3.2.5": + version "4.1.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gcr-4/-/gcr-4-4.1.0-3.2.5.tgz" + integrity sha512-o9zQbLnFBIXn6fUp6AzpUrA5iVPf1waUQdCPxUqCgsIGztBNl868pRoGwlxxWlVEp73IrqJ/o7MST42rfPfr1A== + dependencies: + "@girs/gck-2" "^4.1.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/gdesktopenums-3.0@^3.0.0-3.2.5": + version "3.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gdesktopenums-3.0/-/gdesktopenums-3.0-3.0.0-3.2.5.tgz" + integrity sha512-TrLalzuRXL4R+kIhY9TN5NPFWX22wr+UXUNGC4UCwNBykhs5kJ3iOUPLLWQkPGNjjDK6OyCo5iyT/8fnMqK+Ew== + dependencies: + "@girs/gjs" "^3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/gdk-4.0@^4.0.0-3.2.5": + version "4.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gdk-4.0/-/gdk-4.0-4.0.0-3.2.5.tgz" + integrity sha512-e/a/+6n729KVliT8IHWPANlKJAL3CP/gRP+fpT/1iOun3BzjPbix6aEd31OTPhfeRIE+gpFiDoO/nItS79/BKw== + dependencies: + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gdkpixbuf-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gmodule-2.0" "^2.0.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + "@girs/pango-1.0" "^1.51.0-3.2.5" + "@girs/pangocairo-1.0" "^1.0.0-3.2.5" + +"@girs/gdkpixbuf-2.0@^2.0.0-3.2.5": + version "2.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gdkpixbuf-2.0/-/gdkpixbuf-2.0-2.0.0-3.2.5.tgz" + integrity sha512-PvyxWzkZMsy/jQyqou7v/13/eZiYwLEIq5TgSO6LI4j5gDzEFbDErap9ELlaYoUW/PnsWWIgRVp5u4b+W2cnMA== + dependencies: + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gmodule-2.0" "^2.0.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/gdm-1.0@^1.0.0-3.2.5": + version "1.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gdm-1.0/-/gdm-1.0-1.0.0-3.2.5.tgz" + integrity sha512-xfJvdUuh9Hnxj2dDhrVSf0EHSZJ8vm9Gg6g5Pz/OTA8KmOVvaDWJ4HxWmP7bbBCuBognfejO30N1y69U8QP6tA== + dependencies: + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/gio-2.0@^2.78.0-3.2.5": + version "2.78.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gio-2.0/-/gio-2.0-2.78.0-3.2.5.tgz" + integrity sha512-8QVn6rydZuevkkLbLTrURs9bHD8vbvfFZMzR/5iPsTrv6d5wCewUmMxiKEcMicnJmOIhBitu1ZboP8sljht90Q== + dependencies: + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/gjs@^3.2.5": + version "3.2.5" + resolved "https://registry.npmjs.org/@girs/gjs/-/gjs-3.2.5.tgz" + integrity sha512-ndrJQnRmkw6SicVQSwm9IMy7dDPd6kPu19Hp2DFlQWsICG4wKailzRkzsxI064j9uLWQOjO3ydHiiDRpAjwU1Q== + dependencies: + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/gl-1.0@^1.0.0-3.2.5": + version "1.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gl-1.0/-/gl-1.0-1.0.0-3.2.5.tgz" + integrity sha512-waBA2GbqHXGOLlufRTrKJDC44D1OERbCsXYzCGNI/G51RJTOrENBBY8/DO7hPVavHnOgGVnw2WVtNLx7CgcVpQ== + dependencies: + "@girs/gjs" "^3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/glib-2.0@^2.78.0-3.2.5": + version "2.78.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/glib-2.0/-/glib-2.0-2.78.0-3.2.5.tgz" + integrity sha512-VIfgmRPixvxh9i2FPE0ctvWgHMuzWkXjERtG4G8uxnBdH7HAL6+hcEFFYyn1JrkBm4XFVvikyUZYPPoahlDsaQ== + dependencies: + "@girs/gjs" "^3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/gmodule-2.0@^2.0.0-3.2.5": + version "2.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gmodule-2.0/-/gmodule-2.0-2.0.0-3.2.5.tgz" + integrity sha512-oSjlOXzEYlrtYOAyTW57bRigRjpwqV0faeou+iSGj7n1/T/ZxJsPK7rdwAv/7vVB8nev4JT9z3YZyqocHzjIFA== + dependencies: + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/gnome-shell@^45.0.0-beta2": + version "45.0.0-beta2" + resolved "https://registry.npmjs.org/@girs/gnome-shell/-/gnome-shell-45.0.0-beta2.tgz" + integrity sha512-rSO9p/+9dW+cTBTqfgfJgBsLXwOg1gd5MGvBFqHoQWNKXCTDiZ/G5RHget8EmQSnhr8XMSwEjXC/bGBVSD+H3w== + dependencies: + "@girs/accountsservice-1.0" "^1.0.0-3.2.5" + "@girs/adw-1" "^1.4.0-3.2.5" + "@girs/atk-1.0" "^2.50.0-3.2.5" + "@girs/cally-13" "^13.0.0-3.2.5" + "@girs/clutter-13" "^13.0.0-3.2.5" + "@girs/cogl-2.0" "^2.0.0-3.2.5" + "@girs/gcr-4" "^4.1.0-3.2.5" + "@girs/gdm-1.0" "^1.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gnomebg-4.0" "^4.0.0-3.2.5" + "@girs/gnomebluetooth-3.0" "^3.0.0-3.2.5" + "@girs/gnomedesktop-4.0" "^4.0.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/gvc-1.0" "^1.0.0-3.2.5" + "@girs/meta-13" "^13.0.0-3.2.5" + "@girs/polkit-1.0" "^1.0.0-3.2.5" + "@girs/shell-13" "^13.0.0-3.2.5" + "@girs/shew-0" "^0.0.0-3.2.5" + "@girs/st-13" "^13.0.0-3.2.5" + "@girs/upowerglib-1.0" "^0.99.1-3.2.5" + +"@girs/gnomebg-4.0@^4.0.0-3.2.5": + version "4.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gnomebg-4.0/-/gnomebg-4.0-4.0.0-3.2.5.tgz" + integrity sha512-tuNXWRo2WaYqv9sfCIoMym7j57yj1GwREdap3kKMvnJ53SBTltF5hAu73qRfzFTRbPvWGrVs2QNjqxi6zmzGEQ== + dependencies: + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gdesktopenums-3.0" "^3.0.0-3.2.5" + "@girs/gdk-4.0" "^4.0.0-3.2.5" + "@girs/gdkpixbuf-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gmodule-2.0" "^2.0.0-3.2.5" + "@girs/gnomedesktop-4.0" "^4.0.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + "@girs/pango-1.0" "^1.51.0-3.2.5" + "@girs/pangocairo-1.0" "^1.0.0-3.2.5" + +"@girs/gnomebluetooth-3.0@^3.0.0-3.2.5": + version "3.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gnomebluetooth-3.0/-/gnomebluetooth-3.0-3.0.0-3.2.5.tgz" + integrity sha512-tWLrAY+l5Zwp2JBEGluuWd8u+DfuriHRSxtjBzmtqneRnK4Vp8Mb4EvyWnMTAHbKqxMUGg06fkZ3oCWVf2Cebw== + dependencies: + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/gnomedesktop-4.0@^4.0.0-3.2.5": + version "4.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gnomedesktop-4.0/-/gnomedesktop-4.0-4.0.0-3.2.5.tgz" + integrity sha512-JSsZ4r0VEoidAyYz8Y7afVZvTtxZyqNpmdSVf4Fi5cx5Ip/c+524zYVQN0G/FRVxw+uHlP/AsjYm6cVoUQTpHg== + dependencies: + "@girs/gdesktopenums-3.0" "^3.0.0-3.2.5" + "@girs/gdkpixbuf-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gmodule-2.0" "^2.0.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/gobject-2.0@^2.78.0-3.2.5": + version "2.78.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gobject-2.0/-/gobject-2.0-2.78.0-3.2.5.tgz" + integrity sha512-xjplH7Slij+l2/QFO9MYLoe+lHtHsQvZVIccGVOdZtaVMqL6wq3J2JH9ul6czf5EFnApuhN2pXFeE77Jacwduw== + dependencies: + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + +"@girs/graphene-1.0@^1.0.0-3.2.5": + version "1.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/graphene-1.0/-/graphene-1.0-1.0.0-3.2.5.tgz" + integrity sha512-QI+HSiPeueAWk/A3Q7OasVFk/Iv3bLyrEuL50VE3LIiPlEOUAAwmfWaMk/gJlK8bs+Loc/f6fJPe231QV0Vijg== + dependencies: + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/gsk-4.0@^4.0.0-3.2.5": + version "4.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gsk-4.0/-/gsk-4.0-4.0.0-3.2.5.tgz" + integrity sha512-RdupAGlahhVGGQljxiW1ST5a0Ntc1CevDvLOuYGK2YarOC7qh5Wb7Y5D4fCXiEesxgum+DUY2kY8zHj4DHdqvQ== + dependencies: + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gdk-4.0" "^4.0.0-3.2.5" + "@girs/gdkpixbuf-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gmodule-2.0" "^2.0.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/graphene-1.0" "^1.0.0-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + "@girs/pango-1.0" "^1.51.0-3.2.5" + "@girs/pangocairo-1.0" "^1.0.0-3.2.5" + +"@girs/gtk-4.0@^4.12.3-3.2.5": + version "4.12.3-3.2.5" + resolved "https://registry.npmjs.org/@girs/gtk-4.0/-/gtk-4.0-4.12.3-3.2.5.tgz" + integrity sha512-Dkmcjty0hMuqHU2nlrIR0jKLjClgFRfxuZmsjEUIQjfEopogZpVah6YXPlS5ss9E3WnBOT19AfXj+Lj2+211wg== + dependencies: + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gdk-4.0" "^4.0.0-3.2.5" + "@girs/gdkpixbuf-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gmodule-2.0" "^2.0.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/graphene-1.0" "^1.0.0-3.2.5" + "@girs/gsk-4.0" "^4.0.0-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + "@girs/pango-1.0" "^1.51.0-3.2.5" + "@girs/pangocairo-1.0" "^1.0.0-3.2.5" + +"@girs/gvc-1.0@^1.0.0-3.2.5": + version "1.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/gvc-1.0/-/gvc-1.0-1.0.0-3.2.5.tgz" + integrity sha512-z+Q3NvKMc0V0HMa/JixSe0A6HP7g3Y7jihBoUWwRXQp5wuOgs9/WTVtCoLIp97osEFnvzS+yI/o+lDprQZFEnQ== + dependencies: + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/harfbuzz-0.0@^8.2.1-3.2.5": + version "8.2.1-3.2.5" + resolved "https://registry.npmjs.org/@girs/harfbuzz-0.0/-/harfbuzz-0.0-8.2.1-3.2.5.tgz" + integrity sha512-ybs7S1xPNZfZHAuu2uaS68Alarbod3aXpbj4WxrYJlsz9JCFO6xD1U29e9oAkglOcJmWi4DtF1AnzspuTu2iEw== + dependencies: + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/json-1.0@^1.7.1-3.2.5": + version "1.7.1-3.2.5" + resolved "https://registry.npmjs.org/@girs/json-1.0/-/json-1.0-1.7.1-3.2.5.tgz" + integrity sha512-m7TxILvgcpSzKyMwFBJaRYpULvPuvu9kUxfl0cSnOV6J1zB+kCKkTto4Yg65u11RSbQ1e2WLUokHhzmcYHW5XQ== + dependencies: + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/meta-13@^13.0.0-3.2.5": + version "13.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/meta-13/-/meta-13-13.0.0-3.2.5.tgz" + integrity sha512-oaNnbPnwFD/6c4h4XjIgOypT80YqOWVALoTs0vGIC6JeVsmTPcKI4n2SBoqnomd3/QcAhLYj4jZYlUPeFUHyGw== + dependencies: + "@girs/atk-1.0" "^2.50.0-3.2.5" + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/clutter-13" "^13.0.0-3.2.5" + "@girs/cogl-13" "^13.0.0-3.2.5" + "@girs/coglpango-13" "^13.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gdesktopenums-3.0" "^3.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/gl-1.0" "^1.0.0-3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/graphene-1.0" "^1.0.0-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + "@girs/json-1.0" "^1.7.1-3.2.5" + "@girs/mtk-13" "^13.0.0-3.2.5" + "@girs/pango-1.0" "^1.51.0-3.2.5" + "@girs/pangocairo-1.0" "^1.0.0-3.2.5" + "@girs/xfixes-4.0" "^4.0.0-3.2.5" + "@girs/xlib-2.0" "^2.0.0-3.2.5" + +"@girs/mtk-13@^13.0.0-3.2.5": + version "13.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/mtk-13/-/mtk-13-13.0.0-3.2.5.tgz" + integrity sha512-6iadZ1tjlTZ5BWBgH4jIujg/8ev0Oi9jcLRqhzPCIpuK5H0DWFJ7AAKMfy+97li5Ws/6SRX+kFgb9DsvQ0CFOQ== + dependencies: + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/graphene-1.0" "^1.0.0-3.2.5" + +"@girs/nm-1.0@^1.45.1-3.2.5": + version "1.45.1-3.2.5" + resolved "https://registry.npmjs.org/@girs/nm-1.0/-/nm-1.0-1.45.1-3.2.5.tgz" + integrity sha512-zJFOLfJpzJF5SAXOgGXN4diiwl/Z5e0Oo0INiUkg038nnq95N9eHBVbiqM+Q4l/YmcHw65rxPOr7hpPC9dSJwA== + dependencies: + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/pango-1.0@^1.51.0-3.2.5": + version "1.51.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/pango-1.0/-/pango-1.0-1.51.0-3.2.5.tgz" + integrity sha512-ovr00FAEpbEhtsFb+dmZKgKcCrhNyAL26ypgaW+LswUQ7u6v5Qw1xQhWJSbQwEWxJ/ta48PyB/rrCVmNcHnDLg== + dependencies: + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + +"@girs/pangocairo-1.0@^1.0.0-3.2.5": + version "1.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/pangocairo-1.0/-/pangocairo-1.0-1.0.0-3.2.5.tgz" + integrity sha512-bnzn8dbK5DVxtJdpL29oJ3UrlhABJ+8zazHudPHQrwuF6OOu3e37XFW6WCDucxHLQvvy9HTzNqm4xTYg4hAqbw== + dependencies: + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + "@girs/pango-1.0" "^1.51.0-3.2.5" + +"@girs/polkit-1.0@^1.0.0-3.2.5": + version "1.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/polkit-1.0/-/polkit-1.0-1.0.0-3.2.5.tgz" + integrity sha512-sxn1dFyfcpbCYXRoSol9K9hgO5b13wpkxvY73Tmh4HxFVq1GA/V+w9nV05h6xDyAKlc6MsvqLpUCbDAsrkSbfA== + dependencies: + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/polkitagent-1.0@^1.0.0-3.2.5": + version "1.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/polkitagent-1.0/-/polkitagent-1.0-1.0.0-3.2.5.tgz" + integrity sha512-0R/3qtM+l9DgVgyA4PxB77ohS28kcu5WrYLqdnJaZZVPxaDwnntwo+Tdpun3oH4gOtFtVuj9qJ0LthU88gyPww== + dependencies: + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/polkit-1.0" "^1.0.0-3.2.5" + +"@girs/shell-13@^13.0.0-3.2.5": + version "13.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/shell-13/-/shell-13-13.0.0-3.2.5.tgz" + integrity sha512-yuGmkpPG2gy0937D1xggslyg6kcwIFDUfYHLjQNcqLneXjrgyHUYQGRv90GDvdoD5Jl25YT36hb5Yt/cZFch4A== + dependencies: + "@girs/atk-1.0" "^2.50.0-3.2.5" + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/cally-13" "^13.0.0-3.2.5" + "@girs/clutter-13" "^13.0.0-3.2.5" + "@girs/cogl-13" "^13.0.0-3.2.5" + "@girs/coglpango-13" "^13.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gck-2" "^4.1.0-3.2.5" + "@girs/gcr-4" "^4.1.0-3.2.5" + "@girs/gdesktopenums-3.0" "^3.0.0-3.2.5" + "@girs/gdkpixbuf-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/gl-1.0" "^1.0.0-3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gmodule-2.0" "^2.0.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/graphene-1.0" "^1.0.0-3.2.5" + "@girs/gvc-1.0" "^1.0.0-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + "@girs/json-1.0" "^1.7.1-3.2.5" + "@girs/meta-13" "^13.0.0-3.2.5" + "@girs/mtk-13" "^13.0.0-3.2.5" + "@girs/nm-1.0" "^1.45.1-3.2.5" + "@girs/pango-1.0" "^1.51.0-3.2.5" + "@girs/pangocairo-1.0" "^1.0.0-3.2.5" + "@girs/polkit-1.0" "^1.0.0-3.2.5" + "@girs/polkitagent-1.0" "^1.0.0-3.2.5" + "@girs/st-13" "^13.0.0-3.2.5" + "@girs/xfixes-4.0" "^4.0.0-3.2.5" + "@girs/xlib-2.0" "^2.0.0-3.2.5" + +"@girs/shew-0@^0.0.0-3.2.5": + version "0.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/shew-0/-/shew-0-0.0.0-3.2.5.tgz" + integrity sha512-mfuD/PaZaUEvoxm/psn02J039AfgiukAy0LbTUQKIJPSTxkzNJoBgdb+RsQVWnLFha4rXgKRBDCD9T/qR20CGQ== + dependencies: + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gdk-4.0" "^4.0.0-3.2.5" + "@girs/gdkpixbuf-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gmodule-2.0" "^2.0.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/graphene-1.0" "^1.0.0-3.2.5" + "@girs/gsk-4.0" "^4.0.0-3.2.5" + "@girs/gtk-4.0" "^4.12.3-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + "@girs/pango-1.0" "^1.51.0-3.2.5" + "@girs/pangocairo-1.0" "^1.0.0-3.2.5" + +"@girs/st-13@^13.0.0-3.2.5": + version "13.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/st-13/-/st-13-13.0.0-3.2.5.tgz" + integrity sha512-cMG4VBbuPEP0auKkOfFiCcmRpbgpSn4/Z+IvP5m5f7XI1YX1gPYKZl8cEyIEW57+O/lh4mpkDL+AVvepIKFyww== + dependencies: + "@girs/atk-1.0" "^2.50.0-3.2.5" + "@girs/cairo-1.0" "^1.0.0-3.2.5" + "@girs/cally-13" "^13.0.0-3.2.5" + "@girs/clutter-13" "^13.0.0-3.2.5" + "@girs/cogl-13" "^13.0.0-3.2.5" + "@girs/coglpango-13" "^13.0.0-3.2.5" + "@girs/freetype2-2.0" "^2.0.0-3.2.5" + "@girs/gdesktopenums-3.0" "^3.0.0-3.2.5" + "@girs/gdkpixbuf-2.0" "^2.0.0-3.2.5" + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/gl-1.0" "^1.0.0-3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gmodule-2.0" "^2.0.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + "@girs/graphene-1.0" "^1.0.0-3.2.5" + "@girs/harfbuzz-0.0" "^8.2.1-3.2.5" + "@girs/json-1.0" "^1.7.1-3.2.5" + "@girs/meta-13" "^13.0.0-3.2.5" + "@girs/mtk-13" "^13.0.0-3.2.5" + "@girs/pango-1.0" "^1.51.0-3.2.5" + "@girs/pangocairo-1.0" "^1.0.0-3.2.5" + "@girs/xfixes-4.0" "^4.0.0-3.2.5" + "@girs/xlib-2.0" "^2.0.0-3.2.5" + +"@girs/upowerglib-1.0@^0.99.1-3.2.5": + version "0.99.1-3.2.5" + resolved "https://registry.npmjs.org/@girs/upowerglib-1.0/-/upowerglib-1.0-0.99.1-3.2.5.tgz" + integrity sha512-jYSmmi5X5orddQVkpaS6RGDBi3k4bxrrducNiahnpaM6YdtIjET9BMcBRW+mDqLxZxPwGd0ThKM5eP6TX15CEA== + dependencies: + "@girs/gio-2.0" "^2.78.0-3.2.5" + "@girs/gjs" "^3.2.5" + "@girs/glib-2.0" "^2.78.0-3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/xfixes-4.0@^4.0.0-3.2.5": + version "4.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/xfixes-4.0/-/xfixes-4.0-4.0.0-3.2.5.tgz" + integrity sha512-gUdBen1dAQTP+OfwS6/6swYp9+cuy3g0tZzAVzur48T62UB5prwnki/EBMYWbqaH1Hn+JGLTwKXHvGkdmTPxCQ== + dependencies: + "@girs/gjs" "^3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@girs/xlib-2.0@^2.0.0-3.2.5": + version "2.0.0-3.2.5" + resolved "https://registry.npmjs.org/@girs/xlib-2.0/-/xlib-2.0-2.0.0-3.2.5.tgz" + integrity sha512-nTfP70qGiVV+g13hxe7s923VSCNRLIbhetJQO0z8uSuvHXKGpQFVW/R4GcePNjizbVWu7FSArzF2vPkvfp8UsA== + dependencies: + "@girs/gjs" "^3.2.5" + "@girs/gobject-2.0" "^2.78.0-3.2.5" + +"@humanwhocodes/config-array@^0.11.13": + version "0.11.13" + resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz" + integrity sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ== + dependencies: + "@humanwhocodes/object-schema" "^2.0.1" debug "^4.1.1" minimatch "^3.0.5" @@ -58,10 +675,10 @@ resolved "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^1.2.1": - version "1.2.1" - resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz" - integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@humanwhocodes/object-schema@^2.0.1": + version "2.0.1" + resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz" + integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -85,115 +702,120 @@ fastq "^1.6.0" "@types/json-schema@^7.0.9": - version "7.0.12" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz" - integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== + version "7.0.15" + resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/semver@^7.3.12": - version "7.5.0" - resolved "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz" - integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== + version "7.5.5" + resolved "https://registry.npmjs.org/@types/semver/-/semver-7.5.5.tgz" + integrity sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg== "@typescript-eslint/eslint-plugin@^5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.60.1.tgz" - integrity sha512-KSWsVvsJsLJv3c4e73y/Bzt7OpqMCADUO846bHcuWYSYM19bldbAeDv7dYyV0jwkbMfJ2XdlzwjhXtuD7OY6bw== + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz" + integrity sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag== dependencies: "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.60.1" - "@typescript-eslint/type-utils" "5.60.1" - "@typescript-eslint/utils" "5.60.1" + "@typescript-eslint/scope-manager" "5.62.0" + "@typescript-eslint/type-utils" "5.62.0" + "@typescript-eslint/utils" "5.62.0" debug "^4.3.4" - grapheme-splitter "^1.0.4" + graphemer "^1.4.0" ignore "^5.2.0" natural-compare-lite "^1.4.0" semver "^7.3.7" tsutils "^3.21.0" "@typescript-eslint/parser@^5.0.0", "@typescript-eslint/parser@^5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.60.1.tgz" - integrity sha512-pHWlc3alg2oSMGwsU/Is8hbm3XFbcrb6P5wIxcQW9NsYBfnrubl/GhVVD/Jm/t8HXhA2WncoIRfBtnCgRGV96Q== + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz" + integrity sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA== dependencies: - "@typescript-eslint/scope-manager" "5.60.1" - "@typescript-eslint/types" "5.60.1" - "@typescript-eslint/typescript-estree" "5.60.1" + "@typescript-eslint/scope-manager" "5.62.0" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/typescript-estree" "5.62.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.60.1.tgz" - integrity sha512-Dn/LnN7fEoRD+KspEOV0xDMynEmR3iSHdgNsarlXNLGGtcUok8L4N71dxUgt3YvlO8si7E+BJ5Fe3wb5yUw7DQ== +"@typescript-eslint/scope-manager@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz" + integrity sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w== dependencies: - "@typescript-eslint/types" "5.60.1" - "@typescript-eslint/visitor-keys" "5.60.1" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/visitor-keys" "5.62.0" -"@typescript-eslint/type-utils@5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.60.1.tgz" - integrity sha512-vN6UztYqIu05nu7JqwQGzQKUJctzs3/Hg7E2Yx8rz9J+4LgtIDFWjjl1gm3pycH0P3mHAcEUBd23LVgfrsTR8A== +"@typescript-eslint/type-utils@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz" + integrity sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew== dependencies: - "@typescript-eslint/typescript-estree" "5.60.1" - "@typescript-eslint/utils" "5.60.1" + "@typescript-eslint/typescript-estree" "5.62.0" + "@typescript-eslint/utils" "5.62.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.60.1.tgz" - integrity sha512-zDcDx5fccU8BA0IDZc71bAtYIcG9PowaOwaD8rjYbqwK7dpe/UMQl3inJ4UtUK42nOCT41jTSCwg76E62JpMcg== +"@typescript-eslint/types@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz" + integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== -"@typescript-eslint/typescript-estree@5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.60.1.tgz" - integrity sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw== +"@typescript-eslint/typescript-estree@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz" + integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA== dependencies: - "@typescript-eslint/types" "5.60.1" - "@typescript-eslint/visitor-keys" "5.60.1" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/visitor-keys" "5.62.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.60.1.tgz" - integrity sha512-tiJ7FFdFQOWssFa3gqb94Ilexyw0JVxj6vBzaSpfN/8IhoKkDuSAenUKvsSHw2A/TMpJb26izIszTXaqygkvpQ== +"@typescript-eslint/utils@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz" + integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.60.1" - "@typescript-eslint/types" "5.60.1" - "@typescript-eslint/typescript-estree" "5.60.1" + "@typescript-eslint/scope-manager" "5.62.0" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/typescript-estree" "5.62.0" eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.60.1": - version "5.60.1" - resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.60.1.tgz" - integrity sha512-xEYIxKcultP6E/RMKqube11pGjXH1DCo60mQoWhVYyKfLkwbIVVjYxmOenNMxILx0TjCujPTjjnTIVzm09TXIw== +"@typescript-eslint/visitor-keys@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz" + integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw== dependencies: - "@typescript-eslint/types" "5.60.1" + "@typescript-eslint/types" "5.62.0" eslint-visitor-keys "^3.3.0" +"@ungap/structured-clone@^1.2.0": + version "1.2.0" + resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz" + integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== + acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== "acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.9.0: - version "8.9.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz" - integrity sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ== + version "8.11.2" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz" + integrity sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w== adm-zip@^0.5.10: version "0.5.10" resolved "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz" integrity sha512-x0HvcHqVJNTPk/Bw8JbLWlWoo6Wwnsug0fnYYro1HBrjxZ3G7/AZk7Ahv8JwDe1uIcz8eBqvu86FuF1POiG7vQ== -ajv@^6.10.0, ajv@^6.12.4: +ajv@^6.12.4: version "6.12.6" resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -310,39 +932,49 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -esbuild@^0.17.19: - version "0.17.19" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz" - integrity sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw== +esbuild@^0.19.5: + version "0.19.6" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.19.6.tgz" + integrity sha512-Xl7dntjA2OEIvpr9j0DVxxnog2fyTGnyVoQXAMQI6eR3mf9zCQds7VIKUDCotDgE/p4ncTgeRqgX8t5d6oP4Gw== optionalDependencies: - "@esbuild/android-arm" "0.17.19" - "@esbuild/android-arm64" "0.17.19" - "@esbuild/android-x64" "0.17.19" - "@esbuild/darwin-arm64" "0.17.19" - "@esbuild/darwin-x64" "0.17.19" - "@esbuild/freebsd-arm64" "0.17.19" - "@esbuild/freebsd-x64" "0.17.19" - "@esbuild/linux-arm" "0.17.19" - "@esbuild/linux-arm64" "0.17.19" - "@esbuild/linux-ia32" "0.17.19" - "@esbuild/linux-loong64" "0.17.19" - "@esbuild/linux-mips64el" "0.17.19" - "@esbuild/linux-ppc64" "0.17.19" - "@esbuild/linux-riscv64" "0.17.19" - "@esbuild/linux-s390x" "0.17.19" - "@esbuild/linux-x64" "0.17.19" - "@esbuild/netbsd-x64" "0.17.19" - "@esbuild/openbsd-x64" "0.17.19" - "@esbuild/sunos-x64" "0.17.19" - "@esbuild/win32-arm64" "0.17.19" - "@esbuild/win32-ia32" "0.17.19" - "@esbuild/win32-x64" "0.17.19" + "@esbuild/android-arm" "0.19.6" + "@esbuild/android-arm64" "0.19.6" + "@esbuild/android-x64" "0.19.6" + "@esbuild/darwin-arm64" "0.19.6" + "@esbuild/darwin-x64" "0.19.6" + "@esbuild/freebsd-arm64" "0.19.6" + "@esbuild/freebsd-x64" "0.19.6" + "@esbuild/linux-arm" "0.19.6" + "@esbuild/linux-arm64" "0.19.6" + "@esbuild/linux-ia32" "0.19.6" + "@esbuild/linux-loong64" "0.19.6" + "@esbuild/linux-mips64el" "0.19.6" + "@esbuild/linux-ppc64" "0.19.6" + "@esbuild/linux-riscv64" "0.19.6" + "@esbuild/linux-s390x" "0.19.6" + "@esbuild/linux-x64" "0.19.6" + "@esbuild/netbsd-x64" "0.19.6" + "@esbuild/openbsd-x64" "0.19.6" + "@esbuild/sunos-x64" "0.19.6" + "@esbuild/win32-arm64" "0.19.6" + "@esbuild/win32-ia32" "0.19.6" + "@esbuild/win32-x64" "0.19.6" escape-string-regexp@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +eslint-config-prettier@^9.0.0: + version "9.0.0" + resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz" + integrity sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw== + +eslint-plugin-promise@^6.1.1: + version "6.1.1" + resolved "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz" + integrity sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig== + eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" @@ -351,40 +983,41 @@ eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-scope@^7.2.0: - version "7.2.0" - resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz" - integrity sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw== +eslint-scope@^7.2.2: + version "7.2.2" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz" + integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: - version "3.4.1" - resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz" - integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: + version "3.4.3" + resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint@*, "eslint@^6.0.0 || ^7.0.0 || ^8.0.0", "eslint@^6.0.0 || ^7.0.0 || >=8.0.0", eslint@^8.44.0: - version "8.44.0" - resolved "https://registry.npmjs.org/eslint/-/eslint-8.44.0.tgz" - integrity sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A== +eslint@*, "eslint@^6.0.0 || ^7.0.0 || ^8.0.0", "eslint@^6.0.0 || ^7.0.0 || >=8.0.0", "eslint@^7.0.0 || ^8.0.0", eslint@^8.51.0, eslint@>=7.0.0: + version "8.54.0" + resolved "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz" + integrity sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.4.0" - "@eslint/eslintrc" "^2.1.0" - "@eslint/js" "8.44.0" - "@humanwhocodes/config-array" "^0.11.10" + "@eslint-community/regexpp" "^4.6.1" + "@eslint/eslintrc" "^2.1.3" + "@eslint/js" "8.54.0" + "@humanwhocodes/config-array" "^0.11.13" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" - ajv "^6.10.0" + "@ungap/structured-clone" "^1.2.0" + ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" debug "^4.3.2" doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.2.0" - eslint-visitor-keys "^3.4.1" - espree "^9.6.0" + eslint-scope "^7.2.2" + eslint-visitor-keys "^3.4.3" + espree "^9.6.1" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -394,7 +1027,6 @@ eslint@*, "eslint@^6.0.0 || ^7.0.0 || ^8.0.0", "eslint@^6.0.0 || ^7.0.0 || >=8.0 globals "^13.19.0" graphemer "^1.4.0" ignore "^5.2.0" - import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" is-path-inside "^3.0.3" @@ -406,13 +1038,12 @@ eslint@*, "eslint@^6.0.0 || ^7.0.0 || ^8.0.0", "eslint@^6.0.0 || ^7.0.0 || >=8.0 natural-compare "^1.4.0" optionator "^0.9.3" strip-ansi "^6.0.1" - strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^9.6.0: - version "9.6.0" - resolved "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz" - integrity sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A== +espree@^9.6.0, espree@^9.6.1: + version "9.6.1" + resolved "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz" + integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== dependencies: acorn "^8.9.0" acorn-jsx "^5.3.2" @@ -458,9 +1089,9 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-glob@^3.2.9: - version "3.3.0" - resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz" - integrity sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA== + version "3.3.2" + resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz" + integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -508,17 +1139,18 @@ find-up@^5.0.0: path-exists "^4.0.0" flat-cache@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz" - integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + version "3.2.0" + resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz" + integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== dependencies: - flatted "^3.1.0" + flatted "^3.2.9" + keyv "^4.5.3" rimraf "^3.0.2" -flatted@^3.1.0: - version "3.2.7" - resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz" - integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== +flatted@^3.2.9: + version "3.2.9" + resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz" + integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== fs.realpath@^1.0.0: version "1.0.0" @@ -552,9 +1184,9 @@ glob@^7.1.3: path-is-absolute "^1.0.0" globals@^13.19.0: - version "13.20.0" - resolved "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz" - integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== + version "13.23.0" + resolved "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz" + integrity sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA== dependencies: type-fest "^0.20.2" @@ -570,11 +1202,6 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -grapheme-splitter@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz" - integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== - graphemer@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz" @@ -586,11 +1213,11 @@ has-flag@^4.0.0: integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== ignore@^5.2.0: - version "5.2.4" - resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + version "5.3.0" + resolved "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz" + integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== -import-fresh@^3.0.0, import-fresh@^3.2.1: +import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -650,6 +1277,11 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" @@ -660,6 +1292,13 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== +keyv@^4.5.3: + version "4.5.4" + resolved "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== + dependencies: + json-buffer "3.0.1" + levn@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz" @@ -792,10 +1431,15 @@ prelude-ls@^1.2.1: resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier@^3.0.3: + version "3.1.0" + resolved "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz" + integrity sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw== + punycode@^2.1.0: - version "2.3.0" - resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz" - integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== + version "2.3.1" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== queue-microtask@^1.2.2: version "1.2.3" @@ -827,9 +1471,9 @@ run-parallel@^1.1.9: queue-microtask "^1.2.2" semver@^7.3.7: - version "7.5.3" - resolved "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz" - integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== + version "7.5.4" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" @@ -857,7 +1501,7 @@ strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: +strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -905,10 +1549,10 @@ type-fest@^0.20.2: resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -typescript@^5.1.6, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta": - version "5.1.6" - resolved "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz" - integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== +typescript@^5.2.2, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta": + version "5.3.2" + resolved "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz" + integrity sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ== uri-js@^4.2.2: version "4.4.1" diff --git a/rog-anime/src/data.rs b/rog-anime/src/data.rs index 638aebb1..eff64b83 100644 --- a/rog-anime/src/data.rs +++ b/rog-anime/src/data.rs @@ -7,7 +7,7 @@ use log::info; use serde_derive::{Deserialize, Serialize}; use typeshare::typeshare; #[cfg(feature = "dbus")] -use zbus::zvariant::Type; +use zbus::zvariant::{OwnedValue, Type, Value}; use crate::error::{AnimeError, Result}; use crate::usb::{AnimAwake, AnimBooting, AnimShutdown, AnimSleeping, Brightness}; @@ -29,7 +29,7 @@ pub const USB_PREFIX2: [u8; 7] = [0x5e, 0xc0, 0x02, 0x74, 0x02, 0x73, 0x02]; pub const USB_PREFIX3: [u8; 7] = [0x5e, 0xc0, 0x02, 0xe7, 0x04, 0x73, 0x02]; #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type))] +#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))] #[typeshare] #[derive(Default, Deserialize, PartialEq, Eq, Clone, Copy, Serialize, Debug)] pub struct Animations { diff --git a/rog-anime/src/usb.rs b/rog-anime/src/usb.rs index 13cb6b51..3f15e26f 100644 --- a/rog-anime/src/usb.rs +++ b/rog-anime/src/usb.rs @@ -14,7 +14,7 @@ use dmi_id::DMIID; use serde_derive::{Deserialize, Serialize}; use typeshare::typeshare; #[cfg(feature = "dbus")] -use zbus::zvariant::Type; +use zbus::zvariant::{OwnedValue, Type, Value}; use crate::error::AnimeError; use crate::AnimeType; @@ -24,16 +24,20 @@ const DEV_PAGE: u8 = 0x5e; pub const VENDOR_ID: u16 = 0x0b05; pub const PROD_ID: u16 = 0x193b; -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "u") +)] #[typeshare] #[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)] /// Base LED brightness of the display pub enum Brightness { - Off, - Low, + Off = 0, + Low = 1, #[default] - Med, - High, + Med = 2, + High = 3, } impl FromStr for Brightness { @@ -61,13 +65,17 @@ impl From for Brightness { } } -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "s") +)] #[typeshare] #[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)] pub enum AnimBooting { #[default] - GlitchConstruction, - StaticEmergence, + GlitchConstruction = 0, + StaticEmergence = 1, } impl FromStr for AnimBooting { @@ -82,13 +90,17 @@ impl FromStr for AnimBooting { } } -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "s") +)] #[typeshare] #[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)] pub enum AnimAwake { #[default] - BinaryBannerScroll, - RogLogoGlitch, + BinaryBannerScroll = 0, + RogLogoGlitch = 1, } impl FromStr for AnimAwake { @@ -103,13 +115,17 @@ impl FromStr for AnimAwake { } } -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "s") +)] #[typeshare] #[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)] pub enum AnimSleeping { #[default] - BannerSwipe, - Starfield, + BannerSwipe = 0, + Starfield = 1, } impl FromStr for AnimSleeping { @@ -124,13 +140,17 @@ impl FromStr for AnimSleeping { } } -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "s") +)] #[typeshare] #[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Deserialize, Serialize)] pub enum AnimShutdown { #[default] - GlitchOut, - SeeYa, + GlitchOut = 0, + SeeYa = 1, } impl FromStr for AnimShutdown { diff --git a/rog-aura/src/aura_detection.rs b/rog-aura/src/aura_detection.rs index 637bca39..72fb6f38 100644 --- a/rog-aura/src/aura_detection.rs +++ b/rog-aura/src/aura_detection.rs @@ -2,7 +2,7 @@ use dmi_id::DMIID; use log::{error, info, warn}; use serde_derive::{Deserialize, Serialize}; use typeshare::typeshare; -use zbus::zvariant::Type; +use zbus::zvariant::{OwnedValue, Type, Value}; use crate::usb::AuraDevice; use crate::{AdvancedAuraType, AuraModeNum, AuraZone}; @@ -25,20 +25,24 @@ pub struct LedSupportFile(Vec); /// The powerr zones this laptop supports #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "s") +)] #[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Default, Copy, Clone)] pub enum PowerZones { /// The logo on some laptop lids #[default] - Logo, + Logo = 0, /// The full keyboard (not zones) - Keyboard, + Keyboard = 1, /// The lightbar, typically on the front of the laptop - Lightbar, + Lightbar = 2, /// The leds that may be placed around the edge of the laptop lid - Lid, + Lid = 3, /// The led strip on the rear of some laptops - RearGlow, + RearGlow = 4, } #[derive(Debug, Clone, Default, PartialEq, Eq, Deserialize, Serialize)] diff --git a/rog-aura/src/builtin_modes.rs b/rog-aura/src/builtin_modes.rs index 56685264..a021a8da 100644 --- a/rog-aura/src/builtin_modes.rs +++ b/rog-aura/src/builtin_modes.rs @@ -10,24 +10,48 @@ use std::str::FromStr; use serde_derive::{Deserialize, Serialize}; use typeshare::typeshare; #[cfg(feature = "dbus")] -use zbus::zvariant::Type; +use zbus::zvariant::{OwnedValue, Type, Value}; use crate::error::Error; use crate::LED_MSG_LEN; #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "u") +)] pub enum LedBrightness { - Off, - Low, + Off = 0, + Low = 1, #[default] - Med, - High, + Med = 2, + High = 3, } -impl From for LedBrightness { - fn from(bright: u32) -> Self { +impl LedBrightness { + pub const fn next(&self) -> Self { + match self { + Self::Off => Self::Low, + Self::Low => Self::Med, + Self::Med => Self::High, + Self::High => Self::Off, + } + } + + pub const fn prev(&self) -> Self { + match self { + Self::Off => Self::High, + Self::Low => Self::Off, + Self::Med => Self::Low, + Self::High => Self::Med, + } + } +} + +impl From for LedBrightness { + fn from(bright: u8) -> Self { match bright { 0 => LedBrightness::Off, 1 => LedBrightness::Low, @@ -37,8 +61,14 @@ impl From for LedBrightness { } } +impl From for u8 { + fn from(l: LedBrightness) -> Self { + l as u8 + } +} + #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type))] +#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))] #[derive(Debug, Clone, PartialEq, Eq, Copy, Deserialize, Serialize)] pub struct Colour { pub r: u8, @@ -99,7 +129,11 @@ impl From for [u8; 3] { } #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "s") +)] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)] pub enum Speed { Low = 0xe1, @@ -135,14 +169,18 @@ impl From for u8 { /// /// Enum corresponds to the required integer value #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "s") +)] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)] pub enum Direction { #[default] - Right, - Left, - Up, - Down, + Right = 0, + Left = 1, + Up = 2, + Down = 3, } impl FromStr for Direction { @@ -162,7 +200,11 @@ impl FromStr for Direction { /// Enum of modes that convert to the actual number required by a USB HID packet #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "u") +)] #[derive( Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy, Deserialize, Serialize, )] @@ -250,28 +292,38 @@ impl From for AuraModeNum { } } +impl From for AuraModeNum { + fn from(value: AuraEffect) -> Self { + value.mode + } +} + /// Base effects have no zoning, while multizone is 1-4 #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "s") +)] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)] pub enum AuraZone { /// Used if keyboard has no zones, or if setting all #[default] - None, + None = 0, /// Leftmost zone - Key1, + Key1 = 1, /// Zone after leftmost - Key2, + Key2 = 2, /// Zone second from right - Key3, + Key3 = 3, /// Rightmost zone - Key4, + Key4 = 4, /// Logo on the lid (or elsewhere?) - Logo, + Logo = 5, /// The left part of a lightbar (typically on the front of laptop) - BarLeft, + BarLeft = 6, /// The right part of a lightbar - BarRight, + BarRight = 7, } impl FromStr for AuraZone { @@ -299,7 +351,7 @@ impl FromStr for AuraZone { /// // let bytes: [u8; LED_MSG_LEN] = mode.into(); /// ``` #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type))] +#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))] #[derive(Debug, Clone, Deserialize, Serialize)] pub struct AuraEffect { /// The effect type @@ -354,6 +406,12 @@ impl Default for AuraEffect { } } +impl Display for AuraEffect { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self) + } +} + pub struct AuraParameters { pub zone: bool, pub colour1: bool, diff --git a/rog-aura/src/power.rs b/rog-aura/src/power.rs index c3c26ad9..944446da 100644 --- a/rog-aura/src/power.rs +++ b/rog-aura/src/power.rs @@ -3,12 +3,12 @@ use std::fmt::Debug; use serde::{Deserialize, Serialize}; use typeshare::typeshare; #[cfg(feature = "dbus")] -use zbus::zvariant::Type; +use zbus::zvariant::{OwnedValue, Type, Value}; use crate::aura_detection::PowerZones; #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type))] +#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct KbAuraPowerState { pub zone: PowerZones, @@ -95,7 +95,7 @@ impl KbAuraPowerState { /// |00000000| 00000000| 00000000| 00000100|sleep_rear| /// |00000000| 00000000| 00000000| 00001000|shut_rear_| #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type))] +#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))] #[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct AuraPower { pub keyboard: KbAuraPowerState, diff --git a/rog-aura/src/usb.rs b/rog-aura/src/usb.rs index bd3408d9..7402b3ed 100644 --- a/rog-aura/src/usb.rs +++ b/rog-aura/src/usb.rs @@ -4,7 +4,7 @@ use std::ops::{BitAnd, BitOr}; use serde::{Deserialize, Serialize}; use typeshare::typeshare; #[cfg(feature = "dbus")] -use zbus::zvariant::Type; +use zbus::zvariant::{OwnedValue, Type, Value}; use crate::power::AuraPower; @@ -26,19 +26,23 @@ pub const fn aura_brightness_bytes(brightness: u8) -> [u8; 17] { } #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "s") +)] #[derive(Copy, Clone, PartialEq, Eq, Serialize, Deserialize, Default)] pub enum AuraDevice { - Tuf, - X1854, - X1869, - X1866, - X18c6, + Tuf = 0, + X1854 = 1, + X1869 = 2, + X1866 = 3, + X18c6 = 4, #[default] - X19b6, - X1a30, - X1abe, - Unknown, + X19b6 = 5, + X1a30 = 6, + X1abe = 7, + Unknown = 99, } impl AuraDevice { @@ -116,7 +120,7 @@ impl Debug for AuraDevice { /// This struct is intended as a helper to pass args to generic dbus interface #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type))] +#[cfg_attr(feature = "dbus", derive(Type, Value, OwnedValue))] #[derive(Clone, Default, Debug, Serialize, Deserialize)] pub struct AuraPowerDev { /// TUF laptops use a similar style of control to the older ROG devices but @@ -130,14 +134,18 @@ pub struct AuraPowerDev { } #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "s") +)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[repr(u32)] pub enum AuraDevTuf { - Boot, - Awake, - Sleep, - Keyboard, + Boot = 0, + Awake = 1, + Sleep = 2, + Keyboard = 3, } impl AuraDevTuf { @@ -161,7 +169,11 @@ impl AuraDevTuf { /// | 0011, 0000 | 0000, 1000 | 0000, 0100 | Sleep | 30,08,04 | /// | 1111, 1111 | 0001, 1111 | 0000, 1111 | all on | | #[typeshare] -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] +#[cfg_attr( + feature = "dbus", + derive(Type, Value, OwnedValue), + zvariant(signature = "s") +)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[repr(u32)] pub enum AuraDevRog1 { diff --git a/rog-control-center/src/app.rs b/rog-control-center/src/app.rs index 43bfc11e..b9e22e06 100644 --- a/rog-control-center/src/app.rs +++ b/rog-control-center/src/app.rs @@ -5,7 +5,7 @@ use std::time::{Duration, Instant}; use egui::{Button, RichText}; use rog_aura::layouts::KeyLayout; -use rog_platform::supported::SupportedFunctions; +use rog_platform::platform::Properties; use crate::config::Config; use crate::error::Result; @@ -15,7 +15,6 @@ use crate::{Page, RogDbusClientBlocking}; pub struct RogApp { pub page: Page, pub states: Arc>, - pub supported: SupportedFunctions, // TODO: can probably just open and read whenever pub config: Config, /// Oscillator in percentage @@ -26,6 +25,8 @@ pub struct RogApp { pub oscillator_freq: Arc, /// A toggle that toggles true/false when the oscillator reaches 0 pub oscillator_toggle: Arc, + pub supported_interfaces: Vec, + pub supported_properties: Vec, } impl RogApp { @@ -36,7 +37,8 @@ impl RogApp { _cc: &eframe::CreationContext<'_>, ) -> Result { let (dbus, _) = RogDbusClientBlocking::new()?; - let supported = dbus.proxies().supported().supported_functions()?; + let supported_interfaces = dbus.proxies().platform().supported_interfaces()?; + let supported_properties = dbus.proxies().platform().supported_properties()?; // Set up an oscillator to run on a thread. // Helpful for visual effects like colour pulse. @@ -87,7 +89,8 @@ impl RogApp { }); Ok(Self { - supported, + supported_interfaces, + supported_properties, states, page: Page::System, config, @@ -166,7 +169,7 @@ impl eframe::App for RogApp { Page::AppSettings => self.app_settings_page(&mut states, ctx), Page::System => self.system_page(&mut states, ctx), Page::AuraEffects => self.aura_page(&mut states, ctx), - Page::AnimeMatrix => todo!(), + Page::AnimeMatrix => self.anime_page(ctx), Page::FanCurves => self.fan_curve_page(&mut states, ctx), }; } diff --git a/rog-control-center/src/main.rs b/rog-control-center/src/main.rs index f38e3cdd..1c4ec0a0 100644 --- a/rog-control-center/src/main.rs +++ b/rog-control-center/src/main.rs @@ -22,7 +22,6 @@ use rog_control_center::{ get_ipc_file, on_tmp_dir_exists, print_versions, RogApp, RogDbusClientBlocking, SHOWING_GUI, SHOW_GUI, }; -use rog_platform::supported::SupportedFunctions; use tokio::runtime::Runtime; #[cfg(not(feature = "mocking"))] @@ -82,7 +81,7 @@ fn main() -> Result<()> { }) .unwrap(); - let supported = match dbus.proxies().supported().supported_functions() { + let supported_properties = match dbus.proxies().platform().supported_properties() { Ok(s) => s, Err(e) => { eframe::run_native( @@ -92,7 +91,7 @@ fn main() -> Result<()> { ) .map_err(|e| error!("{e}")) .ok(); - SupportedFunctions::default() + vec![] } }; @@ -186,11 +185,10 @@ fn main() -> Result<()> { layouts, &enabled_notifications, &config, - &supported, )?; if config.enable_tray_icon { - init_tray(supported, states.clone()); + init_tray(supported_properties, states.clone()); } let mut bg_check_spawned = false; @@ -247,7 +245,6 @@ fn setup_page_state_and_notifs( keyboard_layouts: Vec, enabled_notifications: &Arc>, config: &Config, - supported: &SupportedFunctions, ) -> Result>> { let page_states = Arc::new(Mutex::new(SystemState::new( layout_testing, @@ -256,7 +253,6 @@ fn setup_page_state_and_notifs( enabled_notifications.clone(), config.enable_tray_icon, config.run_in_background, - supported, )?)); start_notifications(config, &page_states, enabled_notifications)?; diff --git a/rog-control-center/src/pages/fan_curve_page.rs b/rog-control-center/src/pages/fan_curve_page.rs index d20d2b0e..f483c246 100644 --- a/rog-control-center/src/pages/fan_curve_page.rs +++ b/rog-control-center/src/pages/fan_curve_page.rs @@ -1,38 +1,35 @@ use egui::{RichText, Ui}; -use rog_platform::supported::SupportedFunctions; +use rog_platform::platform::PlatformPolicy; -use crate::system_state::{FanCurvesState, ProfilesState, SystemState}; +use crate::system_state::{FanCurvesState, SystemState}; use crate::widgets::fan_graphs; use crate::{RogApp, RogDbusClientBlocking}; impl RogApp { pub fn fan_curve_page(&mut self, states: &mut SystemState, ctx: &egui::Context) { - let Self { supported, .. } = self; + if let Some(mut throttle) = states.bios.throttle { + egui::CentralPanel::default().show(ctx, |ui| { + ui.heading("Custom fan curves"); + Self::fan_curve( + &mut throttle, + &mut states.fan_curves, + &states.asus_dbus, + &mut states.error, + ui, + ); - egui::CentralPanel::default().show(ctx, |ui| { - ui.heading("Custom fan curves"); - Self::fan_curve( - supported, - &mut states.profiles, - &mut states.fan_curves, - &states.asus_dbus, - &mut states.error, - ui, - ); - - fan_graphs( - supported, - &mut states.fan_curves, - &states.asus_dbus, - &mut states.error, - ui, - ); - }); + fan_graphs( + &mut states.fan_curves, + &states.asus_dbus, + &mut states.error, + ui, + ); + }); + } } fn fan_curve( - supported: &SupportedFunctions, - profiles: &mut ProfilesState, + current: &mut PlatformPolicy, curves: &mut FanCurvesState, dbus: &RogDbusClientBlocking<'_>, do_error: &mut Option, @@ -43,7 +40,7 @@ impl RogApp { let mut changed = false; ui.horizontal(|ui| { ui.label("Current profile: "); - ui.label(RichText::new(format!("{}", profiles.current)).strong()); + ui.label(RichText::new(format!("{}", current)).strong()); }); // ui.horizontal(|ui| { @@ -64,9 +61,9 @@ impl RogApp { // } // }; - // if let Some(curves) = curves.curves.get_mut(&profiles.current) { + // if let Some(curves) = curves.curves.get_mut(¤t) { // for curve in curves.iter_mut() { - // fan_curve_enable(profiles.current, curve.fan, curve.enabled); + // fan_curve_enable(current, curve.fan, curve.enabled); // } // } // }); @@ -75,7 +72,7 @@ impl RogApp { ui.label("Enabled fan-curves: "); let mut checked = false; let mut label = String::default(); - if let Some(curves) = curves.curves.get_mut(&profiles.current) { + if let Some(curves) = curves.curves.get_mut(current) { for curve in curves.iter() { label.push_str(&<&str>::from(curve.fan).to_ascii_uppercase()); label.push(' '); @@ -94,8 +91,8 @@ impl RogApp { .changed() { dbus.proxies() - .profile() - .set_fan_curves_enabled(profiles.current, checked) + .fan_curves() + .set_fan_curves_enabled(*current, checked) .map_err(|err| { *do_error = Some(err.to_string()); }) @@ -108,7 +105,7 @@ impl RogApp { let selected_profile = curves.show_curve; let selected_pu = curves.show_graph; - match FanCurvesState::new(supported, dbus) { + match FanCurvesState::new(dbus) { Ok(f) => *curves = f, Err(e) => *do_error = Some(e.to_string()), } diff --git a/rog-control-center/src/pages/system_page.rs b/rog-control-center/src/pages/system_page.rs index 203785cb..c66dba7a 100644 --- a/rog-control-center/src/pages/system_page.rs +++ b/rog-control-center/src/pages/system_page.rs @@ -1,11 +1,9 @@ use crate::system_state::SystemState; -use crate::widgets::{anime_power_group, aura_power_group, platform_profile, rog_bios_group}; +use crate::widgets::{anime_power_group, platform_profile, rog_bios_group}; use crate::RogApp; impl RogApp { pub fn system_page(&mut self, states: &mut SystemState, ctx: &egui::Context) { - let Self { supported, .. } = self; - egui::CentralPanel::default().show(ctx, |ui| { ui.heading("Laptop settings"); @@ -17,26 +15,28 @@ impl RogApp { .show(ui, |ui| { ui.vertical(|ui| { ui.separator(); - if supported.platform_profile.platform_profile { - platform_profile(states, ui); + // if self.supported_interfaces { + platform_profile(states, ui); + // } + }); + ui.vertical(|ui| { + ui.separator(); + if self.supported_interfaces.contains(&"Aura".to_string()) { + // aura_power_group(states, ui); } }); + ui.end_row(); + ui.vertical(|ui| { ui.separator(); - aura_power_group(supported, states, ui); + rog_bios_group(states, ui); }); ui.end_row(); ui.vertical(|ui| { ui.separator(); - rog_bios_group(supported, states, ui); - }); - ui.end_row(); - - ui.vertical(|ui| { - ui.separator(); - if supported.anime_ctrl.0 { - anime_power_group(supported, states, ui); + if self.supported_interfaces.contains(&"Anime".to_string()) { + anime_power_group(states, ui); } }); ui.vertical(|ui| { diff --git a/rog-control-center/src/system_state.rs b/rog-control-center/src/system_state.rs index 216b7c35..507d1f3b 100644 --- a/rog-control-center/src/system_state.rs +++ b/rog-control-center/src/system_state.rs @@ -8,11 +8,10 @@ use log::error; use rog_anime::{Animations, DeviceState}; use rog_aura::layouts::KeyLayout; use rog_aura::usb::AuraPowerDev; -use rog_aura::{AuraEffect, AuraModeNum}; -use rog_platform::platform::GpuMode; -use rog_platform::supported::SupportedFunctions; +use rog_aura::{AuraEffect, AuraModeNum, LedBrightness}; +use rog_platform::platform::{GpuMode, PlatformPolicy}; use rog_profiles::fan_curve_set::CurveData; -use rog_profiles::{FanCurvePU, Profile}; +use rog_profiles::FanCurvePU; use supergfxctl::pci_device::{GfxMode, GfxPower}; #[cfg(not(feature = "mocking"))] use supergfxctl::zbus_proxy::DaemonProxyBlocking as GfxProxyBlocking; @@ -24,111 +23,77 @@ use crate::update_and_notify::EnabledNotifications; use crate::RogDbusClientBlocking; #[derive(Clone, Debug, Default)] -pub struct BiosState { +pub struct PlatformState { /// To be shared to a thread that checks notifications. /// It's a bit general in that it won't provide *what* was /// updated, so the full state needs refresh - pub post_sound: bool, - pub dedicated_gfx: GpuMode, - pub panel_overdrive: bool, - pub mini_led_mode: bool, - pub dgpu_disable: bool, - pub egpu_enable: bool, + pub post_sound: Option, + pub gpu_mux_mode: Option, + pub panel_overdrive: Option, + pub mini_led_mode: Option, + pub dgpu_disable: Option, + pub egpu_enable: Option, + pub throttle: Option, + pub charge_limit: Option, } -impl BiosState { - pub fn new(supported: &SupportedFunctions, dbus: &RogDbusClientBlocking<'_>) -> Result { +impl PlatformState { + pub fn new(dbus: &RogDbusClientBlocking<'_>) -> Result { Ok(Self { - post_sound: if supported.rog_bios_ctrl.post_animation_sound { - dbus.proxies().rog_bios().post_animation_sound()? - } else { - false - }, - dedicated_gfx: if supported.rog_bios_ctrl.gpu_mux { - GpuMode::from(dbus.proxies().rog_bios().gpu_mux_mode()?) - } else { - GpuMode::NotSupported - }, - panel_overdrive: if supported.rog_bios_ctrl.panel_overdrive { - dbus.proxies().rog_bios().panel_od()? - } else { - false - }, - mini_led_mode: if supported.rog_bios_ctrl.mini_led_mode { - dbus.proxies().rog_bios().mini_led_mode()? - } else { - false - }, + post_sound: dbus.proxies().platform().post_animation_sound().ok(), + gpu_mux_mode: dbus + .proxies() + .platform() + .gpu_mux_mode() + .map(GpuMode::from) + .ok(), + panel_overdrive: dbus.proxies().platform().panel_od().ok(), + mini_led_mode: dbus.proxies().platform().mini_led_mode().ok(), // TODO: needs supergfx - dgpu_disable: supported.rog_bios_ctrl.dgpu_disable, - egpu_enable: supported.rog_bios_ctrl.egpu_enable, - }) - } -} - -#[derive(Clone, Debug, Default)] -pub struct ProfilesState { - pub list: Vec, - pub current: Profile, -} - -impl ProfilesState { - pub fn new(supported: &SupportedFunctions, dbus: &RogDbusClientBlocking<'_>) -> Result { - Ok(Self { - list: if supported.platform_profile.platform_profile { - let mut list = dbus.proxies().profile().profiles()?; - list.sort(); - list - } else { - vec![] - }, - current: if supported.platform_profile.platform_profile { - dbus.proxies().profile().active_profile()? - } else { - Profile::Balanced - }, + dgpu_disable: dbus.proxies().platform().dgpu_disable().ok(), + egpu_enable: dbus.proxies().platform().egpu_enable().ok(), + throttle: dbus.proxies().platform().throttle_thermal_policy().ok(), + charge_limit: dbus + .proxies() + .platform() + .charge_control_end_threshold() + .ok(), }) } } #[derive(Clone, Debug, Default)] pub struct FanCurvesState { - pub show_curve: Profile, + pub show_curve: PlatformPolicy, pub show_graph: FanCurvePU, - pub curves: BTreeMap>, + pub curves: BTreeMap>, pub available_fans: HashSet, pub drag_delta: Vec2, } impl FanCurvesState { - pub fn new(supported: &SupportedFunctions, dbus: &RogDbusClientBlocking<'_>) -> Result { - let profiles = if supported.platform_profile.platform_profile { - dbus.proxies().profile().profiles()? - } else { - vec![Profile::Balanced, Profile::Quiet, Profile::Performance] - }; + pub fn new(dbus: &RogDbusClientBlocking<'_>) -> Result { + let profiles = vec![ + PlatformPolicy::Balanced, + PlatformPolicy::Quiet, + PlatformPolicy::Performance, + ]; - let mut curves: BTreeMap> = BTreeMap::new(); + let mut curves: BTreeMap> = BTreeMap::new(); for p in &profiles { - if !supported.platform_profile.fans.is_empty() { - if let Ok(curve) = dbus.proxies().profile().fan_curve_data(*p) { - curves.insert(*p, curve); - } + if let Ok(curve) = dbus.proxies().fan_curves().fan_curve_data(*p) { + curves.insert(*p, curve); } else { - curves.insert(*p, Vec::default()); + curves.insert(*p, Default::default()); } } - let mut available_fans = HashSet::new(); - for fan in supported.platform_profile.fans.iter() { - available_fans.insert(*fan); - } + let available_fans = HashSet::new(); + // for fan in supported.platform_profile.fans.iter() { + // available_fans.insert(*fan); + // } - let show_curve = if !supported.platform_profile.fans.is_empty() { - dbus.proxies().profile().active_profile()? - } else { - Profile::Balanced - }; + let show_curve = dbus.proxies().platform().throttle_thermal_policy()?; Ok(Self { show_curve, @@ -146,7 +111,7 @@ pub struct AuraState { pub modes: BTreeMap, pub enabled: AuraPowerDev, /// Brightness from 0-3 - pub bright: i16, + pub bright: LedBrightness, pub wave_red: [u8; 22], pub wave_green: [u8; 22], pub wave_blue: [u8; 22], @@ -156,18 +121,18 @@ impl AuraState { pub fn new(layout: &KeyLayout, dbus: &RogDbusClientBlocking<'_>) -> Result { Ok(Self { current_mode: if !layout.basic_modes().is_empty() { - dbus.proxies().led().led_mode().unwrap_or_default() + dbus.proxies().aura().led_mode().unwrap_or_default() } else { AuraModeNum::Static }, modes: if !layout.basic_modes().is_empty() { - dbus.proxies().led().led_modes().unwrap_or_default() + dbus.proxies().aura().all_mode_data().unwrap_or_default() } else { BTreeMap::new() }, - enabled: dbus.proxies().led().led_power().unwrap_or_default(), - bright: dbus.proxies().led().led_brightness().unwrap_or_default(), + enabled: dbus.proxies().aura().led_power().unwrap_or_default(), + bright: dbus.proxies().aura().brightness().unwrap_or_default(), wave_red: [0u8; 22], wave_green: [0u8; 22], wave_blue: [0u8; 22], @@ -198,18 +163,14 @@ pub struct AnimeState { } impl AnimeState { - pub fn new(supported: &SupportedFunctions, dbus: &RogDbusClientBlocking<'_>) -> Result { - if supported.anime_ctrl.0 { - let device_state = dbus.proxies().anime().device_state()?; - Ok(Self { - display_enabled: device_state.display_enabled, - display_brightness: device_state.display_brightness as u8, - builtin_anims_enabled: device_state.builtin_anims_enabled, - builtin_anims: device_state.builtin_anims, - }) - } else { - Ok(Default::default()) - } + pub fn new(dbus: &RogDbusClientBlocking<'_>) -> Result { + let device_state = dbus.proxies().anime().device_state()?; + Ok(Self { + display_enabled: device_state.display_enabled, + display_brightness: device_state.display_brightness as u8, + builtin_anims_enabled: device_state.builtin_anims_enabled, + builtin_anims: device_state.builtin_anims, + }) } } @@ -232,7 +193,7 @@ pub struct GfxState { } impl GfxState { - pub fn new(_supported: &SupportedFunctions, dbus: &GfxProxyBlocking<'_>) -> Result { + pub fn new(dbus: &GfxProxyBlocking<'_>) -> Result { Ok(Self { has_supergfx: dbus.mode().is_ok(), mode: dbus.mode().unwrap_or(GfxMode::None), @@ -251,21 +212,6 @@ impl Default for GfxState { } } -#[derive(Clone, Debug, Default)] -pub struct PowerState { - pub charge_limit: u8, - pub ac_power: bool, -} - -impl PowerState { - pub fn new(_supported: &SupportedFunctions, dbus: &RogDbusClientBlocking<'_>) -> Result { - Ok(Self { - charge_limit: dbus.proxies().charge().charge_control_end_threshold()?, - ac_power: dbus.proxies().charge().mains_online()?, - }) - } -} - #[derive(Clone, Debug)] pub struct AuraCreation { /// Specifically for testing the development of keyboard layouts (combined @@ -302,13 +248,11 @@ pub struct SystemState { pub enabled_notifications: Arc>, /// Because much of the app state here is the same as /// `RogBiosSupportedFunctions` we can re-use that structure. - pub bios: BiosState, + pub bios: PlatformState, pub aura: AuraState, pub anime: AnimeState, - pub profiles: ProfilesState, pub fan_curves: FanCurvesState, pub gfx_state: GfxState, - pub power_state: PowerState, pub error: Option, /// Specific field for the tray only so that we can know when it does need /// update. The tray should set this to false when done. @@ -330,66 +274,46 @@ impl SystemState { enabled_notifications: Arc>, tray_enabled: bool, run_in_bg: bool, - supported: &SupportedFunctions, ) -> Result { let (asus_dbus, conn) = RogDbusClientBlocking::new()?; - let mut error = None; let gfx_dbus = GfxProxyBlocking::new(&conn).expect("Couldn't connect to supergfxd"); + let aura = AuraState::new(&keyboard_layout, &asus_dbus) .map_err(|e| { let e = format!("Could not get AuraState state: {e}"); error!("{e}"); - error = Some(e); }) .unwrap_or_default(); Ok(Self { aura_creation: AuraCreation::new(layout_testing, keyboard_layout, keyboard_layouts), enabled_notifications, - power_state: PowerState::new(supported, &asus_dbus) - .map_err(|e| { - let e = format!("Could not get PowerState state: {e}"); - error!("{e}"); - error = Some(e); - }) - .unwrap_or_default(), - bios: BiosState::new(supported, &asus_dbus) + bios: PlatformState::new(&asus_dbus) .map_err(|e| { let e = format!("Could not get BiosState state: {e}"); error!("{e}"); - error = Some(e); }) .unwrap_or_default(), aura, - anime: AnimeState::new(supported, &asus_dbus) + anime: AnimeState::new(&asus_dbus) .map_err(|e| { let e = format!("Could not get AanimeState state: {e}"); error!("{e}"); - error = Some(e); }) .unwrap_or_default(), - profiles: ProfilesState::new(supported, &asus_dbus) - .map_err(|e| { - let e = format!("Could not get ProfilesState state: {e}"); - error!("{e}"); - error = Some(e); - }) - .unwrap_or_default(), - fan_curves: FanCurvesState::new(supported, &asus_dbus) + fan_curves: FanCurvesState::new(&asus_dbus) .map_err(|e| { let e = format!("Could not get FanCurvesState state: {e}"); error!("{e}"); - error = Some(e); }) .unwrap_or_default(), - gfx_state: GfxState::new(supported, &gfx_dbus) + gfx_state: GfxState::new(&gfx_dbus) .map_err(|e| { let e = format!("Could not get supergfxd state: {e}"); error!("{e}"); - error = Some(e); }) .unwrap_or_default(), - error, + error: None, tray_should_update: true, app_should_update: true, asus_dbus, @@ -419,9 +343,10 @@ impl Default for SystemState { keyboard_layout_index: 0, }, enabled_notifications: Default::default(), - bios: BiosState { + bios: PlatformState { post_sound: Default::default(), - dedicated_gfx: GpuMode::NotSupported, + gpu_mux_mode: None, + charge_limit: Some(100), ..Default::default() }, aura: AuraState { @@ -431,9 +356,6 @@ impl Default for SystemState { ..Default::default() }, anime: AnimeState::default(), - profiles: ProfilesState { - ..Default::default() - }, fan_curves: FanCurvesState { ..Default::default() }, @@ -442,10 +364,6 @@ impl Default for SystemState { mode: GfxMode::None, power_status: GfxPower::Unknown, }, - power_state: PowerState { - charge_limit: 99, - ac_power: false, - }, error: Default::default(), tray_should_update: true, app_should_update: true, diff --git a/rog-control-center/src/tray.rs b/rog-control-center/src/tray.rs index 9b5cd923..c0ecf286 100644 --- a/rog-control-center/src/tray.rs +++ b/rog-control-center/src/tray.rs @@ -9,9 +9,8 @@ use gtk::gio::Icon; use gtk::prelude::*; use libappindicator::{AppIndicator, AppIndicatorStatus}; use log::{debug, error, info, trace, warn}; -use rog_dbus::zbus_platform::RogBiosProxyBlocking; -use rog_platform::platform::GpuMode; -use rog_platform::supported::SupportedFunctions; +use rog_dbus::zbus_platform::PlatformProxyBlocking; +use rog_platform::platform::{GpuMode, Properties}; use supergfxctl::actions::UserActionRequired as GfxUserActionRequired; use supergfxctl::pci_device::{GfxMode, GfxPower}; use supergfxctl::zbus_proxy::DaemonProxyBlocking as GfxProxyBlocking; @@ -73,14 +72,15 @@ pub struct ROGTray { tray: AppIndicator, menu: gtk::Menu, icon: &'static str, - bios_proxy: RogBiosProxyBlocking<'static>, + bios_proxy: PlatformProxyBlocking<'static>, gfx_proxy_is_active: bool, gfx_action: Arc>, gfx_proxy: GfxProxyBlocking<'static>, + states: Arc>, } impl ROGTray { - pub fn new() -> Result { + pub fn new(states: Arc>) -> Result { let conn = zbus::blocking::Connection::system().map_err(|e| { error!("ROGTray: {e}"); e @@ -95,13 +95,14 @@ impl ROGTray { tray: AppIndicator::new(TRAY_LABEL, TRAY_APP_ICON), menu: gtk::Menu::new(), icon: TRAY_APP_ICON, - bios_proxy: RogBiosProxyBlocking::new(&conn).map_err(|e| { + bios_proxy: PlatformProxyBlocking::new(&conn).map_err(|e| { error!("ROGTray: {e}"); e })?, gfx_proxy_is_active: gfx_proxy.mode().is_ok(), gfx_action: Arc::new(Mutex::new(GfxUserActionRequired::Nothing)), gfx_proxy, + states, }; Ok(rog_tray) } @@ -219,41 +220,43 @@ impl ROGTray { debug!("ROGTray: built base menu"); } - fn menu_add_charge_limit(&mut self, supported: &SupportedFunctions, limit: u8) { - if supported.charge_ctrl.charge_level_set { - self.add_inactive_label(&format!("Charge limit: {limit}")); - debug!("ROGTray: appended charge limit menu"); - } + fn menu_add_charge_limit(&mut self, limit: u8) { + self.add_inactive_label(&format!("Charge limit: {limit}")); + debug!("ROGTray: appended charge limit menu"); } - fn menu_add_panel_od(&mut self, supported: &SupportedFunctions, panel_od: bool) { - if supported.rog_bios_ctrl.panel_overdrive { - let bios = self.bios_proxy.clone(); - self.add_check_menu_item("Panel Overdrive", panel_od, move |this| { - bios.set_panel_od(this.is_active()) - .map_err(|e| { - error!("ROGTray: set_panel_od: {e}"); - e - }) - .ok(); - }); - debug!("ROGTray: appended panel overdrive menu"); - } + fn menu_add_panel_od(&mut self, panel_od: bool) { + let bios = self.bios_proxy.clone(); + let states = self.states.clone(); + self.add_check_menu_item("Panel Overdrive", panel_od, move |this| { + if let Ok(mut lock) = states.lock() { + lock.tray_should_update = true; + } + bios.set_panel_od(this.is_active()) + .map_err(|e| { + error!("ROGTray: set_panel_od: {e}"); + e + }) + .ok(); + }); + debug!("ROGTray: appended panel overdrive menu"); } - fn menu_add_mini_led_mode(&mut self, supported: &SupportedFunctions, on: bool) { - if supported.rog_bios_ctrl.mini_led_mode { - let bios = self.bios_proxy.clone(); - self.add_check_menu_item("MiniLED mode", on, move |this| { - bios.set_mini_led_mode(this.is_active()) - .map_err(|e| { - error!("ROGTray: set_mini_led_mode: {e}"); - e - }) - .ok(); - }); - debug!("ROGTray: appended miniLED mode menu"); - } + fn menu_add_mini_led_mode(&mut self, on: bool) { + let bios = self.bios_proxy.clone(); + let states = self.states.clone(); + self.add_check_menu_item("MiniLED mode", on, move |this| { + if let Ok(mut lock) = states.lock() { + lock.tray_should_update = true; + } + bios.set_mini_led_mode(this.is_active()) + .map_err(|e| { + error!("ROGTray: set_mini_led_mode: {e}"); + e + }) + .ok(); + }); + debug!("ROGTray: appended miniLED mode menu"); } fn menu_add_supergfx(&mut self, supported_gfx: &[GfxMode], current_mode: GfxMode) { @@ -264,8 +267,12 @@ impl ROGTray { let gfx_dbus = self.gfx_proxy.clone(); let gfx_action = self.gfx_action.clone(); + let states = self.states.clone(); let mut gpu_menu = RadioGroup::new("Integrated", move |_| { if current_mode != GfxMode::Integrated { + if let Ok(mut lock) = states.lock() { + lock.tray_should_update = true; + } if let Ok(res) = gfx_dbus.set_mode(&GfxMode::Integrated).map_err(|e| { error!("ROGTray: srt_mode: {e}"); e @@ -280,8 +287,12 @@ impl ROGTray { let mut func = |menu_mode: GfxMode| { let gfx_dbus = self.gfx_proxy.clone(); let gfx_action = self.gfx_action.clone(); + let states = self.states.clone(); gpu_menu.add(&format!("{menu_mode}"), move |_| { if current_mode != menu_mode { + if let Ok(mut lock) = states.lock() { + lock.tray_should_update = true; + } if let Ok(res) = gfx_dbus.set_mode(&menu_mode).map_err(|e| { error!("ROGTray: set_mode: {e}"); e @@ -332,7 +343,11 @@ impl ROGTray { reboot_required = mode != current_mode; } + let states = self.states.clone(); let mut gpu_menu = RadioGroup::new("Optimus", move |_| { + if let Ok(mut lock) = states.lock() { + lock.tray_should_update = true; + } gfx_dbus .set_gpu_mux_mode(GpuMode::Optimus) .map_err(|e| { @@ -344,7 +359,11 @@ impl ROGTray { }); let gfx_dbus = self.bios_proxy.clone(); + let states = self.states.clone(); gpu_menu.add("Ultimate", move |_| { + if let Ok(mut lock) = states.lock() { + lock.tray_should_update = true; + } gfx_dbus .set_gpu_mux_mode(GpuMode::Discrete) .map_err(|e| { @@ -390,22 +409,28 @@ impl ROGTray { /// Do a flush, build, and update of the tray menu fn rebuild_and_update( &mut self, - supported: &SupportedFunctions, + supported_properties: &[Properties], supported_gfx: &[GfxMode], current_gfx_mode: GfxMode, - charge_limit: u8, - panel_od: bool, - mini_led: bool, + charge_limit: Option, + panel_od: Option, + mini_led: Option, ) { self.menu_clear(); self.menu_add_base(); - self.menu_add_charge_limit(supported, charge_limit); - self.menu_add_panel_od(supported, panel_od); - self.menu_add_mini_led_mode(supported, mini_led); + if let Some(charge_limit) = charge_limit { + self.menu_add_charge_limit(charge_limit); + } + if let Some(panel_od) = panel_od { + self.menu_add_panel_od(panel_od); + } + if let Some(mini_led) = mini_led { + self.menu_add_mini_led_mode(mini_led); + } if self.gfx_proxy_is_active { // Add a supergfxctl specific menu self.menu_add_supergfx(supported_gfx, current_gfx_mode); - } else if supported.rog_bios_ctrl.gpu_mux { + } else if supported_properties.contains(&Properties::GpuMuxMode) { self.menu_add_mux(current_gfx_mode); } self.menu_update(); @@ -413,7 +438,7 @@ impl ROGTray { } /// The tray is controlled somewhat by `Arc>` -pub fn init_tray(supported: SupportedFunctions, states: Arc>) { +pub fn init_tray(supported_properties: Vec, states: Arc>) { std::thread::spawn(move || { let gtk_init = gtk::init().map_err(|e| { error!("ROGTray: gtk init {e}"); @@ -424,7 +449,7 @@ pub fn init_tray(supported: SupportedFunctions, states: Arc>) } // Make this the main thread for gtk debug!("init_tray gtk"); - let mut tray = match ROGTray::new() { + let mut tray = match ROGTray::new(states.clone()) { Ok(t) => { info!("init_tray: built menus"); t @@ -460,33 +485,36 @@ pub fn init_tray(supported: SupportedFunctions, states: Arc>) }; tray.rebuild_and_update( - &supported, + &supported_properties, &supported_gfx, GfxMode::Hybrid, - 100, - false, - false, + None, + None, + None, ); tray.set_icon(TRAY_APP_ICON); info!("Started ROGTray"); loop { + let states = tray.states.clone(); if let Ok(mut lock) = states.lock() { if lock.tray_should_update { // Supergfx ends up adding some complexity to handle if it isn't available let current_gpu_mode = if lock.gfx_state.has_supergfx { lock.gfx_state.mode - } else { - match lock.bios.dedicated_gfx { + } else if let Some(mode) = lock.bios.gpu_mux_mode { + match mode { GpuMode::Discrete => GfxMode::AsusMuxDgpu, _ => GfxMode::Hybrid, } + } else { + GfxMode::Hybrid }; tray.rebuild_and_update( - &supported, + &supported_properties, &supported_gfx, current_gpu_mode, - lock.power_state.charge_limit, + lock.bios.charge_limit, lock.bios.panel_overdrive, lock.bios.mini_led_mode, ); @@ -523,7 +551,7 @@ pub fn init_tray(supported: SupportedFunctions, states: Arc>) continue; } // Don't spool at max speed if no gtk events - std::thread::sleep(Duration::from_millis(300)); + std::thread::sleep(Duration::from_millis(50)); trace!("Tray loop ticked"); } }); diff --git a/rog-control-center/src/update_and_notify.rs b/rog-control-center/src/update_and_notify.rs index defc32e6..f0a1ebe5 100644 --- a/rog-control-center/src/update_and_notify.rs +++ b/rog-control-center/src/update_and_notify.rs @@ -12,12 +12,9 @@ use std::time::Duration; use log::{error, info, trace, warn}; use notify_rust::{Hint, Notification, NotificationHandle, Urgency}; use rog_dbus::zbus_anime::AnimeProxy; -use rog_dbus::zbus_led::LedProxy; -use rog_dbus::zbus_platform::RogBiosProxy; -use rog_dbus::zbus_power::PowerProxy; -use rog_dbus::zbus_profile::ProfileProxy; -use rog_platform::platform::GpuMode; -use rog_profiles::Profile; +use rog_dbus::zbus_aura::AuraProxy; +use rog_dbus::zbus_platform::PlatformProxy; +use rog_platform::platform::{GpuMode, PlatformPolicy}; use serde::{Deserialize, Serialize}; use supergfxctl::actions::UserActionRequired as GfxUserAction; use supergfxctl::pci_device::{GfxMode, GfxPower}; @@ -42,11 +39,11 @@ pub struct EnabledNotifications { pub receive_mini_led_mode_changed: bool, pub receive_dgpu_disable_changed: bool, pub receive_egpu_enable_changed: bool, - pub receive_notify_gpu_mux_mode: bool, - pub receive_notify_charge_control_end_threshold: bool, + pub receive_gpu_mux_mode_changed: bool, + pub receive_charge_control_end_threshold_changed: bool, pub receive_notify_mains_online: bool, - pub receive_notify_profile: bool, - pub receive_notify_led: bool, + pub receive_throttle_thermal_policy_changed: bool, + pub receive_led_mode_data_changed: bool, /// Anime pub receive_power_states: bool, pub receive_notify_gfx: bool, @@ -62,11 +59,11 @@ impl Default for EnabledNotifications { receive_mini_led_mode_changed: true, receive_dgpu_disable_changed: true, receive_egpu_enable_changed: true, - receive_notify_gpu_mux_mode: true, - receive_notify_charge_control_end_threshold: true, + receive_gpu_mux_mode_changed: true, + receive_charge_control_end_threshold_changed: true, receive_notify_mains_online: false, - receive_notify_profile: true, - receive_notify_led: true, + receive_throttle_thermal_policy_changed: true, + receive_led_mode_data_changed: true, receive_power_states: false, receive_notify_gfx: false, receive_notify_gfx_status: false, @@ -160,7 +157,7 @@ macro_rules! recv_changed { } } if let Ok(mut lock) = page_states1.lock() { - lock.$($args)+ = out; + lock.$($args)+ = out.into(); lock.set_notified(); } } @@ -201,7 +198,7 @@ pub fn start_notifications( // BIOS notif recv_changed!( - RogBiosProxy, + PlatformProxy, receive_post_animation_sound_changed, last_notification, enabled_notifications, @@ -212,7 +209,7 @@ pub fn start_notifications( ); recv_changed!( - RogBiosProxy, + PlatformProxy, receive_panel_od_changed, last_notification, enabled_notifications, @@ -223,7 +220,7 @@ pub fn start_notifications( ); recv_changed!( - RogBiosProxy, + PlatformProxy, receive_mini_led_mode_changed, last_notification, enabled_notifications, @@ -234,7 +231,7 @@ pub fn start_notifications( ); recv_changed!( - RogBiosProxy, + PlatformProxy, receive_dgpu_disable_changed, last_notification, enabled_notifications, @@ -245,7 +242,7 @@ pub fn start_notifications( ); recv_changed!( - RogBiosProxy, + PlatformProxy, receive_egpu_enable_changed, last_notification, enabled_notifications, @@ -256,85 +253,69 @@ pub fn start_notifications( ); // Charge notif - recv_notif!( - PowerProxy, - receive_notify_charge_control_end_threshold, + recv_changed!( + PlatformProxy, + receive_charge_control_end_threshold_changed, last_notification, enabled_notifications, page_states, - (power_state.charge_limit), - (limit), + (bios.charge_limit), "Battery charge limit changed to", do_notification ); - recv_notif!( - PowerProxy, - receive_notify_mains_online, - last_notification, - enabled_notifications, - page_states, - (power_state.ac_power), - (on), - "AC Power power is", - ac_power_notification - ); - // Profile notif - recv_notif!( - ProfileProxy, - receive_notify_profile, + recv_changed!( + PlatformProxy, + receive_throttle_thermal_policy_changed, last_notification, enabled_notifications, page_states, - (profiles.current), - (profile), + (bios.throttle), "Profile changed to", do_thermal_notif ); // notify!(do_thermal_notif(&out.profile), lock); // LED notif - recv_notif!( - LedProxy, - receive_notify_led, + recv_changed!( + AuraProxy, + receive_led_mode_data_changed, last_notification, enabled_notifications, page_states, (aura.current_mode), - (data.mode), "Keyboard LED mode changed to", do_notification ); - let page_states1 = page_states.clone(); - tokio::spawn(async move { - let conn = zbus::Connection::system() - .await - .map_err(|e| { - error!("zbus signal: receive_device_state: {e}"); - e - }) - .unwrap(); - let proxy = LedProxy::new(&conn) - .await - .map_err(|e| { - error!("zbus signal: receive_device_state: {e}"); - e - }) - .unwrap(); - if let Ok(mut p) = proxy.receive_notify_power_states().await { - info!("Started zbus signal thread: receive_notify_power_states"); - while let Some(e) = p.next().await { - if let Ok(out) = e.args() { - if let Ok(mut lock) = page_states1.lock() { - lock.aura.enabled = out.data; - lock.set_notified(); - } - } - } - }; - }); + // let page_states1 = page_states.clone(); + // tokio::spawn(async move { + // let conn = zbus::Connection::system() + // .await + // .map_err(|e| { + // error!("zbus signal: receive_device_state: {e}"); + // e + // }) + // .unwrap(); + // let proxy = AuraProxy::new(&conn) + // .await + // .map_err(|e| { + // error!("zbus signal: receive_device_state: {e}"); + // e + // }) + // .unwrap(); + // let p = proxy.receive_led_power_changed().await; + // info!("Started zbus signal thread: receive_notify_power_states"); + // while let Some(e) = p.next().await { + // if let Ok(out) = e.get().await { + // if let Ok(mut lock) = page_states1.lock() { + // lock.aura.enabled = out; + // lock.set_notified(); + // } + // } + // } + // }); let page_states1 = page_states.clone(); tokio::spawn(async move { @@ -373,7 +354,7 @@ pub fn start_notifications( e }) .unwrap(); - let proxy = RogBiosProxy::new(&conn) + let proxy = PlatformProxy::new(&conn) .await .map_err(|e| { error!("zbus signal: receive_notify_gpu_mux_mode: {e}"); @@ -394,7 +375,7 @@ pub fn start_notifications( continue; } if let Ok(mut lock) = page_states1.lock() { - lock.bios.dedicated_gfx = mode; + lock.bios.gpu_mux_mode = Some(mode); lock.set_notified(); } do_mux_notification("Reboot required. BIOS GPU MUX mode set to", &mode).ok(); @@ -541,7 +522,8 @@ where Ok(base_notification(message, data).show()?) } -fn ac_power_notification(message: &str, on: &bool) -> Result { +// TODO: +fn _ac_power_notification(message: &str, on: &bool) -> Result { let data = if *on { unsafe { if let Some(cmd) = POWER_AC_CMD.as_mut() { @@ -564,11 +546,11 @@ fn ac_power_notification(message: &str, on: &bool) -> Result Ok(base_notification(message, &data).show()?) } -fn do_thermal_notif(message: &str, profile: &Profile) -> Result { +fn do_thermal_notif(message: &str, profile: &PlatformPolicy) -> Result { let icon = match profile { - Profile::Balanced => "asus_notif_yellow", - Profile::Performance => "asus_notif_red", - Profile::Quiet => "asus_notif_green", + PlatformPolicy::Balanced => "asus_notif_yellow", + PlatformPolicy::Performance => "asus_notif_red", + PlatformPolicy::Quiet => "asus_notif_green", }; let profile: &str = (*profile).into(); let mut notif = base_notification(message, &profile.to_uppercase()); diff --git a/rog-control-center/src/widgets/anime_power.rs b/rog-control-center/src/widgets/anime_power.rs index c414ed39..a217c411 100644 --- a/rog-control-center/src/widgets/anime_power.rs +++ b/rog-control-center/src/widgets/anime_power.rs @@ -1,10 +1,9 @@ use egui::{RichText, Ui}; use rog_anime::usb::Brightness; -use rog_platform::supported::SupportedFunctions; use crate::system_state::SystemState; -pub fn anime_power_group(_supported: &SupportedFunctions, states: &mut SystemState, ui: &mut Ui) { +pub fn anime_power_group(states: &mut SystemState, ui: &mut Ui) { ui.heading("AniMe Matrix Settings"); ui.label("Options are incomplete. Awake + Boot should work"); diff --git a/rog-control-center/src/widgets/app_settings.rs b/rog-control-center/src/widgets/app_settings.rs index 66babb5a..3b81d705 100644 --- a/rog-control-center/src/widgets/app_settings.rs +++ b/rog-control-center/src/widgets/app_settings.rs @@ -45,7 +45,7 @@ pub fn app_settings(config: &mut Config, states: &mut SystemState, ui: &mut Ui) .clicked() || ui .checkbox( - &mut enabled_notifications.receive_notify_led, + &mut enabled_notifications.receive_led_mode_data_changed, "Enable LED mode change notification", ) .clicked() @@ -69,13 +69,13 @@ pub fn app_settings(config: &mut Config, states: &mut SystemState, ui: &mut Ui) .clicked() || ui .checkbox( - &mut enabled_notifications.receive_notify_charge_control_end_threshold, + &mut enabled_notifications.receive_charge_control_end_threshold_changed, "Enable charge threshold notification", ) .clicked() || ui .checkbox( - &mut enabled_notifications.receive_notify_profile, + &mut enabled_notifications.receive_throttle_thermal_policy_changed, "Enable profile change notification", ) .clicked() diff --git a/rog-control-center/src/widgets/aura_modes.rs b/rog-control-center/src/widgets/aura_modes.rs index 775775e9..4fbc9484 100644 --- a/rog-control-center/src/widgets/aura_modes.rs +++ b/rog-control-center/src/widgets/aura_modes.rs @@ -228,8 +228,8 @@ pub fn aura_modes_group(states: &mut SystemState, freq: &mut Arc, ui: states .asus_dbus .proxies() - .led() - .set_led_mode(states.aura.modes.get(&selected).unwrap()) + .aura() + .set_led_mode(states.aura.modes.get(&selected).unwrap().mode) .map_err(|err| { states.error = Some(err.to_string()); }) diff --git a/rog-control-center/src/widgets/aura_power.rs b/rog-control-center/src/widgets/aura_power.rs index a7120632..94fa7711 100644 --- a/rog-control-center/src/widgets/aura_power.rs +++ b/rog-control-center/src/widgets/aura_power.rs @@ -1,7 +1,6 @@ use egui::{RichText, Ui}; use rog_aura::power::{AuraPower, KbAuraPowerState}; use rog_aura::usb::{AuraDevRog1, AuraDevTuf, AuraDevice, AuraPowerDev}; -use rog_platform::supported::SupportedFunctions; use crate::system_state::SystemState; @@ -132,7 +131,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu states .asus_dbus .proxies() - .led() + .aura() .set_led_power(options, enable) .map_err(|err| { states.error = Some(err.to_string()); @@ -182,7 +181,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu states .asus_dbus .proxies() - .led() + .aura() .set_led_power(options, enable) .map_err(|err| { states.error = Some(err.to_string()); @@ -247,7 +246,7 @@ fn aura_power2(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu states .asus_dbus .proxies() - .led() + .aura() .set_led_power(options, enable) .map_err(|err| { states.error = Some(err.to_string()); diff --git a/rog-control-center/src/widgets/fan_graph.rs b/rog-control-center/src/widgets/fan_graph.rs index 6300e2d2..5b5bc342 100644 --- a/rog-control-center/src/widgets/fan_graph.rs +++ b/rog-control-center/src/widgets/fan_graph.rs @@ -1,14 +1,13 @@ use egui::plot::Points; use egui::Ui; -use rog_platform::supported::SupportedFunctions; +use rog_platform::platform::PlatformPolicy; use rog_profiles::fan_curve_set::CurveData; -use rog_profiles::{FanCurvePU, Profile}; +use rog_profiles::FanCurvePU; use crate::system_state::FanCurvesState; use crate::RogDbusClientBlocking; pub fn fan_graphs( - supported: &SupportedFunctions, curves: &mut FanCurvesState, dbus: &RogDbusClientBlocking<'_>, do_error: &mut Option, @@ -16,13 +15,16 @@ pub fn fan_graphs( ) { ui.separator(); - let mut item = |profile: Profile, ui: &mut Ui| { + let mut item = |profile: PlatformPolicy, ui: &mut Ui| { ui.group(|ui| { if ui .selectable_value(&mut curves.show_curve, profile, format!("{profile:?}")) .clicked() { - dbus.proxies().profile().set_active_profile(profile).ok(); + dbus.proxies() + .platform() + .set_throttle_thermal_policy(profile) + .ok(); } ui.add_enabled_ui(curves.show_curve == profile, |ui| { if curves.available_fans.contains(&FanCurvePU::CPU) { @@ -164,7 +166,7 @@ pub fn fan_graphs( if set { dbus.proxies() - .profile() + .fan_curves() .set_fan_curve(curves.show_curve, data.clone()) .map_err(|err| { *do_error = Some(err.to_string()); @@ -175,7 +177,7 @@ pub fn fan_graphs( if clear { if let Ok(curve) = dbus .proxies() - .profile() + .fan_curves() .fan_curve_data(curves.show_curve) .map_err(|err| { *do_error = Some(err.to_string()); @@ -189,14 +191,14 @@ pub fn fan_graphs( if reset { dbus.proxies() - .profile() + .fan_curves() .reset_profile_curves(curves.show_curve) .map_err(|err| { *do_error = Some(err.to_string()); }) .ok(); - match FanCurvesState::new(supported, dbus) { + match FanCurvesState::new(dbus) { Ok(f) => *curves = f, Err(e) => *do_error = Some(e.to_string()), } diff --git a/rog-control-center/src/widgets/mod.rs b/rog-control-center/src/widgets/mod.rs index c380131f..50df02f5 100644 --- a/rog-control-center/src/widgets/mod.rs +++ b/rog-control-center/src/widgets/mod.rs @@ -1,7 +1,7 @@ mod anime_power; mod app_settings; mod aura_modes; -mod aura_power; +// mod aura_power; mod fan_graph; mod keyboard_layout; mod rog_bios; @@ -11,7 +11,7 @@ mod top_bar; pub use anime_power::*; pub use app_settings::*; pub use aura_modes::*; -pub use aura_power::*; +// pub use aura_power::*; pub use fan_graph::*; pub use keyboard_layout::*; pub use rog_bios::*; diff --git a/rog-control-center/src/widgets/rog_bios.rs b/rog-control-center/src/widgets/rog_bios.rs index 80b75c4c..27032854 100644 --- a/rog-control-center/src/widgets/rog_bios.rs +++ b/rog-control-center/src/widgets/rog_bios.rs @@ -1,124 +1,114 @@ use egui::Ui; -use rog_platform::platform::GpuMode; -use rog_platform::supported::SupportedFunctions; -use rog_profiles::Profile; +use rog_platform::platform::{GpuMode, PlatformPolicy}; use crate::system_state::SystemState; pub fn platform_profile(states: &mut SystemState, ui: &mut Ui) { - ui.heading("Platform profile"); + if let Some(mut throttle) = states.bios.throttle { + ui.heading("Platform profile"); - let mut changed = false; - let mut item = |p: Profile, ui: &mut Ui| { - if ui - .selectable_value(&mut states.profiles.current, p, format!("{p:?}")) - .clicked() - { - changed = true; - } - }; + let mut item = |p: PlatformPolicy, ui: &mut Ui| { + if ui + .selectable_value(&mut throttle, p, format!("{p:?}")) + .clicked() + { + states + .asus_dbus + .proxies() + .platform() + .set_throttle_thermal_policy(throttle) + .map_err(|err| { + states.error = Some(err.to_string()); + }) + .ok(); + } + }; - ui.horizontal_wrapped(|ui| { - for a in &states.profiles.list { - item(*a, ui); - } - }); - - if changed { - states - .asus_dbus - .proxies() - .profile() - .set_active_profile(states.profiles.current) - .map_err(|err| { - states.error = Some(err.to_string()); - }) - .ok(); - }; + ui.horizontal_wrapped(|ui| { + for a in PlatformPolicy::list() { + item(a, ui); + } + }); + } } -pub fn rog_bios_group(supported: &SupportedFunctions, states: &mut SystemState, ui: &mut Ui) { +pub fn rog_bios_group(states: &mut SystemState, ui: &mut Ui) { ui.heading("Bios options"); - let slider = egui::Slider::new(&mut states.power_state.charge_limit, 20..=100) - .text("Charging limit") - .step_by(1.0); - if ui.add(slider).drag_released() { - states - .asus_dbus - .proxies() - .charge() - .set_charge_control_end_threshold(states.power_state.charge_limit) - .map_err(|err| { - states.error = Some(err.to_string()); - }) - .ok(); + if let Some(mut limit) = states.bios.charge_limit { + let slider = egui::Slider::new(&mut limit, 20..=100) + .text("Charging limit") + .step_by(1.0); + if ui.add(slider).drag_released() { + states + .asus_dbus + .proxies() + .platform() + .set_charge_control_end_threshold(limit) + .map_err(|err| { + states.error = Some(err.to_string()); + }) + .ok(); + } } - if supported.rog_bios_ctrl.post_animation_sound - && ui - .add(egui::Checkbox::new( - &mut states.bios.post_sound, - "POST sound", - )) + if let Some(mut sound) = states.bios.post_sound { + if ui + .add(egui::Checkbox::new(&mut sound, "POST sound")) .changed() - { - states - .asus_dbus - .proxies() - .rog_bios() - .set_post_animation_sound(states.bios.post_sound) - .map_err(|err| { - states.error = Some(err.to_string()); - }) - .ok(); + { + states + .asus_dbus + .proxies() + .platform() + .set_post_animation_sound(sound) + .map_err(|err| { + states.error = Some(err.to_string()); + }) + .ok(); + } } - if supported.rog_bios_ctrl.panel_overdrive - && ui - .add(egui::Checkbox::new( - &mut states.bios.panel_overdrive, - "Panel overdrive", - )) + if let Some(mut overdrive) = states.bios.panel_overdrive { + if ui + .add(egui::Checkbox::new(&mut overdrive, "Panel overdrive")) .changed() - { - states - .asus_dbus - .proxies() - .rog_bios() - .set_panel_od(states.bios.panel_overdrive) - .map_err(|err| { - states.error = Some(err.to_string()); - }) - .ok(); + { + states + .asus_dbus + .proxies() + .platform() + .set_panel_od(overdrive) + .map_err(|err| { + states.error = Some(err.to_string()); + }) + .ok(); + } } - if supported.rog_bios_ctrl.mini_led_mode - && ui - .add(egui::Checkbox::new( - &mut states.bios.mini_led_mode, - "MiniLED backlight", - )) + if let Some(mut mini_led_mode) = states.bios.mini_led_mode { + if ui + .add(egui::Checkbox::new(&mut mini_led_mode, "MiniLED backlight")) .changed() - { - states - .asus_dbus - .proxies() - .rog_bios() - .set_mini_led_mode(states.bios.mini_led_mode) - .map_err(|err| { - states.error = Some(err.to_string()); - }) - .ok(); + { + states + .asus_dbus + .proxies() + .platform() + .set_mini_led_mode(mini_led_mode) + .map_err(|err| { + states.error = Some(err.to_string()); + }) + .ok(); + } } - if supported.rog_bios_ctrl.gpu_mux { + if let Some(mut gpu_mux_mode) = states.bios.gpu_mux_mode { let mut changed = false; - let mut dedicated_gfx = states.bios.dedicated_gfx; let mut reboot_required = false; - if let Ok(mode) = states.asus_dbus.proxies().rog_bios().gpu_mux_mode() { - reboot_required = GpuMode::from(mode) != states.bios.dedicated_gfx; + if let Ok(mode) = states.asus_dbus.proxies().platform().gpu_mux_mode() { + reboot_required = GpuMode::from(mode) != gpu_mux_mode; } ui.group(|ui| { @@ -128,14 +118,14 @@ pub fn rog_bios_group(supported: &SupportedFunctions, states: &mut SystemState, ui.horizontal_wrapped(|ui| { changed = ui .selectable_value( - &mut dedicated_gfx, + &mut gpu_mux_mode, GpuMode::Discrete, "Dedicated (Ultimate)", ) .clicked() || ui .selectable_value( - &mut dedicated_gfx, + &mut gpu_mux_mode, GpuMode::Optimus, "Optimus (Hybrid)", ) @@ -152,8 +142,8 @@ pub fn rog_bios_group(supported: &SupportedFunctions, states: &mut SystemState, states .asus_dbus .proxies() - .rog_bios() - .set_gpu_mux_mode(dedicated_gfx) + .platform() + .set_gpu_mux_mode(gpu_mux_mode) .map_err(|err| { states.error = Some(err.to_string()); }) diff --git a/rog-control-center/src/widgets/side_panel.rs b/rog-control-center/src/widgets/side_panel.rs index 29c75198..0fe2f5f8 100644 --- a/rog-control-center/src/widgets/side_panel.rs +++ b/rog-control-center/src/widgets/side_panel.rs @@ -18,7 +18,7 @@ impl RogApp { *page = Page::System; } - if !self.supported.platform_profile.fans.is_empty() { + if self.supported_interfaces.contains(&"FanCurves".to_owned()) { ui.separator(); if ui .selectable_value(page, Page::FanCurves, "Fan Curves") @@ -28,7 +28,7 @@ impl RogApp { } } - if !self.supported.keyboard_led.basic_modes.is_empty() { + if self.supported_interfaces.contains(&"Aura".to_owned()) { ui.separator(); if ui .selectable_value(page, Page::AuraEffects, "Keyboard Aura") @@ -39,7 +39,7 @@ impl RogApp { } // TODO: Anime page is not complete - if self.supported.anime_ctrl.0 { + if self.supported_interfaces.contains(&"Anime".to_owned()) { ui.separator(); if ui .selectable_value(page, Page::AnimeMatrix, "AniMe Matrix") diff --git a/rog-dbus/Cargo.toml b/rog-dbus/Cargo.toml index a0b98241..d366edb1 100644 --- a/rog-dbus/Cargo.toml +++ b/rog-dbus/Cargo.toml @@ -10,6 +10,7 @@ description = "dbus interface methods for asusctl" edition = "2021" [dependencies] +asusd = { path = "../asusd" } rog_anime = { path = "../rog-anime", features = ["dbus"] } rog_aura = { path = "../rog-aura" } rog_profiles = { path = "../rog-profiles" } diff --git a/rog-dbus/src/lib.rs b/rog-dbus/src/lib.rs index ca9de9f7..0059de43 100644 --- a/rog-dbus/src/lib.rs +++ b/rog-dbus/src/lib.rs @@ -1,13 +1,8 @@ -pub static DBUS_NAME: &str = "org.asuslinux.Daemon"; -pub static DBUS_PATH: &str = "/org/asuslinux/Daemon"; -pub static DBUS_IFACE: &str = "org.asuslinux.Daemon"; - +pub use asusd::{DBUS_IFACE, DBUS_NAME, DBUS_PATH}; pub mod zbus_anime; -pub mod zbus_led; +pub mod zbus_aura; +pub mod zbus_fan_curves; pub mod zbus_platform; -pub mod zbus_power; -pub mod zbus_profile; -pub mod zbus_supported; // use rog_anime::AnimePowerStates; // use rog_aura::{AuraEffect, LedPowerStates}; @@ -19,11 +14,9 @@ pub const VERSION: &str = env!("CARGO_PKG_VERSION"); pub struct DbusProxiesBlocking<'a> { anime: zbus_anime::AnimeProxyBlocking<'a>, - charge: zbus_power::PowerProxyBlocking<'a>, - led: zbus_led::LedProxyBlocking<'a>, - profile: zbus_profile::ProfileProxyBlocking<'a>, - rog_bios: zbus_platform::RogBiosProxyBlocking<'a>, - supported: zbus_supported::SupportedProxyBlocking<'a>, + led: zbus_aura::AuraProxyBlocking<'a>, + profile: zbus_fan_curves::FanCurvesProxyBlocking<'a>, + rog_bios: zbus_platform::PlatformProxyBlocking<'a>, } impl<'a> DbusProxiesBlocking<'a> { @@ -34,11 +27,9 @@ impl<'a> DbusProxiesBlocking<'a> { Ok(( DbusProxiesBlocking { anime: zbus_anime::AnimeProxyBlocking::new(&conn)?, - led: zbus_led::LedProxyBlocking::new(&conn)?, - charge: zbus_power::PowerProxyBlocking::new(&conn)?, - profile: zbus_profile::ProfileProxyBlocking::new(&conn)?, - rog_bios: zbus_platform::RogBiosProxyBlocking::new(&conn)?, - supported: zbus_supported::SupportedProxyBlocking::new(&conn)?, + led: zbus_aura::AuraProxyBlocking::new(&conn)?, + profile: zbus_fan_curves::FanCurvesProxyBlocking::new(&conn)?, + rog_bios: zbus_platform::PlatformProxyBlocking::new(&conn)?, }, conn, )) @@ -48,25 +39,17 @@ impl<'a> DbusProxiesBlocking<'a> { &self.anime } - pub fn charge(&self) -> &zbus_power::PowerProxyBlocking<'a> { - &self.charge - } - - pub fn led(&self) -> &zbus_led::LedProxyBlocking<'a> { + pub fn aura(&self) -> &zbus_aura::AuraProxyBlocking<'a> { &self.led } - pub fn profile(&self) -> &zbus_profile::ProfileProxyBlocking<'a> { + pub fn fan_curves(&self) -> &zbus_fan_curves::FanCurvesProxyBlocking<'a> { &self.profile } - pub fn rog_bios(&self) -> &zbus_platform::RogBiosProxyBlocking<'a> { + pub fn platform(&self) -> &zbus_platform::PlatformProxyBlocking<'a> { &self.rog_bios } - - pub fn supported(&self) -> &zbus_supported::SupportedProxyBlocking<'a> { - &self.supported - } } /// This is the main way to communicate with the DBUS interface @@ -88,11 +71,9 @@ impl<'a> RogDbusClientBlocking<'a> { pub struct DbusProxies<'a> { anime: zbus_anime::AnimeProxy<'a>, - charge: zbus_power::PowerProxy<'a>, - led: zbus_led::LedProxy<'a>, - profile: zbus_profile::ProfileProxy<'a>, - rog_bios: zbus_platform::RogBiosProxy<'a>, - supported: zbus_supported::SupportedProxy<'a>, + led: zbus_aura::AuraProxy<'a>, + profile: zbus_fan_curves::FanCurvesProxy<'a>, + rog_bios: zbus_platform::PlatformProxy<'a>, } impl<'a> DbusProxies<'a> { @@ -103,11 +84,9 @@ impl<'a> DbusProxies<'a> { Ok(( DbusProxies { anime: zbus_anime::AnimeProxy::new(&conn).await?, - led: zbus_led::LedProxy::new(&conn).await?, - charge: zbus_power::PowerProxy::new(&conn).await?, - profile: zbus_profile::ProfileProxy::new(&conn).await?, - rog_bios: zbus_platform::RogBiosProxy::new(&conn).await?, - supported: zbus_supported::SupportedProxy::new(&conn).await?, + led: zbus_aura::AuraProxy::new(&conn).await?, + profile: zbus_fan_curves::FanCurvesProxy::new(&conn).await?, + rog_bios: zbus_platform::PlatformProxy::new(&conn).await?, }, conn, )) @@ -117,25 +96,17 @@ impl<'a> DbusProxies<'a> { &self.anime } - pub fn charge(&self) -> &zbus_power::PowerProxy<'a> { - &self.charge - } - - pub fn led(&self) -> &zbus_led::LedProxy<'a> { + pub fn led(&self) -> &zbus_aura::AuraProxy<'a> { &self.led } - pub fn profile(&self) -> &zbus_profile::ProfileProxy<'a> { + pub fn profile(&self) -> &zbus_fan_curves::FanCurvesProxy<'a> { &self.profile } - pub fn rog_bios(&self) -> &zbus_platform::RogBiosProxy<'a> { + pub fn rog_bios(&self) -> &zbus_platform::PlatformProxy<'a> { &self.rog_bios } - - pub fn supported(&self) -> &zbus_supported::SupportedProxy<'a> { - &self.supported - } } /// This is the main way to communicate with the DBUS interface diff --git a/rog-dbus/src/zbus_anime.rs b/rog-dbus/src/zbus_anime.rs index 9c1b90fd..b95b8d53 100644 --- a/rog-dbus/src/zbus_anime.rs +++ b/rog-dbus/src/zbus_anime.rs @@ -1,5 +1,5 @@ -use rog_anime::usb::{AnimAwake, AnimBooting, AnimShutdown, AnimSleeping, Brightness}; -use rog_anime::{AnimeDataBuffer, DeviceState as AnimeDeviceState}; +use rog_anime::usb::Brightness; +use rog_anime::{Animations, AnimeDataBuffer, DeviceState as AnimeDeviceState}; use zbus::dbus_proxy; #[dbus_proxy( @@ -8,41 +8,58 @@ use zbus::dbus_proxy; default_path = "/org/asuslinux/Anime" )] trait Anime { - /// Set the global base brightness - fn set_brightness(&self, bright: Brightness) -> zbus::Result<()>; - - /// Set whether the AniMe will show boot, suspend, or off animations - fn set_builtins_enabled(&self, enabled: bool) -> zbus::Result<()>; - - /// Set which builtin animation is used for each stage - fn set_builtin_animations( - &self, - boot: AnimBooting, - awake: AnimAwake, - sleep: AnimSleeping, - shutdown: AnimShutdown, - ) -> zbus::Result<()>; - - /// Set whether the AniMe is displaying images/data - fn set_enable_display(&self, status: bool) -> zbus::Result<()>; - - /// SetOffWhenLidClosed method - fn set_off_when_lid_closed(&self, enabled: bool) -> zbus::Result<()>; - - /// SetOffWhenSuspended method - fn set_off_when_suspended(&self, enabled: bool) -> zbus::Result<()>; - - /// SetOffWhenUnplugged method - fn set_off_when_unplugged(&self, enabled: bool) -> zbus::Result<()>; - - /// Writes a data stream of length. Will force system thread to exit until - /// it is restarted - fn write(&self, input: AnimeDataBuffer) -> zbus::Result<()>; - - // #[dbus_proxy(property)] + /// DeviceState method fn device_state(&self) -> zbus::Result; + /// RunMainLoop method + fn run_main_loop(&self, start: bool) -> zbus::Result<()>; + + /// Write method + fn write(&self, input: AnimeDataBuffer) -> zbus::Result<()>; + /// NotifyDeviceState signal #[dbus_proxy(signal)] fn notify_device_state(&self, data: AnimeDeviceState) -> zbus::Result<()>; + + /// Brightness property + #[dbus_proxy(property)] + fn brightness(&self) -> zbus::Result; + #[dbus_proxy(property)] + fn set_brightness(&self, value: Brightness) -> zbus::Result<()>; + + /// BuiltinAnimations property + #[dbus_proxy(property)] + fn builtin_animations(&self) -> zbus::Result; + #[dbus_proxy(property)] + fn set_builtin_animations(&self, value: Animations) -> zbus::Result<()>; + + /// BuiltinsEnabled property + #[dbus_proxy(property)] + fn builtins_enabled(&self) -> zbus::Result; + #[dbus_proxy(property)] + fn set_builtins_enabled(&self, value: bool) -> zbus::Result<()>; + + /// EnableDisplay property + #[dbus_proxy(property)] + fn enable_display(&self) -> zbus::Result; + #[dbus_proxy(property)] + fn set_enable_display(&self, value: bool) -> zbus::Result<()>; + + /// OffWhenLidClosed property + #[dbus_proxy(property)] + fn off_when_lid_closed(&self) -> zbus::Result; + #[dbus_proxy(property)] + fn set_off_when_lid_closed(&self, value: bool) -> zbus::Result<()>; + + /// OffWhenSuspended property + #[dbus_proxy(property)] + fn off_when_suspended(&self) -> zbus::Result; + #[dbus_proxy(property)] + fn set_off_when_suspended(&self, value: bool) -> zbus::Result<()>; + + /// OffWhenUnplugged property + #[dbus_proxy(property)] + fn off_when_unplugged(&self) -> zbus::Result; + #[dbus_proxy(property)] + fn set_off_when_unplugged(&self, value: bool) -> zbus::Result<()>; } diff --git a/rog-dbus/src/zbus_led.rs b/rog-dbus/src/zbus_aura.rs similarity index 54% rename from rog-dbus/src/zbus_led.rs rename to rog-dbus/src/zbus_aura.rs index 3636cdf8..d5c5e833 100644 --- a/rog-dbus/src/zbus_led.rs +++ b/rog-dbus/src/zbus_aura.rs @@ -23,7 +23,7 @@ use std::collections::BTreeMap; use rog_aura::advanced::UsbPackets; -use rog_aura::usb::AuraPowerDev; +use rog_aura::usb::{AuraDevice, AuraPowerDev}; use rog_aura::{AuraEffect, AuraModeNum, LedBrightness}; use zbus::blocking::Connection; use zbus::{dbus_proxy, Result}; @@ -32,66 +32,63 @@ const BLOCKING_TIME: u64 = 33; // 100ms = 10 FPS, max 50ms = 20 FPS, 40ms = 25 F #[dbus_proxy( interface = "org.asuslinux.Daemon", + default_service = "org.asuslinux.Daemon", default_path = "/org/asuslinux/Aura" )] -trait Led { - /// NextLedMode method - fn next_led_mode(&self) -> zbus::Result<()>; +trait Aura { + /// AllModeData method + fn all_mode_data(&self) -> zbus::Result>; - /// PrevLedMode method - fn prev_led_mode(&self) -> zbus::Result<()>; + /// DirectAddressingRaw method + fn direct_addressing_raw(&self, data: UsbPackets) -> zbus::Result<()>; - /// Toggle to next led brightness - fn next_led_brightness(&self) -> zbus::Result<()>; - - /// Toggle to previous led brightness - fn prev_led_brightness(&self) -> zbus::Result<()>; - - /// SetBrightness method - fn set_brightness(&self, brightness: LedBrightness) -> zbus::Result<()>; - - /// SetLedMode method - fn set_led_mode(&self, effect: &AuraEffect) -> zbus::Result<()>; - - fn set_led_power(&self, options: AuraPowerDev, enabled: bool) -> zbus::Result<()>; - - /// On machine that have some form of either per-key keyboard or per-zone - /// this can be used to write custom effects over dbus. The input is a - /// nested `Vec>` where `Vec` is a raw USB packet - fn direct_addressing_raw(&self, data: UsbPackets) -> zbus::fdo::Result<()>; - - /// NotifyLed signal - #[dbus_proxy(signal)] - fn notify_led(&self, data: AuraEffect) -> zbus::Result<()>; - - #[dbus_proxy(signal)] - fn notify_power_states(&self, data: AuraPowerDev) -> zbus::Result<()>; - - /// LedBrightness property + /// Brightness property #[dbus_proxy(property)] - fn led_brightness(&self) -> zbus::Result; + fn brightness(&self) -> zbus::Result; + #[dbus_proxy(property)] + fn set_brightness(&self, value: LedBrightness) -> zbus::Result<()>; + + /// DeviceType property + #[dbus_proxy(property)] + fn device_type(&self) -> zbus::Result; /// LedMode property + #[dbus_proxy(property)] fn led_mode(&self) -> zbus::Result; + #[dbus_proxy(property)] + fn set_led_mode(&self, value: AuraModeNum) -> zbus::Result<()>; - /// LedModes property - fn led_modes(&self) -> zbus::Result>; + /// LedModeData property + #[dbus_proxy(property)] + fn led_mode_data(&self) -> zbus::Result; + #[dbus_proxy(property)] + fn set_led_mode_data(&self, value: AuraEffect) -> zbus::Result<()>; - // As property doesn't work for AuraPowerDev (complexity of serialization?) - // #[dbus_proxy(property)] + /// LedPower property + #[dbus_proxy(property)] fn led_power(&self) -> zbus::Result; + #[dbus_proxy(property)] + fn set_led_power(&self, value: (AuraPowerDev, bool)) -> zbus::Result<()>; + + /// SupportedBrightness property + #[dbus_proxy(property)] + fn supported_brightness(&self) -> zbus::Result>; + + /// SupportedModes property + #[dbus_proxy(property)] + fn supported_modes(&self) -> zbus::Result>; } -pub struct LedProxyPerkey<'a>(LedProxyBlocking<'a>); +pub struct AuraProxyPerkey<'a>(AuraProxyBlocking<'a>); -impl<'a> LedProxyPerkey<'a> { +impl<'a> AuraProxyPerkey<'a> { #[inline] pub fn new(conn: &Connection) -> Result { - Ok(LedProxyPerkey(LedProxyBlocking::new(conn)?)) + Ok(AuraProxyPerkey(AuraProxyBlocking::new(conn)?)) } #[inline] - pub fn proxy(&self) -> &LedProxyBlocking<'a> { + pub fn proxy(&self) -> &AuraProxyBlocking<'a> { &self.0 } diff --git a/rog-dbus/src/zbus_profile.rs b/rog-dbus/src/zbus_fan_curves.rs similarity index 56% rename from rog-dbus/src/zbus_profile.rs rename to rog-dbus/src/zbus_fan_curves.rs index 2090fe11..90590bf2 100644 --- a/rog-dbus/src/zbus_profile.rs +++ b/rog-dbus/src/zbus_fan_curves.rs @@ -20,62 +20,43 @@ //! //! …consequently `zbus-xmlgen` did not generate code for the above interfaces. +use rog_platform::platform::PlatformPolicy; use rog_profiles::fan_curve_set::CurveData; -use rog_profiles::{FanCurvePU, Profile}; +use rog_profiles::FanCurvePU; use zbus::dbus_proxy; #[dbus_proxy( interface = "org.asuslinux.Daemon", - default_path = "/org/asuslinux/Profile" + default_service = "org.asuslinux.Daemon", + default_path = "/org/asuslinux/FanCurves" )] -trait Profile { - /// Get the fan-curve data for the currently active Profile - fn fan_curve_data(&self, profile: Profile) -> zbus::Result>; +trait FanCurves { + /// Get the fan-curve data for the currently active PlatformProfile + fn fan_curve_data(&self, profile: PlatformPolicy) -> zbus::Result>; - /// Fetch the active profile name - fn active_profile(&self) -> zbus::Result; + /// Reset the stored (self) and device curve to the defaults of the + /// platform. + /// + /// Each platform_profile has a different default and the defualt can be + /// read only for the currently active profile. + fn reset_profile_curves(&self, profile: PlatformPolicy) -> zbus::fdo::Result<()>; - /// Toggle to next platform_profile. Names provided by `Profiles`. - /// If fan-curves are supported will also activate a fan curve for profile. - fn next_profile(&self) -> zbus::Result<()>; + /// SetActiveCurveToDefaults method + fn set_active_curve_to_defaults(&self) -> zbus::Result<()>; - /// Fetch profile names - fn profiles(&self) -> zbus::Result>; - - /// Set this platform_profile name as active - fn set_active_profile(&self, profile: Profile) -> zbus::Result<()>; + /// Set the fan curve for the specified profile, or the profile the user is + /// currently in if profile == None. Will also activate the fan curve. + fn set_fan_curve(&self, profile: PlatformPolicy, curve: CurveData) -> zbus::Result<()>; /// Set a profile fan curve enabled status. Will also activate a fan curve. - fn set_fan_curves_enabled(&self, profile: Profile, enabled: bool) -> zbus::Result<()>; + fn set_fan_curves_enabled(&self, profile: PlatformPolicy, enabled: bool) -> zbus::Result<()>; /// Set a single fan curve for a profile to enabled status. Will also /// activate a fan curve. async fn set_profile_fan_curve_enabled( &self, - profile: Profile, + profile: PlatformPolicy, fan: FanCurvePU, enabled: bool, ) -> zbus::Result<()>; - - /// Set the fan curve for the specified profile, or the profile the user is - /// currently in if profile == None. Will also activate the fan curve. - fn set_fan_curve(&self, profile: Profile, curve: CurveData) -> zbus::Result<()>; - - /// Reset the stored (self) and device curve to the defaults of the - /// platform. - /// - /// Each platform_profile has a different default and the defualt can be - /// read only for the currently active profile. - fn set_active_curve_to_defaults(&self) -> zbus::Result<()>; - - /// Reset the stored (self) and device curve to the defaults of the - /// platform. - /// - /// Each platform_profile has a different default and the defualt can be - /// read only for the currently active profile. - fn reset_profile_curves(&self, profile: Profile) -> zbus::fdo::Result<()>; - - /// NotifyProfile signal - #[dbus_proxy(signal)] - async fn notify_profile(&self, profile: Profile) -> zbus::Result; } diff --git a/rog-dbus/src/zbus_platform.rs b/rog-dbus/src/zbus_platform.rs index f2150e4f..a3c53617 100644 --- a/rog-dbus/src/zbus_platform.rs +++ b/rog-dbus/src/zbus_platform.rs @@ -20,16 +20,29 @@ //! //! …consequently `zbus-xmlgen` did not generate code for the above interfaces. -use rog_platform::platform::GpuMode; +use rog_platform::platform::{GpuMode, PlatformPolicy, Properties}; use zbus::dbus_proxy; #[dbus_proxy( interface = "org.asuslinux.Daemon", + default_service = "org.asuslinux.Daemon", default_path = "/org/asuslinux/Platform" )] -trait RogBios { +trait Platform { + /// NextThrottleThermalPolicy method + fn next_throttle_thermal_policy(&self) -> zbus::Result<()>; + + /// SupportedInterfaces method + fn supported_interfaces(&self) -> zbus::Result>; + /// SupportedProperties method - fn supported_properties(&self) -> zbus::Result>; + fn supported_properties(&self) -> zbus::Result>; + + /// ChargeControlEndThreshold property + #[dbus_proxy(property)] + fn charge_control_end_threshold(&self) -> zbus::Result; + #[dbus_proxy(property)] + fn set_charge_control_end_threshold(&self, value: u8) -> zbus::Result<()>; /// DgpuDisable property #[dbus_proxy(property)] @@ -42,55 +55,72 @@ trait RogBios { /// GpuMuxMode property #[dbus_proxy(property)] fn gpu_mux_mode(&self) -> zbus::Result; + #[dbus_proxy(property)] fn set_gpu_mux_mode(&self, value: GpuMode) -> zbus::Result<()>; /// MiniLedMode property #[dbus_proxy(property)] fn mini_led_mode(&self) -> zbus::Result; + #[dbus_proxy(property)] fn set_mini_led_mode(&self, value: bool) -> zbus::Result<()>; /// NvDynamicBoost property #[dbus_proxy(property)] fn nv_dynamic_boost(&self) -> zbus::Result; + #[dbus_proxy(property)] fn set_nv_dynamic_boost(&self, value: u8) -> zbus::Result<()>; /// NvTempTarget property #[dbus_proxy(property)] fn nv_temp_target(&self) -> zbus::Result; + #[dbus_proxy(property)] fn set_nv_temp_target(&self, value: u8) -> zbus::Result<()>; /// PanelOd property #[dbus_proxy(property)] fn panel_od(&self) -> zbus::Result; + #[dbus_proxy(property)] fn set_panel_od(&self, value: bool) -> zbus::Result<()>; /// PostAnimationSound property #[dbus_proxy(property)] fn post_animation_sound(&self) -> zbus::Result; + #[dbus_proxy(property)] fn set_post_animation_sound(&self, value: bool) -> zbus::Result<()>; /// PptApuSppt property #[dbus_proxy(property)] fn ppt_apu_sppt(&self) -> zbus::Result; + #[dbus_proxy(property)] fn set_ppt_apu_sppt(&self, value: u8) -> zbus::Result<()>; /// PptFppt property #[dbus_proxy(property)] fn ppt_fppt(&self) -> zbus::Result; + #[dbus_proxy(property)] fn set_ppt_fppt(&self, value: u8) -> zbus::Result<()>; /// PptPl1Spl property #[dbus_proxy(property)] fn ppt_pl1_spl(&self) -> zbus::Result; + #[dbus_proxy(property)] fn set_ppt_pl1_spl(&self, value: u8) -> zbus::Result<()>; /// PptPl2Sppt property #[dbus_proxy(property)] fn ppt_pl2_sppt(&self) -> zbus::Result; + #[dbus_proxy(property)] fn set_ppt_pl2_sppt(&self, value: u8) -> zbus::Result<()>; /// PptPlatformSppt property #[dbus_proxy(property)] fn ppt_platform_sppt(&self) -> zbus::Result; + #[dbus_proxy(property)] fn set_ppt_platform_sppt(&self, value: u8) -> zbus::Result<()>; + + /// PlatformPolicy property + #[dbus_proxy(property)] + fn throttle_thermal_policy(&self) -> zbus::Result; + #[dbus_proxy(property)] + fn set_throttle_thermal_policy(&self, value: PlatformPolicy) -> zbus::Result<()>; } diff --git a/rog-dbus/src/zbus_power.rs b/rog-dbus/src/zbus_power.rs deleted file mode 100644 index 44833019..00000000 --- a/rog-dbus/src/zbus_power.rs +++ /dev/null @@ -1,46 +0,0 @@ -//! # `DBus` interface proxy for: `org.asuslinux.Daemon` -//! -//! This code was generated by `zbus-xmlgen` `1.0.0` from `DBus` introspection -//! data. Source: `Interface '/org/asuslinux/Charge' from service -//! 'org.asuslinux.Daemon' on system bus`. -//! -//! You may prefer to adapt it, instead of using it verbatim. -//! -//! More information can be found in the -//! [Writing a client proxy](https://zeenix.pages.freedesktop.org/zbus/client.html) -//! section of the zbus documentation. -//! -//! This `DBus` object implements -//! [standard `DBus` interfaces](https://dbus.freedesktop.org/doc/dbus-specification.html), -//! (`org.freedesktop.DBus.*`) for which the following zbus proxies can be used: -//! -//! * [`zbus::fdo::PropertiesProxy`] -//! * [`zbus::fdo::PeerProxy`] -//! * [`zbus::fdo::IntrospectableProxy`] -//! -//! …consequently `zbus-xmlgen` did not generate code for the above interfaces. - -use zbus::dbus_proxy; - -#[dbus_proxy( - interface = "org.asuslinux.Daemon", - default_path = "/org/asuslinux/Power" -)] -trait Power { - /// charge_control_end_threshold method - fn charge_control_end_threshold(&self) -> zbus::Result; - - /// MainsOnline method - fn mains_online(&self) -> zbus::Result; - - /// set_charge_control_end_threshold method - fn set_charge_control_end_threshold(&self, limit: u8) -> zbus::Result<()>; - - /// NotifyCharge signal - #[dbus_proxy(signal)] - fn notify_charge_control_end_threshold(&self, limit: u8) -> zbus::Result; - - /// NotifyMainsOnline signal - #[dbus_proxy(signal)] - fn notify_mains_online(&self, on: bool) -> zbus::Result<()>; -} diff --git a/rog-dbus/src/zbus_supported.rs b/rog-dbus/src/zbus_supported.rs deleted file mode 100644 index f4bc912a..00000000 --- a/rog-dbus/src/zbus_supported.rs +++ /dev/null @@ -1,33 +0,0 @@ -//! # `DBus` interface proxy for: `org.asuslinux.Daemon` -//! -//! This code was generated by `zbus-xmlgen` `1.0.0` from `DBus` introspection -//! data. Source: `Interface '/org/asuslinux/Supported' from service -//! 'org.asuslinux.Daemon' on system bus`. -//! -//! You may prefer to adapt it, instead of using it verbatim. -//! -//! More information can be found in the -//! [Writing a client proxy](https://zeenix.pages.freedesktop.org/zbus/client.html) -//! section of the zbus documentation. -//! -//! This `DBus` object implements -//! [standard `DBus` interfaces](https://dbus.freedesktop.org/doc/dbus-specification.html), -//! (`org.freedesktop.DBus.*`) for which the following zbus proxies can be used: -//! -//! * [`zbus::fdo::PeerProxy`] -//! * [`zbus::fdo::PropertiesProxy`] -//! * [`zbus::fdo::IntrospectableProxy`] -//! -//! …consequently `zbus-xmlgen` did not generate code for the above interfaces. - -use rog_platform::supported::SupportedFunctions; -use zbus::dbus_proxy; - -#[dbus_proxy( - interface = "org.asuslinux.Daemon", - default_path = "/org/asuslinux/Supported" -)] -trait Supported { - /// SupportedFunctions method - fn supported_functions(&self) -> zbus::Result; -} diff --git a/rog-platform/Cargo.toml b/rog-platform/Cargo.toml index 303c1924..b4fce100 100644 --- a/rog-platform/Cargo.toml +++ b/rog-platform/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" [dependencies] log.workspace = true -rog_aura = { path = "../rog-aura" } -rog_profiles = { path = "../rog-profiles" } serde.workspace = true serde_derive.workspace = true zbus.workspace = true @@ -19,4 +17,5 @@ typeshare.workspace = true rusb.workspace = true [dev-dependencies] -cargo-husky.workspace = true \ No newline at end of file +cargo-husky.workspace = true +rog_aura = { path = "../rog-aura" } \ No newline at end of file diff --git a/rog-platform/src/cpu.rs b/rog-platform/src/cpu.rs new file mode 100644 index 00000000..deb0f5e4 --- /dev/null +++ b/rog-platform/src/cpu.rs @@ -0,0 +1,258 @@ +use std::path::PathBuf; + +use log::{info, warn}; +use serde::{Deserialize, Serialize}; +use typeshare::typeshare; +use zbus::zvariant::{OwnedValue, Type, Value}; + +use crate::error::{PlatformError, Result}; +use crate::platform::PlatformPolicy; +use crate::{read_attr_string, to_device}; + +const ATTR_AVAILABLE_GOVERNORS: &str = "cpufreq/scaling_available_governors"; +const ATTR_GOVERNOR: &str = "cpufreq/scaling_governor"; +const ATTR_AVAILABLE_EPP: &str = "cpufreq/energy_performance_available_preferences"; +const ATTR_EPP: &str = "cpufreq/energy_performance_preference"; + +/// Both modern AMD and Intel have cpufreq control if using `powersave` +/// governor. What interests us the most here is `energy_performance_preference` +/// which can drastically alter CPU performance. +#[derive(Debug, PartialEq, Eq, PartialOrd, Clone)] +pub struct CPUControl { + paths: Vec, +} + +impl CPUControl { + pub fn new() -> Result { + let mut enumerator = udev::Enumerator::new().map_err(|err| { + warn!("{}", err); + PlatformError::Udev("enumerator failed".into(), err) + })?; + enumerator.match_subsystem("cpu").map_err(|err| { + warn!("{}", err); + PlatformError::Udev("match_subsystem failed".into(), err) + })?; + + let mut supported = false; + let mut cpu = CPUControl { paths: Vec::new() }; + for device in enumerator.scan_devices().map_err(|err| { + warn!("{}", err); + PlatformError::Udev("CPU: scan_devices failed".into(), err) + })? { + if !supported { + info!( + "Found CPU support at {:?}, checking supported items", + device.sysname() + ); + + match device.attribute_value(ATTR_AVAILABLE_GOVERNORS) { + Some(g) => info!("{ATTR_AVAILABLE_GOVERNORS}: {g:?}"), + None => { + return Err(PlatformError::CPU(format!( + "{ATTR_AVAILABLE_GOVERNORS} not found" + ))) + } + } + match device.attribute_value(ATTR_GOVERNOR) { + Some(g) => info!("{ATTR_GOVERNOR}: {g:?}"), + None => return Err(PlatformError::CPU(format!("{ATTR_GOVERNOR} not found"))), + } + match device.attribute_value(ATTR_AVAILABLE_EPP) { + Some(g) => info!("{ATTR_AVAILABLE_EPP}: {g:?}"), + None => { + return Err(PlatformError::CPU(format!( + "{ATTR_AVAILABLE_EPP} not found" + ))) + } + } + match device.attribute_value(ATTR_EPP) { + Some(g) => info!("{ATTR_EPP}: {g:?}"), + None => return Err(PlatformError::CPU(format!("{ATTR_EPP} not found"))), + } + supported = true; + } + if supported { + info!("Adding: {:?}", device.syspath()); + cpu.paths.push(device.syspath().to_owned()); + } + } + if cpu.paths.is_empty() { + return Err(PlatformError::MissingFunction( + "asus-nb-wmi not found".into(), + )); + } + Ok(cpu) + } + + pub fn get_governor(&self) -> Result { + if let Some(path) = self.paths.first() { + let s = read_attr_string(&to_device(path)?, ATTR_GOVERNOR)?; + Ok(s.as_str().into()) + // TODO: check cpu are sync + } else { + Err(PlatformError::CPU("No CPU's?".to_string())) + } + } + + pub fn get_available_governors(&self) -> Result> { + if let Some(path) = self.paths.first() { + read_attr_string(&to_device(path)?, ATTR_AVAILABLE_GOVERNORS) + .map(|s| s.split_whitespace().map(|s| s.into()).collect()) + // TODO: check cpu are sync + } else { + Err(PlatformError::CPU("No CPU's?".to_string())) + } + } + + pub fn set_governor(&self, gov: CPUGovernor) -> Result<()> { + if !self.get_available_governors()?.contains(&gov) { + return Err(PlatformError::CPU(format!("{gov:?} is not available"))); + } + for path in &self.paths { + let mut dev = to_device(path)?; + dev.set_attribute_value(ATTR_AVAILABLE_GOVERNORS, String::from(gov))?; + } + Ok(()) + } + + pub fn get_epp(&self) -> Result { + if let Some(path) = self.paths.first() { + let s = read_attr_string(&to_device(path)?, ATTR_EPP)?; + Ok(s.as_str().into()) + // TODO: check cpu are sync + } else { + Err(PlatformError::CPU("No CPU's?".to_string())) + } + } + + pub fn get_available_epp(&self) -> Result> { + if let Some(path) = self.paths.first() { + read_attr_string(&to_device(path)?, ATTR_AVAILABLE_EPP) + .map(|s| s.split_whitespace().map(|s| s.into()).collect()) + // TODO: check cpu are sync + } else { + Err(PlatformError::CPU("No CPU's?".to_string())) + } + } + + pub fn set_epp(&self, epp: CPUEPP) -> Result<()> { + if !self.get_available_epp()?.contains(&epp) { + return Err(PlatformError::CPU(format!("{epp:?} is not available"))); + } + for path in &self.paths { + let mut dev = to_device(path)?; + dev.set_attribute_value(ATTR_EPP, String::from(epp))?; + } + Ok(()) + } +} + +#[typeshare] +#[repr(u8)] +#[derive( + Deserialize, Serialize, Type, Value, OwnedValue, Debug, PartialEq, PartialOrd, Clone, Copy, +)] +#[zvariant(signature = "s")] +pub enum CPUGovernor { + Performance = 0, + Powersave = 1, + BadValue = 2, +} + +impl From<&str> for CPUGovernor { + fn from(s: &str) -> Self { + match s { + "performance" => Self::Performance, + "powersave" => Self::Powersave, + _ => Self::BadValue, + } + } +} + +impl From for String { + fn from(g: CPUGovernor) -> Self { + match g { + CPUGovernor::Performance => "performance".to_string(), + CPUGovernor::Powersave => "powersave".to_string(), + CPUGovernor::BadValue => "bad_value".to_string(), + } + } +} + +#[typeshare] +#[repr(u8)] +#[derive( + Deserialize, Serialize, Type, Value, OwnedValue, Debug, PartialEq, PartialOrd, Clone, Copy, +)] +#[zvariant(signature = "s")] +pub enum CPUEPP { + Default = 0, + Performance = 1, + BalancePerformance = 2, + BalancePower = 3, + Power = 4, +} + +impl From for CPUEPP { + fn from(value: PlatformPolicy) -> Self { + match value { + PlatformPolicy::Balanced => CPUEPP::BalancePerformance, + PlatformPolicy::Performance => CPUEPP::Performance, + PlatformPolicy::Quiet => CPUEPP::Power, + } + } +} + +impl From<&str> for CPUEPP { + fn from(s: &str) -> Self { + match s { + "default" => Self::Default, + "performance" => Self::Performance, + "balance_performance" => Self::BalancePerformance, + "balance_power" => Self::BalancePower, + "power" => Self::Power, + _ => Self::Default, + } + } +} + +impl From for String { + fn from(g: CPUEPP) -> Self { + match g { + CPUEPP::Default => "default".to_string(), + CPUEPP::Performance => "performance".to_string(), + CPUEPP::BalancePerformance => "balance_performance".to_string(), + CPUEPP::BalancePower => "balance_power".to_string(), + CPUEPP::Power => "power".to_string(), + } + } +} + +#[cfg(test)] +mod tests { + use super::CPUControl; + use crate::cpu::{CPUGovernor, CPUEPP}; + + #[test] + #[ignore = "Can't run this in a docker image"] + fn check_cpu() { + let cpu = CPUControl::new().unwrap(); + assert_eq!(cpu.get_governor().unwrap(), CPUGovernor::Powersave); + assert_eq!( + cpu.get_available_governors().unwrap(), + vec![CPUGovernor::Performance, CPUGovernor::Powersave] + ); + + assert_eq!(cpu.get_epp().unwrap(), CPUEPP::BalancePower); + assert_eq!( + cpu.get_available_epp().unwrap(), + vec![ + CPUEPP::Default, + CPUEPP::Performance, + CPUEPP::BalancePerformance, + CPUEPP::BalancePower, + CPUEPP::Power, + ] + ); + } +} diff --git a/rog-platform/src/error.rs b/rog-platform/src/error.rs index e8c14ab8..cd5c52d3 100644 --- a/rog-platform/src/error.rs +++ b/rog-platform/src/error.rs @@ -1,5 +1,7 @@ use std::fmt; +use zbus::fdo::Error as FdoErr; + pub type Result = std::result::Result; #[derive(Debug)] @@ -19,6 +21,7 @@ pub enum PlatformError { Io(std::io::Error), NoAuraKeyboard, NoAuraNode, + CPU(String), } impl fmt::Display for PlatformError { @@ -45,6 +48,7 @@ impl fmt::Display for PlatformError { PlatformError::IoPath(path, detail) => write!(f, "{} {}", path, detail), PlatformError::NoAuraKeyboard => write!(f, "No supported Aura keyboard"), PlatformError::NoAuraNode => write!(f, "No Aura keyboard node found"), + PlatformError::CPU(s) => write!(f, "CPU control: {s}"), } } } @@ -62,3 +66,13 @@ impl From for PlatformError { PlatformError::Io(err) } } + +impl From for FdoErr { + fn from(error: PlatformError) -> Self { + log::error!("PlatformError: got: {error}"); + match error { + PlatformError::NotSupported => FdoErr::NotSupported("".to_owned()), + _ => FdoErr::Failed(format!("Failed with {error}")), + } + } +} diff --git a/rog-platform/src/hid_raw.rs b/rog-platform/src/hid_raw.rs index 44d8b758..bc7ff508 100644 --- a/rog-platform/src/hid_raw.rs +++ b/rog-platform/src/hid_raw.rs @@ -1,3 +1,4 @@ +use std::cell::UnsafeCell; use std::fs::OpenOptions; use std::io::Write; use std::path::PathBuf; @@ -6,8 +7,11 @@ use log::{info, warn}; use crate::error::{PlatformError, Result}; -#[derive(Debug, PartialEq, Eq, PartialOrd, Clone)] -pub struct HidRaw(PathBuf); +#[derive(Debug)] +pub struct HidRaw { + path: UnsafeCell, + prod_id: String, +} impl HidRaw { pub fn new(id_product: &str) -> Result { @@ -35,7 +39,10 @@ impl HidRaw { if parent == id_product { if let Some(dev_node) = device.devnode() { info!("Using device at: {:?} for hidraw control", dev_node); - return Ok(Self(dev_node.to_owned())); + return Ok(Self { + path: UnsafeCell::new(dev_node.to_owned()), + prod_id: id_product.to_string(), + }); } } } @@ -48,7 +55,10 @@ impl HidRaw { "Using device at: {:?} for control", dev_node ); - return Ok(Self(dev_node.to_owned())); + return Ok(Self { + path: UnsafeCell::new(dev_node.to_owned()), + prod_id: id_product.to_string(), + }); } } } @@ -60,12 +70,22 @@ impl HidRaw { } pub fn write_bytes(&self, message: &[u8]) -> Result<()> { - let mut file = OpenOptions::new() - .write(true) - .open(&self.0) - .map_err(|e| PlatformError::IoPath(self.0.to_string_lossy().to_string(), e))?; - // println!("write: {:02x?}", &message); + let mut path = unsafe { &*(self.path.get()) }; + let mut file = match OpenOptions::new().write(true).open(path) { + Ok(f) => f, + Err(e) => { + warn!("write_bytes failed for {:?}, trying again: {e}", self.path); + unsafe { + *(self.path.get()) = (*(Self::new(&self.prod_id)?.path.get())).clone(); + path = &mut *(self.path.get()); + } + OpenOptions::new() + .write(true) + .open(path) + .map_err(|e| PlatformError::IoPath(path.to_string_lossy().to_string(), e))? + } + }; file.write_all(message) - .map_err(|e| PlatformError::IoPath(self.0.to_string_lossy().to_string(), e)) + .map_err(|e| PlatformError::IoPath(path.to_string_lossy().to_string(), e)) } } diff --git a/rog-platform/src/lib.rs b/rog-platform/src/lib.rs index 354a8265..21b956bd 100644 --- a/rog-platform/src/lib.rs +++ b/rog-platform/src/lib.rs @@ -1,13 +1,13 @@ //! This crate functions as a wrapper of all the relevant ASUS functionality //! on ROG, Strix, and TUF laptops. +pub mod cpu; pub mod error; pub mod hid_raw; pub mod keyboard_led; pub(crate) mod macros; pub mod platform; pub mod power; -pub mod supported; pub mod usb_raw; use std::path::Path; diff --git a/rog-platform/src/platform.rs b/rog-platform/src/platform.rs index 1ca9550b..70319b68 100644 --- a/rog-platform/src/platform.rs +++ b/rog-platform/src/platform.rs @@ -5,10 +5,9 @@ use std::str::FromStr; use log::{info, warn}; use serde::{Deserialize, Serialize}; use typeshare::typeshare; -use zbus::zvariant::Type; +use zbus::zvariant::{OwnedValue, Type, Value}; use crate::error::{PlatformError, Result}; -use crate::supported::PlatformSupportedFunctions; use crate::{attr_bool, attr_string, attr_u8, to_device}; /// The "platform" device provides access to things like: @@ -20,12 +19,12 @@ use crate::{attr_bool, attr_string, attr_u8, to_device}; /// - `keyboard_mode`, set keyboard RGB mode and speed /// - `keyboard_state`, set keyboard power states #[derive(Debug, PartialEq, Eq, PartialOrd, Clone)] -pub struct AsusPlatform { +pub struct RogPlatform { path: PathBuf, pp_path: PathBuf, } -impl AsusPlatform { +impl RogPlatform { attr_bool!("dgpu_disable", path); attr_bool!("egpu_enable", path); @@ -138,7 +137,7 @@ impl AsusPlatform { } } -impl Default for AsusPlatform { +impl Default for RogPlatform { fn default() -> Self { unsafe { Self { @@ -149,39 +148,21 @@ impl Default for AsusPlatform { } } -impl From for PlatformSupportedFunctions { - fn from(a: AsusPlatform) -> Self { - PlatformSupportedFunctions { - post_animation_sound: a.has_post_animation_sound(), - gpu_mux: a.has_gpu_mux_mode(), - panel_overdrive: a.has_panel_od(), - dgpu_disable: a.has_dgpu_disable(), - egpu_enable: a.has_egpu_enable(), - mini_led_mode: a.has_mini_led_mode(), - ppt_pl1_spl: a.has_ppt_pl1_spl(), - ppt_pl2_sppt: a.has_ppt_pl2_sppt(), - ppt_fppt: a.has_ppt_fppt(), - ppt_apu_sppt: a.has_ppt_apu_sppt(), - ppt_platform_sppt: a.has_ppt_platform_sppt(), - nv_dynamic_boost: a.has_nv_dynamic_boost(), - nv_temp_target: a.has_nv_temp_target(), - } - } -} - #[typeshare] #[repr(u8)] -#[derive(Serialize, Deserialize, Default, Type, Debug, PartialEq, Eq, Clone, Copy)] +#[derive( + Serialize, Deserialize, Default, Type, Value, OwnedValue, Debug, PartialEq, Eq, Clone, Copy, +)] pub enum GpuMode { - Discrete, - Optimus, - Integrated, - Egpu, - Vfio, - Ultimate, + Discrete = 0, + Optimus = 1, + Integrated = 2, + Egpu = 3, + Vfio = 4, + Ultimate = 5, #[default] - Error, - NotSupported, + Error = 6, + NotSupported = 7, } impl From for GpuMode { @@ -266,3 +247,130 @@ impl Display for GpuMode { } } } + +#[typeshare] +#[repr(u8)] +#[derive( + Deserialize, + Serialize, + Default, + Type, + Value, + OwnedValue, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + Hash, + Clone, + Copy, +)] +#[zvariant(signature = "s")] +/// `throttle_thermal_policy` in asus_wmi +pub enum PlatformPolicy { + #[default] + Balanced = 0, + Performance = 1, + Quiet = 2, +} + +impl PlatformPolicy { + pub const fn next(&self) -> Self { + match self { + Self::Balanced => Self::Balanced, + Self::Performance => Self::Quiet, + Self::Quiet => Self::Balanced, + } + } + + pub const fn list() -> [Self; 3] { + [Self::Balanced, Self::Performance, Self::Quiet] + } +} + +impl From for PlatformPolicy { + fn from(num: u8) -> Self { + match num { + 0 => Self::Balanced, + 1 => Self::Performance, + 2 => Self::Quiet, + _ => { + warn!("Unknown number for PlatformProfile: {}", num); + Self::Balanced + } + } + } +} + +impl From for u8 { + fn from(p: PlatformPolicy) -> Self { + match p { + PlatformPolicy::Balanced => 0, + PlatformPolicy::Performance => 1, + PlatformPolicy::Quiet => 2, + } + } +} + +impl From for &str { + fn from(profile: PlatformPolicy) -> &'static str { + match profile { + PlatformPolicy::Balanced => "balanced", + PlatformPolicy::Performance => "performance", + PlatformPolicy::Quiet => "quiet", + } + } +} + +impl std::str::FromStr for PlatformPolicy { + type Err = PlatformError; + + fn from_str(profile: &str) -> Result { + match profile.to_ascii_lowercase().trim() { + "balanced" => Ok(PlatformPolicy::Balanced), + "performance" => Ok(PlatformPolicy::Performance), + "quiet" => Ok(PlatformPolicy::Quiet), + _ => Err(PlatformError::NotSupported), + } + } +} + +impl Display for PlatformPolicy { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self) + } +} + +impl PlatformPolicy { + pub fn get_next_profile(current: PlatformPolicy) -> PlatformPolicy { + match current { + PlatformPolicy::Balanced => PlatformPolicy::Performance, + PlatformPolicy::Performance => PlatformPolicy::Quiet, + PlatformPolicy::Quiet => PlatformPolicy::Balanced, + } + } +} + +/// CamelCase names of the properties. Intended for use with DBUS +#[typeshare] +#[repr(u8)] +#[derive(Debug, Clone, Copy, Serialize, Deserialize, Type, PartialEq, PartialOrd)] +#[zvariant(signature = "s")] +pub enum Properties { + ChargeControlEndThreshold, + DgpuDisable, + GpuMuxMode, + PostAnimationSound, + PanelOd, + MiniLedMode, + EgpuEnable, + PlatformPolicy, + PptPl1Spl, + PptPl2Sppt, + PptFppt, + PptApuSppt, + PptPlatformSppt, + NvDynamicBoost, + NvTempTarget, +} diff --git a/rog-platform/src/supported.rs b/rog-platform/src/supported.rs deleted file mode 100644 index 49015b18..00000000 --- a/rog-platform/src/supported.rs +++ /dev/null @@ -1,150 +0,0 @@ -use std::fmt; - -use rog_aura::aura_detection::PowerZones; -use rog_aura::usb::AuraDevice; -use rog_aura::{AdvancedAuraType, AuraModeNum, AuraZone}; -use rog_profiles::FanCurvePU; -use serde_derive::{Deserialize, Serialize}; -use typeshare::typeshare; -use zbus::zvariant::Type; - -#[typeshare] -#[derive(Serialize, Deserialize, Type, Debug, Default, Clone)] -pub struct SupportedFunctions { - pub anime_ctrl: AnimeSupportedFunctions, - pub charge_ctrl: ChargeSupportedFunctions, - pub platform_profile: PlatformProfileFunctions, - pub keyboard_led: LedSupportedFunctions, - pub rog_bios_ctrl: PlatformSupportedFunctions, -} - -#[typeshare] -#[derive(Serialize, Deserialize, Type, Debug, Default, Clone)] -pub struct AnimeSupportedFunctions(pub bool); - -#[typeshare] -#[derive(Serialize, Deserialize, Type, Debug, Default, Clone)] -pub struct ChargeSupportedFunctions { - pub charge_level_set: bool, -} - -#[typeshare] -#[derive(Serialize, Deserialize, Type, Debug, Default, Clone)] -pub struct PlatformProfileFunctions { - pub platform_profile: bool, - pub fans: Vec, -} - -#[typeshare] -#[derive(Serialize, Deserialize, Default, Type, Debug, Clone)] -#[zvariant(signature = "s")] -pub enum AdvancedAura { - #[default] - None, - Zoned, - PerKey, -} - -impl From for AdvancedAura { - fn from(a: AdvancedAuraType) -> Self { - match a { - AdvancedAuraType::None => Self::None, - AdvancedAuraType::Zoned(_) => Self::Zoned, - AdvancedAuraType::PerKey => Self::PerKey, - } - } -} - -#[typeshare] -#[derive(Serialize, Deserialize, Type, Debug, Default, Clone)] -pub struct LedSupportedFunctions { - pub dev_id: AuraDevice, - pub brightness: bool, - pub basic_modes: Vec, - pub basic_zones: Vec, - pub advanced_type: AdvancedAura, - pub power_zones: Vec, -} - -#[typeshare] -#[derive(Serialize, Deserialize, Type, Debug, Default, Clone)] -pub struct PlatformSupportedFunctions { - pub post_animation_sound: bool, - pub gpu_mux: bool, - pub panel_overdrive: bool, - pub dgpu_disable: bool, - pub egpu_enable: bool, - pub mini_led_mode: bool, - - pub ppt_pl1_spl: bool, - pub ppt_pl2_sppt: bool, - pub ppt_fppt: bool, - pub ppt_apu_sppt: bool, - pub ppt_platform_sppt: bool, - pub nv_dynamic_boost: bool, - pub nv_temp_target: bool, -} - -impl fmt::Display for SupportedFunctions { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - writeln!(f, "\n{}", self.anime_ctrl)?; - writeln!(f, "{}", self.charge_ctrl)?; - writeln!(f, "{}", self.platform_profile)?; - writeln!(f, "{}", self.keyboard_led)?; - writeln!(f, "{}", self.rog_bios_ctrl) - } -} - -impl fmt::Display for AnimeSupportedFunctions { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - writeln!(f, "AniMe Matrix:")?; - writeln!(f, "\tAnime Matrix control: {}", self.0) - } -} -impl fmt::Display for ChargeSupportedFunctions { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - writeln!(f, "Charge:")?; - writeln!( - f, - "\tBattery charge limit control: {}", - self.charge_level_set - ) - } -} -impl fmt::Display for PlatformProfileFunctions { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - writeln!(f, "Platform profiles:")?; - writeln!(f, "\tplatform: {}", self.platform_profile)?; - writeln!(f, "\tfan curves: {:?}", self.fans) - } -} -impl fmt::Display for LedSupportedFunctions { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - writeln!(f, "LED:")?; - writeln!(f, "\tDevice ID: {:?}", self.dev_id)?; - writeln!(f, "\tBrightness control: {}", self.brightness)?; - writeln!(f, "\tBasic modes: {:?}", self.basic_modes)?; - writeln!(f, "\tBasic zones: {:?}", self.basic_zones)?; - writeln!(f, "\tAdvanced modes: {:?}", self.advanced_type) - } -} - -impl fmt::Display for PlatformSupportedFunctions { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - writeln!(f, "ROG BIOS:")?; - writeln!(f, "\tPOST sound switch: {}", self.post_animation_sound)?; - writeln!(f, "\tPanel Overdrive: {}", self.panel_overdrive)?; - writeln!(f, "\tMiniLED backlight: {}", self.mini_led_mode)?; - writeln!(f, "\tdGPU disable switch: {}", self.dgpu_disable)?; - writeln!(f, "\teGPU enable switch: {}", self.egpu_enable)?; - writeln!(f, "\tGPU MUX control: {}", self.gpu_mux)?; - writeln!(f, "\tppt_pl1_spl: {}", self.ppt_pl1_spl)?; - writeln!(f, "\tppt_pl2_sppt: {}", self.ppt_pl2_sppt)?; - writeln!(f, "\tppt_fppt {}", self.ppt_fppt)?; - writeln!(f, "\tppt_apu_sppt: {}", self.ppt_apu_sppt)?; - writeln!(f, "\tppt_platform_sppt: {}", self.ppt_platform_sppt)?; - writeln!(f, "\tnv_dynamic_boost: {}", self.nv_dynamic_boost)?; - writeln!(f, "\tnv_temp_target: {}", self.nv_temp_target)?; - Ok(()) - } -} diff --git a/rog-profiles/Cargo.toml b/rog-profiles/Cargo.toml index d32edd20..b53b14ed 100644 --- a/rog-profiles/Cargo.toml +++ b/rog-profiles/Cargo.toml @@ -15,6 +15,7 @@ udev.workspace = true serde.workspace = true serde_derive.workspace = true typeshare.workspace = true +rog_platform = { path = "../rog-platform" } zbus = { workspace = true, optional = true } diff --git a/rog-profiles/src/error.rs b/rog-profiles/src/error.rs index 5594b5cd..d2fe8451 100644 --- a/rog-profiles/src/error.rs +++ b/rog-profiles/src/error.rs @@ -1,5 +1,8 @@ use std::fmt; +use log::error; +use zbus::fdo::Error as FdoErr; + #[derive(Debug)] pub enum ProfileError { Path(String, std::io::Error), @@ -48,6 +51,17 @@ impl std::error::Error for ProfileError {} impl From for ProfileError { fn from(err: std::io::Error) -> Self { + error!("ProfileError: got: {err}"); ProfileError::Io(err) } } + +impl From for FdoErr { + fn from(error: ProfileError) -> Self { + error!("ProfileError: got: {error}"); + match error { + ProfileError::NotSupported => FdoErr::NotSupported("".to_owned()), + _ => FdoErr::Failed(format!("Failed with {error}")), + } + } +} diff --git a/rog-profiles/src/lib.rs b/rog-profiles/src/lib.rs index 712adab1..1bf621bb 100644 --- a/rog-profiles/src/lib.rs +++ b/rog-profiles/src/lib.rs @@ -1,26 +1,19 @@ pub mod error; pub mod fan_curve_set; -use std::fmt::Display; -use std::fs::{self, OpenOptions}; -use std::io::Write; -use std::path::Path; - use error::ProfileError; use fan_curve_set::CurveData; use log::debug; +use rog_platform::platform::PlatformPolicy; use serde_derive::{Deserialize, Serialize}; use typeshare::typeshare; -use udev::Device; +pub use udev::Device; #[cfg(feature = "dbus")] use zbus::zvariant::Type; -pub const PLATFORM_PROFILE: &str = "/sys/firmware/acpi/platform_profile"; -pub const PLATFORM_PROFILES: &str = "/sys/firmware/acpi/platform_profile_choices"; - pub const VERSION: &str = env!("CARGO_PKG_VERSION"); -pub fn find_fan_curve_node() -> Result, ProfileError> { +pub fn find_fan_curve_node() -> Result { let mut enumerator = udev::Enumerator::new()?; enumerator.match_subsystem("hwmon")?; @@ -28,7 +21,7 @@ pub fn find_fan_curve_node() -> Result, ProfileError> { if device.parent_with_subsystem("platform")?.is_some() { if let Some(name) = device.attribute_value("name") { if name == "asus_custom_fan_curve" { - return Ok(Some(device)); + return Ok(device); } } } @@ -37,99 +30,6 @@ pub fn find_fan_curve_node() -> Result, ProfileError> { Err(ProfileError::NotSupported) } -#[typeshare] -#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] -#[derive(Deserialize, Serialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] -pub enum Profile { - Balanced, - Performance, - Quiet, -} - -impl Profile { - pub fn is_platform_profile_supported() -> bool { - Path::new(PLATFORM_PROFILES).exists() - } - - pub fn get_active_profile() -> Result { - let buf = fs::read_to_string(PLATFORM_PROFILE)?; - Ok(buf.as_str().into()) - } - - pub fn get_profile_names() -> Result, ProfileError> { - let buf = fs::read_to_string(PLATFORM_PROFILES)?; - Ok(buf.rsplit(' ').map(|p| p.into()).collect()) - } - - pub fn set_profile(profile: Profile) -> Result<(), ProfileError> { - let mut file = OpenOptions::new().write(true).open(PLATFORM_PROFILE)?; - file.write_all(<&str>::from(profile).as_bytes())?; - Ok(()) - } - - pub fn from_throttle_thermal_policy(num: u8) -> Self { - match num { - 1 => Self::Performance, - 2 => Self::Quiet, - _ => Self::Balanced, - } - } - - pub fn get_next_profile(current: Profile) -> Profile { - // Read first just incase the user has modified the config before calling this - match current { - Profile::Balanced => Profile::Performance, - Profile::Performance => Profile::Quiet, - Profile::Quiet => Profile::Balanced, - } - } -} - -impl Default for Profile { - fn default() -> Self { - Self::Balanced - } -} - -impl From for &str { - fn from(profile: Profile) -> &'static str { - match profile { - Profile::Balanced => "balanced", - Profile::Performance => "performance", - Profile::Quiet => "quiet", - } - } -} - -impl From<&str> for Profile { - fn from(profile: &str) -> Profile { - match profile.to_ascii_lowercase().trim() { - "performance" => Profile::Performance, - "quiet" => Profile::Quiet, - _ => Profile::Balanced, - } - } -} - -impl std::str::FromStr for Profile { - type Err = ProfileError; - - fn from_str(profile: &str) -> Result { - match profile.to_ascii_lowercase().trim() { - "balanced" => Ok(Profile::Balanced), - "performance" => Ok(Profile::Performance), - "quiet" => Ok(Profile::Quiet), - _ => Err(ProfileError::ParseProfileName), - } - } -} - -impl Display for Profile { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self) - } -} - #[typeshare] #[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] #[derive(Deserialize, Serialize, Debug, Hash, PartialEq, Eq, Clone, Copy)] @@ -208,32 +108,17 @@ pub struct FanCurveProfiles { } impl FanCurveProfiles { - pub fn get_device() -> Result { - let mut enumerator = udev::Enumerator::new()?; - enumerator.match_subsystem("hwmon")?; - - for device in enumerator.scan_devices()? { - if let Some(name) = device.attribute_value("name") { - if name == "asus_custom_fan_curve" { - debug!("asus_custom_fan_curve found"); - return Ok(device); - } - } - } - Err(ProfileError::NotSupported) - } - /// Return an array of `FanCurvePU`. An empty array indicates no support for /// Curves. pub fn supported_fans() -> Result, ProfileError> { - let device = Self::get_device()?; + let device = find_fan_curve_node()?; Ok(FanCurvePU::which_fans(&device)) } /// pub fn read_from_dev_profile( &mut self, - profile: Profile, + profile: PlatformPolicy, device: &Device, ) -> Result<(), ProfileError> { let fans = Self::supported_fans()?; @@ -251,9 +136,9 @@ impl FanCurveProfiles { } match profile { - Profile::Balanced => self.balanced = curves, - Profile::Performance => self.performance = curves, - Profile::Quiet => self.quiet = curves, + PlatformPolicy::Balanced => self.balanced = curves, + PlatformPolicy::Performance => self.performance = curves, + PlatformPolicy::Quiet => self.quiet = curves, } Ok(()) } @@ -265,7 +150,7 @@ impl FanCurveProfiles { /// read only for the currently active profile. pub fn set_active_curve_to_defaults( &mut self, - profile: Profile, + profile: PlatformPolicy, device: &mut Device, ) -> Result<(), ProfileError> { let fans = Self::supported_fans()?; @@ -285,13 +170,13 @@ impl FanCurveProfiles { // TODO: Make this return an error if curve is zeroed pub fn write_profile_curve_to_platform( &mut self, - profile: Profile, + profile: PlatformPolicy, device: &mut Device, - ) -> std::io::Result<()> { + ) -> Result<(), ProfileError> { let fans = match profile { - Profile::Balanced => &mut self.balanced, - Profile::Performance => &mut self.performance, - Profile::Quiet => &mut self.quiet, + PlatformPolicy::Balanced => &mut self.balanced, + PlatformPolicy::Performance => &mut self.performance, + PlatformPolicy::Quiet => &mut self.quiet, }; for fan in fans { debug!("write_profile_curve_to_platform: writing profile:{profile}, {fan:?}"); @@ -300,19 +185,19 @@ impl FanCurveProfiles { Ok(()) } - pub fn set_profile_curves_enabled(&mut self, profile: Profile, enabled: bool) { + pub fn set_profile_curves_enabled(&mut self, profile: PlatformPolicy, enabled: bool) { match profile { - Profile::Balanced => { + PlatformPolicy::Balanced => { for curve in self.balanced.iter_mut() { curve.enabled = enabled; } } - Profile::Performance => { + PlatformPolicy::Performance => { for curve in self.performance.iter_mut() { curve.enabled = enabled; } } - Profile::Quiet => { + PlatformPolicy::Quiet => { for curve in self.quiet.iter_mut() { curve.enabled = enabled; } @@ -322,12 +207,12 @@ impl FanCurveProfiles { pub fn set_profile_fan_curve_enabled( &mut self, - profile: Profile, + profile: PlatformPolicy, fan: FanCurvePU, enabled: bool, ) { match profile { - Profile::Balanced => { + PlatformPolicy::Balanced => { for curve in self.balanced.iter_mut() { if curve.fan == fan { curve.enabled = enabled; @@ -335,7 +220,7 @@ impl FanCurveProfiles { } } } - Profile::Performance => { + PlatformPolicy::Performance => { for curve in self.performance.iter_mut() { if curve.fan == fan { curve.enabled = enabled; @@ -343,7 +228,7 @@ impl FanCurveProfiles { } } } - Profile::Quiet => { + PlatformPolicy::Quiet => { for curve in self.quiet.iter_mut() { if curve.fan == fan { curve.enabled = enabled; @@ -354,31 +239,31 @@ impl FanCurveProfiles { } } - pub fn get_fan_curves_for(&self, name: Profile) -> &[CurveData] { + pub fn get_fan_curves_for(&self, name: PlatformPolicy) -> &[CurveData] { match name { - Profile::Balanced => &self.balanced, - Profile::Performance => &self.performance, - Profile::Quiet => &self.quiet, + PlatformPolicy::Balanced => &self.balanced, + PlatformPolicy::Performance => &self.performance, + PlatformPolicy::Quiet => &self.quiet, } } - pub fn get_fan_curve_for(&self, name: &Profile, pu: FanCurvePU) -> Option<&CurveData> { + pub fn get_fan_curve_for(&self, name: &PlatformPolicy, pu: FanCurvePU) -> Option<&CurveData> { match name { - Profile::Balanced => { + PlatformPolicy::Balanced => { for this_curve in self.balanced.iter() { if this_curve.fan == pu { return Some(this_curve); } } } - Profile::Performance => { + PlatformPolicy::Performance => { for this_curve in self.performance.iter() { if this_curve.fan == pu { return Some(this_curve); } } } - Profile::Quiet => { + PlatformPolicy::Quiet => { for this_curve in self.quiet.iter() { if this_curve.fan == pu { return Some(this_curve); @@ -389,9 +274,13 @@ impl FanCurveProfiles { None } - pub fn save_fan_curve(&mut self, curve: CurveData, profile: Profile) -> std::io::Result<()> { + pub fn save_fan_curve( + &mut self, + curve: CurveData, + profile: PlatformPolicy, + ) -> Result<(), ProfileError> { match profile { - Profile::Balanced => { + PlatformPolicy::Balanced => { for this_curve in self.balanced.iter_mut() { if this_curve.fan == curve.fan { *this_curve = curve; @@ -399,7 +288,7 @@ impl FanCurveProfiles { } } } - Profile::Performance => { + PlatformPolicy::Performance => { for this_curve in self.performance.iter_mut() { if this_curve.fan == curve.fan { *this_curve = curve; @@ -407,7 +296,7 @@ impl FanCurveProfiles { } } } - Profile::Quiet => { + PlatformPolicy::Quiet => { for this_curve in self.quiet.iter_mut() { if this_curve.fan == curve.fan { *this_curve = curve;