diff --git a/.gitignore b/.gitignore index a4b21632..dd73461e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,12 @@ vendor_* .vscode .~lock.* *.ods# + +# gnome extension +node-modules +bindings/ts/*.d.ts +bindings/ts/*.js.map +desktop-extensions/gnome/_build +desktop-extensions/gnome/target +desktop-extensions/gnome/node_modules +desktop-extensions/gnome/schemas/gschemas.compiled diff --git a/asusd/src/ctrl_supported.rs b/asusd/src/ctrl_supported.rs index 3a94db75..63ab12bb 100644 --- a/asusd/src/ctrl_supported.rs +++ b/asusd/src/ctrl_supported.rs @@ -18,6 +18,11 @@ impl SupportedFunctions { pub fn supported_functions(&self) -> &rog_platform::supported::SupportedFunctions { &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] diff --git a/asusd/src/daemon.rs b/asusd/src/daemon.rs index 1bb7be62..06c84abe 100644 --- a/asusd/src/daemon.rs +++ b/asusd/src/daemon.rs @@ -65,7 +65,7 @@ async fn main() -> Result<(), Box> { async fn start_daemon() -> Result<(), Box> { 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?; diff --git a/bindings/dbus-xml/org-asuslinux-supported-4.xml b/bindings/dbus-xml/org-asuslinux-supported-4.xml index 991c37e7..1147c956 100644 --- a/bindings/dbus-xml/org-asuslinux-supported-4.xml +++ b/bindings/dbus-xml/org-asuslinux-supported-4.xml @@ -1,13 +1,8 @@ -method return time=1687861003.331930 sender=:1.463 -> destination=:1.474 serial=13 reply_serial=2 +method return time=1687945851.162246 sender=:1.3354 -> destination=:1.3359 serial=8 reply_serial=2 string " - - - - - @@ -15,9 +10,13 @@ method return time=1687861003.331930 sender=:1.463 -> destination=:1.474 serial= - - - + + + + + + + @@ -44,5 +43,10 @@ method return time=1687861003.331930 sender=:1.463 -> destination=:1.474 serial= + + + + + " diff --git a/bindings/ts/aura.js b/bindings/ts/aura.js new file mode 100644 index 00000000..9e592274 --- /dev/null +++ b/bindings/ts/aura.js @@ -0,0 +1,96 @@ +export var AuraModeNum; +(function (AuraModeNum) { + AuraModeNum["Static"] = "Static"; + AuraModeNum["Breathe"] = "Breathe"; + AuraModeNum["Strobe"] = "Strobe"; + AuraModeNum["Rainbow"] = "Rainbow"; + AuraModeNum["Star"] = "Star"; + AuraModeNum["Rain"] = "Rain"; + AuraModeNum["Highlight"] = "Highlight"; + AuraModeNum["Laser"] = "Laser"; + AuraModeNum["Ripple"] = "Ripple"; + AuraModeNum["Pulse"] = "Pulse"; + AuraModeNum["Comet"] = "Comet"; + AuraModeNum["Flash"] = "Flash"; +})(AuraModeNum || (AuraModeNum = {})); +export var AuraZone; +(function (AuraZone) { + AuraZone["None"] = "None"; + AuraZone["Key1"] = "Key1"; + AuraZone["Key2"] = "Key2"; + AuraZone["Key3"] = "Key3"; + AuraZone["Key4"] = "Key4"; + AuraZone["Logo"] = "Logo"; + AuraZone["BarLeft"] = "BarLeft"; + AuraZone["BarRight"] = "BarRight"; +})(AuraZone || (AuraZone = {})); +export var Speed; +(function (Speed) { + Speed["Low"] = "Low"; + Speed["Med"] = "Med"; + Speed["High"] = "High"; +})(Speed || (Speed = {})); +export var Direction; +(function (Direction) { + Direction["Right"] = "Right"; + Direction["Left"] = "Left"; + Direction["Up"] = "Up"; + Direction["Down"] = "Down"; +})(Direction || (Direction = {})); +export var AuraDevTuf; +(function (AuraDevTuf) { + AuraDevTuf["Boot"] = "Boot"; + AuraDevTuf["Awake"] = "Awake"; + AuraDevTuf["Sleep"] = "Sleep"; + AuraDevTuf["Keyboard"] = "Keyboard"; +})(AuraDevTuf || (AuraDevTuf = {})); +export var AuraDevRog1; +(function (AuraDevRog1) { + AuraDevRog1["Awake"] = "Awake"; + AuraDevRog1["Keyboard"] = "Keyboard"; + AuraDevRog1["Lightbar"] = "Lightbar"; + AuraDevRog1["Boot"] = "Boot"; + AuraDevRog1["Sleep"] = "Sleep"; +})(AuraDevRog1 || (AuraDevRog1 = {})); +export var AuraDevRog2; +(function (AuraDevRog2) { + AuraDevRog2["BootLogo"] = "BootLogo"; + AuraDevRog2["BootKeyb"] = "BootKeyb"; + AuraDevRog2["AwakeLogo"] = "AwakeLogo"; + AuraDevRog2["AwakeKeyb"] = "AwakeKeyb"; + AuraDevRog2["SleepLogo"] = "SleepLogo"; + AuraDevRog2["SleepKeyb"] = "SleepKeyb"; + AuraDevRog2["ShutdownLogo"] = "ShutdownLogo"; + AuraDevRog2["ShutdownKeyb"] = "ShutdownKeyb"; + AuraDevRog2["BootBar"] = "BootBar"; + AuraDevRog2["AwakeBar"] = "AwakeBar"; + AuraDevRog2["SleepBar"] = "SleepBar"; + AuraDevRog2["ShutdownBar"] = "ShutdownBar"; + AuraDevRog2["BootLid"] = "BootLid"; + AuraDevRog2["AwakeLid"] = "AwakeLid"; + AuraDevRog2["SleepLid"] = "SleepLid"; + AuraDevRog2["ShutdownLid"] = "ShutdownLid"; + AuraDevRog2["BootRearGlow"] = "BootRearGlow"; + AuraDevRog2["AwakeRearGlow"] = "AwakeRearGlow"; + AuraDevRog2["SleepRearGlow"] = "SleepRearGlow"; + AuraDevRog2["ShutdownRearGlow"] = "ShutdownRearGlow"; +})(AuraDevRog2 || (AuraDevRog2 = {})); +export var LedBrightness; +(function (LedBrightness) { + LedBrightness["Off"] = "Off"; + LedBrightness["Low"] = "Low"; + LedBrightness["Med"] = "Med"; + LedBrightness["High"] = "High"; +})(LedBrightness || (LedBrightness = {})); +export var AuraDevice; +(function (AuraDevice) { + AuraDevice["Tuf"] = "Tuf"; + AuraDevice["X1854"] = "X1854"; + AuraDevice["X1869"] = "X1869"; + AuraDevice["X1866"] = "X1866"; + AuraDevice["X18c6"] = "X18c6"; + AuraDevice["X19b6"] = "X19b6"; + AuraDevice["X1a30"] = "X1a30"; + AuraDevice["Unknown"] = "Unknown"; +})(AuraDevice || (AuraDevice = {})); +//# sourceMappingURL=aura.js.map \ No newline at end of file diff --git a/bindings/ts/platform.js b/bindings/ts/platform.js new file mode 100644 index 00000000..58307d90 --- /dev/null +++ b/bindings/ts/platform.js @@ -0,0 +1,18 @@ +export var AdvancedAura; +(function (AdvancedAura) { + AdvancedAura["None"] = "None"; + AdvancedAura["Zoned"] = "Zoned"; + AdvancedAura["PerKey"] = "PerKey"; +})(AdvancedAura || (AdvancedAura = {})); +export var GpuMode; +(function (GpuMode) { + GpuMode["Discrete"] = "Discrete"; + GpuMode["Optimus"] = "Optimus"; + GpuMode["Integrated"] = "Integrated"; + GpuMode["Egpu"] = "Egpu"; + GpuMode["Vfio"] = "Vfio"; + GpuMode["Ultimate"] = "Ultimate"; + GpuMode["Error"] = "Error"; + GpuMode["NotSupported"] = "NotSupported"; +})(GpuMode || (GpuMode = {})); +//# sourceMappingURL=platform.js.map \ No newline at end of file diff --git a/bindings/ts/platform.ts b/bindings/ts/platform.ts index ed0ee5f2..648ad76d 100644 --- a/bindings/ts/platform.ts +++ b/bindings/ts/platform.ts @@ -2,6 +2,8 @@ Generated by typeshare 1.6.0 */ +import { AuraDevice, AuraModeNum, AuraZone } from "./aura"; + export type AnimeSupportedFunctions = boolean; export interface ChargeSupportedFunctions { diff --git a/data/icons/scalable/anime.svg b/data/icons/scalable/anime.svg new file mode 100644 index 00000000..369d0e16 --- /dev/null +++ b/data/icons/scalable/anime.svg @@ -0,0 +1 @@ + diff --git a/data/icons/scalable/reboot.svg b/data/icons/scalable/reboot.svg new file mode 100644 index 00000000..44667e1e --- /dev/null +++ b/data/icons/scalable/reboot.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data/icons/scalable/rog-logo.svg b/data/icons/scalable/rog-logo.svg new file mode 100644 index 00000000..2004d0b4 --- /dev/null +++ b/data/icons/scalable/rog-logo.svg @@ -0,0 +1 @@ + diff --git a/desktop-extensions/gnome/LICENSE b/desktop-extensions/gnome/LICENSE new file mode 100644 index 00000000..fa0086a9 --- /dev/null +++ b/desktop-extensions/gnome/LICENSE @@ -0,0 +1,373 @@ +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/README.md b/desktop-extensions/gnome/README.md new file mode 100644 index 00000000..6d8687ca --- /dev/null +++ b/desktop-extensions/gnome/README.md @@ -0,0 +1,118 @@ +# asusctl ([-gex]: Gnome extension) -inactive(until v5.0.0)- + +## inactive (kind of - update) + +~~This project is currently inactive until a new maintainer wants to put some love into it and make it compatible with the newest asusctl versions.~~ + +ROG Control Center will also have it's own appindicator. + +This extension is currently marked as inactive also on extensions.gnome.org and for users not visible anymore. + +*UPDATE:* + +The origin maintainer (ZaPpPeL) is back from his rabbit-hole! (I'll take care of getting this into a working-state again within the next weeks - stay tuned!) + +--- + +Extension for visualizing [asusctl](https://gitlab.com/asus-linux/asusctl)(`asusd`) settings and status. + +*hint:* supergfxctl GPU mode switching moved to another extension to make it platform independent: [supergfxctl-gex](https://gitlab.com/asus-linux/supergfxctl-gex)(`supergfxctl-gex`) + +--- + +## Table of contents + +[[_TOC_]] + +--- + +## Extension Features + +* Notifications: + * Battery Charge Limit +* Popup Menu with options to: + * if supported by laptop model: + * change the battery charging limit + * change AniMe Matrix brightness + * enable / disable AniMe Matrix +* Extension Settings: + * Enable / disable notifications + * Enable debug message logging + +### Waiting for implementation: + +* Configuration interface (prefs) + * bind ROG-Button to open prefs (if not `rog-control-center` is used) + * create canvas based fan-curve editing + +--- + +## Icons/Screenshots + +_The screenshots below are just examples and might not represent the current used icons._ + +### Screenshot + +![screenshot.png](https://gitlab.com/asus-linux/asusctl-gex/-/raw/main/screenshots/screenshot.png) + +**battery charge limit notification:** + +![notification.png](https://gitlab.com/asus-linux/asusctl-gex/-/raw/main/screenshots/notification.png) + +--- + +## Requirements + +* gnome >= 3.36.0 +* [asusctl](https://gitlab.com/asus-linux/asusctl) >= 4.0 + +--- + +## Build Instructions + +### Dependencies + +* nodejs >= 14.0.0 +* npm >= 6.14.0 + +### Building (production) + +In a terminal enter the following commands as a user (**do NOT run as root or sudo**): + +```bash +git clone https://gitlab.com/asus-linux/asusctl-gex.git /tmp/asusctl-gex && cd /tmp/asusctl-gex +npm install +npm run build && npm run install-user +``` + +_HINT: You will need to reload the GNOME Shell afterwards. (`Alt + F2` -> `r` on X11, `logout` on Wayland)_ + +### Building (development) + +Instead of the +`npm run build && npm run install-user` +above, use this line instead: +`npm run build && npm run install-dev` + +This will remove any production versions and installs the development version instead. + +_HINT: You will need to reload the GNOME Shell afterwards. (`Alt + F2` -> `r` on X11, `logout` on Wayland)_ and probably manually enable the extension again. + +### Source debugging + +`cd` into the directory where you've downloaded the `asusctl-gex` source code and enter the following commands: + +```bash +npm install +npm run debug +``` + +--- + +## License & Trademarks + +**License:** Mozilla Public License Version 2.0 (MPL-2) + +**Trademarks:** ASUS and ROG Trademark is either a US registered trademark or trademark of ASUSTeK Computer Inc. in the United States and/or other countries. +Reference to any ASUS products, services, processes, or other information and/or use of ASUS Trademarks does not constitute or imply endorsement, sponsorship, or recommendation thereof by ASUS. +The use of ROG and ASUS trademarks within this website and associated tools and libraries is only to provide a recognisable identifier to users to enable them to associate that these tools will work with ASUS ROG laptops. diff --git a/desktop-extensions/gnome/metadata.json b/desktop-extensions/gnome/metadata.json new file mode 100644 index 00000000..c6635294 --- /dev/null +++ b/desktop-extensions/gnome/metadata.json @@ -0,0 +1,11 @@ +{ + "name": "asusctl-gex", + "description": "asusctl-gex is a frontend for some functionalities of asusctl and supergfxctl that were born inside the asus-linux.org community.\n\nasusctl is required.\n\nTo learn more about it, please have a look at:\nhttps://gitlab.com/asus-linux/asusctl\nhttps://gitlab.com/asus-linux/asusctl-gex\n\nhttps://asus-linux.org/", + "uuid": "asusctl-gex@asus-linux.org", + "uuid-dev": "asusctl-gex-dev@asus-linux.org", + "settings-schema": "org.gnome.shell.extensions.asusctl-gex", + "version": "4.3.2", + "shell-version": [ + "43", "44" + ] +} diff --git a/desktop-extensions/gnome/package-lock.json b/desktop-extensions/gnome/package-lock.json new file mode 100644 index 00000000..03ecca26 --- /dev/null +++ b/desktop-extensions/gnome/package-lock.json @@ -0,0 +1,1094 @@ +{ + "name": "asusctl-gex", + "version": "4.7.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "asusctl-gex", + "version": "4.7.0", + "license": "MPL-2", + "dependencies": { + "npm-run-all": "^4.1.5", + "typescript": "^4.3.5" + }, + "devDependencies": {} + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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==" + }, + "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==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/define-properties": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "dependencies": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.21.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz", + "integrity": "sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==", + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.2.0", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.7", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + }, + "node_modules/internal-slot": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "dependencies": { + "get-intrinsic": "^1.2.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", + "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" + }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/minimatch": { + "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" + }, + "engines": { + "node": "*" + } + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "dependencies": { + "is-core-module": "^2.11.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.13", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", + "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==" + }, + "node_modules/string.prototype.padend": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.4.tgz", + "integrity": "sha512-67otBXoksdjsnXXRUq+KMVTdlVRZ2af422Y0aTyTjVaoQkGr3mxl2Bc5emi7dOQ3OGVVQQskmLEWwFXwommpNw==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", + "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + } + } +} diff --git a/desktop-extensions/gnome/package.json b/desktop-extensions/gnome/package.json new file mode 100644 index 00000000..ad433476 --- /dev/null +++ b/desktop-extensions/gnome/package.json @@ -0,0 +1,46 @@ +{ + "name": "asusctl-gex", + "version": "4.7.0", + "description": "asusctl-gex is a frontend for some functionalities of asusctl and supergfxctl that were born inside the asus-linux.org community.\n\nasusctl is required.\n\nTo learn more about it, please have a look at:\nhttps://gitlab.com/asus-linux/asusctl\nhttps://gitlab.com/asus-linux/asusctl-gex\n\nhttps://asus-linux.org/", + "dependencies": { + "npm-run-all": "^4.1.5", + "typescript": "^4.3.5" + }, + "devDependencies": {}, + "scripts": { + "build:clean": "rm -rf _build _target schemas/gschemas.compiled target", + "build:compile": "scripts/compile", + "build:convert": "scripts/convert", + "build:schemas": "glib-compile-schemas schemas", + "build:transpile": "npx tsc", + "build": "run-p build:clean && run-p build:transpile && run-p build:schemas && run-p build:convert && run-p build:compile", + "debug:nested_shell": "run-p build && run-p install-dev && scripts/nested_shell", + "debug": "run-p debug:nested_shell", + "disable": "gnome-extensions disable \"asusctl-gex@asus-linux.org\"", + "enable": "gnome-extensions enable \"asusctl-gex@asus-linux.org\"", + "install-user": "scripts/install", + "install-dev": "scripts/install dev", + "uninstall-local": "scripts/uninstall", + "zip": "scripts/zipit" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@gitlab.com/asus-linux/asusctl-gex.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/schemas/org.gnome.shell.extensions.asusctl-gex.gschema.xml b/desktop-extensions/gnome/schemas/org.gnome.shell.extensions.asusctl-gex.gschema.xml new file mode 100644 index 00000000..db34beb6 --- /dev/null +++ b/desktop-extensions/gnome/schemas/org.gnome.shell.extensions.asusctl-gex.gschema.xml @@ -0,0 +1,19 @@ + + + + + true + enable / disable notifications + If enabled, notifications will show up on in various scenarios (when the GPU mode, power profile or charging limit is changed. Those notifications are not only triggered by the extension itself but react on DBUS signals from asusd, supergfxd and power-profiles-daemon. + + + false + enable / disable debug messages + If enabled, various events of the extension will get logged and are available via journalctl. + + + false + hide the supergfxctl-gex notice + + + \ No newline at end of file diff --git a/desktop-extensions/gnome/scripts/compile b/desktop-extensions/gnome/scripts/compile new file mode 100755 index 00000000..a9817bec --- /dev/null +++ b/desktop-extensions/gnome/scripts/compile @@ -0,0 +1,11 @@ +#!/bin/sh +rm -rf _build +mkdir -p _build/modules +mkdir -p _build/bindings +cp -r target/modules/*js _build/modules/ +cp -r target/bindings/*.js _build/bindings/ +cp -r metadata.json schemas target/*.js _build +# cp -r icons resources *.css _build +# cp src/prefs.ui _build/ + +exit 0; \ No newline at end of file diff --git a/desktop-extensions/gnome/scripts/convert b/desktop-extensions/gnome/scripts/convert new file mode 100755 index 00000000..1680383a --- /dev/null +++ b/desktop-extensions/gnome/scripts/convert @@ -0,0 +1,27 @@ +#!/bin/sh +find target/ -type f -print0 | while IFS= read -r -d $'\0' file; do \ + sed -i \ + -e 's#export function#function#g' \ + -e 's#export var#var#g' \ + -e 's#export const#var#g' \ + -e 's#Object.defineProperty(exports, "__esModule", { value: true });#var exports = {};#g' \ + $file; \ + + sed -i -E 's|export class (\w+)|var \1 = class \1|g' $file; \ + + sed -i -E "s|import \* as (\w+) from '..\/(\w+)\/(\w+)'|const \1 = Me.imports.\2.\3|g" $file; \ + # root + sed -i -E "s|import \* as (\w+) from '..\/(\w+)'|const \1 = Me.imports.\2|g" $file; \ + # nested by one dir + sed -i -E "s|import \* as (\w+) from '.\/(\w+)\/(\w+)'|const \1 = Me.imports.\2.\3|g" $file; \ + # root + sed -i -E "s|import \* as (\w+) from '.\/(\w+)'|const \1 = Me.imports.\2|g" $file; \ + + sed -i -E "s|from '.\/modules\/(\w+)'|= Me.imports.modules.\1|g" $file; \ + + sed -i -E "s|from '.\/(\w+)'|= Me.imports.\1|g" $file; \ + + sed -i -E "s|import \{|var \{|g" $file; \ +done + +exit 0; \ No newline at end of file diff --git a/desktop-extensions/gnome/scripts/install b/desktop-extensions/gnome/scripts/install new file mode 100755 index 00000000..98b82d17 --- /dev/null +++ b/desktop-extensions/gnome/scripts/install @@ -0,0 +1,45 @@ +#!/bin/sh +isdev=false +for arg in "$@"; do + if [ "$arg" = "dev" ]; then + isdev=true + fi; +done + +INSTALLBASE=~/.local/share/gnome-shell/extensions +UUID=`grep -E '^[ ]*"uuid":' _build/metadata.json | sed 's@^[ ]*"uuid":[ ]*"\(.\+\)",[ ]*@\1@'` +UUIDDEV=`grep -E '^[ ]*"uuid-dev":' _build/metadata.json | sed 's@^[ ]*"uuid-dev":[ ]*"\(.\+\)",[ ]*@\1@'` +GV=`gnome-shell --version | awk '{print $3}'` + +if $isdev +then + sed -i "s/${UUID}/${UUIDDEV}/g" _build/metadata.json + rm -fr "${INSTALLBASE}/${UUID}" + UUID=$UUIDDEV +else + rm -fr "${INSTALLBASE}/${UUIDDEV}" +fi + +if [ -d "${INSTALLBASE}/${UUID}" ]; then + rm -rf "${INSTALLBASE}/${UUID}/*" +else + mkdir -p "${INSTALLBASE}/${UUID}" +fi + +cp -r _build/* "${INSTALLBASE}/${UUID}/" + +gnome-extensions info "${UUID}" +INSTALLED="$?" + +if [ "$INSTALLED" -eq 0 ]; then + echo "reset" + gnome-extensions reset "${UUID}" + echo "enable" + gnome-extensions enable "${UUID}" + + echo "Please restart GNOME Shell if you are on X11 or logout and login again when you use Wayland." +else + echo "You probably install the extension for the first time. Please restart GNOME Shell or Logout and enable the extension via the Extensions app or extensions.gnome.org." +fi + +exit 0; diff --git a/desktop-extensions/gnome/scripts/nested_shell b/desktop-extensions/gnome/scripts/nested_shell new file mode 100755 index 00000000..21db5a08 --- /dev/null +++ b/desktop-extensions/gnome/scripts/nested_shell @@ -0,0 +1,3 @@ +#!/bin/bash +MUTTER_DEBUG_DUMMY_MODE_SPECS=1366x768 dbus-run-session -- gnome-shell --nested --wayland +exit 0 diff --git a/desktop-extensions/gnome/scripts/uninstall b/desktop-extensions/gnome/scripts/uninstall new file mode 100755 index 00000000..46411f53 --- /dev/null +++ b/desktop-extensions/gnome/scripts/uninstall @@ -0,0 +1,8 @@ +#!/bin/sh +UUID=`grep -E '^[ ]*"uuid":' metadata.json | sed 's@^[ ]*"uuid":[ ]*"\(.\+\)",[ ]*@\1@'` +INSTALLBASE=~/.local/share/gnome-shell/extensions + +gnome-extensions disable "$UUID" +rm -rf "$INSTALLBASE/$UUID" + +exit 0; diff --git a/desktop-extensions/gnome/scripts/zipit b/desktop-extensions/gnome/scripts/zipit new file mode 100755 index 00000000..aa9c8682 --- /dev/null +++ b/desktop-extensions/gnome/scripts/zipit @@ -0,0 +1,7 @@ +#!/bin/sh +UUID=`grep -E '^[ ]*"uuid":' metadata.json | sed 's@^[ ]*"uuid":[ ]*"\(.\+\)",[ ]*@\1@'` +VSTRING=`grep -E '^[ ]*"version":' metadata.json | sed 's@^[ ]*"version":[ ]*"\(.\+\)",[ ]*@\1@'` +rm *.zip +cd _build && zip -qr "../$UUID.zip" . + +exit 0; \ No newline at end of file diff --git a/desktop-extensions/gnome/src/bindings b/desktop-extensions/gnome/src/bindings new file mode 120000 index 00000000..ae0c7dbf --- /dev/null +++ b/desktop-extensions/gnome/src/bindings @@ -0,0 +1 @@ +../../../bindings/ts \ No newline at end of file diff --git a/desktop-extensions/gnome/src/extension.ts b/desktop-extensions/gnome/src/extension.ts new file mode 100644 index 00000000..ffa26960 --- /dev/null +++ b/desktop-extensions/gnome/src/extension.ts @@ -0,0 +1,158 @@ +declare const global: any, imports: any; +//@ts-ignore +const Me = imports.misc.extensionUtils.getCurrentExtension(); + +// const { GpuMode } = imports.bindings.platform; +// REF: https://gjs.guide/extensions/development/creating.html + +const { GObject, Gio } = imports.gi; +const ExtensionUtils = imports.misc.extensionUtils; + +const QuickSettings = imports.ui.quickSettings; +// This is the live instance of the Quick Settings menu +const QuickSettingsMenu = imports.ui.main.panel.statusArea.quickSettings; +//@ts-ignore +const ThisModule = imports.misc.extensionUtils.getCurrentExtension(); + +// const systemConnection = Gio.DBus.system; +// const TestProxy = Gio.DBusProxy.makeProxyWrapper(interfaceXml); + +import * as Platform from './bindings/platform'; + +const QuickMiniLed = GObject.registerClass( + class QuickMiniLed extends QuickSettings.QuickToggle { + _init() { + super._init({ + title: 'MiniLED', + iconName: 'selection-mode-symbolic', + toggleMode: true, + }); + + this.label = 'MiniLED'; + + // Binding the toggle to a GSettings key + this._settings = ExtensionUtils.getSettings(); + + this._settings.bind('mini-led-enabled', + this, 'checked', + Gio.SettingsBindFlags.DEFAULT); + } + }); + +const IndicateMiniLed = GObject.registerClass( + class IndicateMiniLed extends QuickSettings.SystemIndicator { + _init() { + super._init(); + + // 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); + + // Create the toggle and associate it with the indicator, being sure to + // destroy it along with the indicator + this.quickSettingsItems.push(new QuickMiniLed()); + + this.connect('destroy', () => { + this.quickSettingsItems.forEach((item: { destroy: () => any; }) => item.destroy()); + }); + + // Add the indicator to the panel and the toggle to the menu + QuickSettingsMenu._indicators.add_child(this); + QuickSettingsMenu._addItems(this.quickSettingsItems); + } + }); + + +const QuickPanelOd = GObject.registerClass( + class QuickPanelOd extends QuickSettings.QuickToggle { + _init() { + super._init({ + title: 'Panel Overdrive', + iconName: 'selection-mode-symbolic', + toggleMode: true, + }); + this.label = 'Panel Overdrive'; + this._settings = ExtensionUtils.getSettings(); + this._settings.bind('panel-od-enabled', + this, 'checked', + Gio.SettingsBindFlags.DEFAULT); + } + }); + +const IndicatePanelOd = GObject.registerClass( + class IndicatePanelOd extends QuickSettings.SystemIndicator { + _init() { + super._init(); + this._indicator = this._addIndicator(); + this._indicator.icon_name = 'selection-mode-symbolic'; + this._settings = ExtensionUtils.getSettings(); + this._settings.bind('panel-od-enabled', + this._indicator, 'visible', + Gio.SettingsBindFlags.DEFAULT); + this.quickSettingsItems.push(new QuickPanelOd()); + this.connect('destroy', () => { + this.quickSettingsItems.forEach((item: { destroy: () => any; }) => item.destroy()); + }); + QuickSettingsMenu._indicators.add_child(this); + QuickSettingsMenu._addItems(this.quickSettingsItems); + } + }); + + +function onNameAppeared(_connection: any, name: any, name_owner: any) { + //@ts-ignore + log(`The well-known name ${name} has been owned by ${name_owner}`); +} + +// Likewise, this will be invoked when the process that owned the name releases +// the name. +function onNameVanished(_connection: any, name: any) { + //@ts-ignore + log(`The name owner of ${name} has vanished`); +} + +const busWatchId = Gio.bus_watch_name( + Gio.BusType.SESSION, + 'guide.gjs.Test', + Gio.BusNameWatcherFlags.NONE, + onNameAppeared, + onNameVanished +); + +Gio.bus_unwatch_name(busWatchId); + +class Extension { + //@ts-ignore + private _naff: Platform.GpuMode; + private _indicateMiniLed: typeof IndicateMiniLed; + private _indicatePanelOd: typeof IndicatePanelOd; + constructor() { + this._indicateMiniLed = null; + this._indicatePanelOd = null; + this._naff = Platform.GpuMode.Discrete; + } + + enable() { + this._indicateMiniLed = new IndicateMiniLed(); + this._indicatePanelOd = new IndicatePanelOd(); + } + + disable() { + this._indicateMiniLed.destroy(); + this._indicateMiniLed = null; + this._indicatePanelOd.destroy(); + this._indicatePanelOd = null; + } +} + +//@ts-ignore +function init() { + return new Extension(); +} \ No newline at end of file diff --git a/desktop-extensions/gnome/src/modules/anime_dbus.ts b/desktop-extensions/gnome/src/modules/anime_dbus.ts new file mode 100644 index 00000000..113a4e7d --- /dev/null +++ b/desktop-extensions/gnome/src/modules/anime_dbus.ts @@ -0,0 +1,122 @@ +declare const global: any, imports: any; +declare var asusctlGexInstance: any; +//@ts-ignore +const ThisModule = imports.misc.extensionUtils.getCurrentExtension(); + +import * as Resources from './resources'; + +const {Gio} = imports.gi; + +export class AnimeDbus { + asusLinuxProxy: any = null; // type: Gio.DbusProxy (donno how to add) + connected: boolean = false; + state: boolean = true; + brightness: number = 255; + + constructor() { + // nothing for now + } + + // currently there is no DBUS method because this can't be read from + // hardware (as to @fluke). + // https://gitlab.com/asus-linux/asusctl/-/issues/138 + + // public getOnOffState() { + // if (this.isRunning()) { + // try { + // let currentState = this.asusLinuxProxy.AwakeEnabled; + + // return currentState; + // } catch (e) { + // log(`Failed to fetch AniMe!`, e); + // } + // } + + // return this.state; + // } + + public setOnOffState(state: boolean | null) { + if (this.isRunning()) { + try { + // if null, toggle the current state + state = (state == null ? !this.state : state); + + if (this.state !== state) { + this.state = state; + } + //@ts-ignore + log(`Setting AniMe Power to ${state}`); + return this.asusLinuxProxy.SetOnOffSync(state); + } catch (e) { + //@ts-ignore + log(`AniMe DBus set power failed!`, e); + } + } + } + + public setBrightness(brightness: number) { + if (this.isRunning()) { + try { + if (this.brightness !== brightness) { + this.brightness = brightness; + } + //@ts-ignore + log(`Setting AniMe Brightness to ${brightness}`); + return this.asusLinuxProxy.SetBrightnessSync(brightness); + // Panel.Actions.spawnCommandLine(`asusctl anime leds -b ${brightness}`); + } catch (e) { + //@ts-ignore + log(`AniMe DBus set brightness failed!`, e); + } + } + } + + isRunning(): boolean { + return this.connected; + } + + async start() { + //@ts-ignore + log(`Starting AniMe DBus client...`); + + try { + // creating the proxy + let xml = Resources.File.DBus('org-asuslinux-anime-4') + this.asusLinuxProxy = new Gio.DBusProxy.makeProxyWrapper(xml)( + Gio.DBus.system, + 'org.asuslinux.Daemon', + '/org/asuslinux/Anime' + ); + + this.connected = true; + + // currently there is no DBUS method because this can't be read from + // hardware (as to @fluke). + // https://gitlab.com/asus-linux/asusctl/-/issues/138 + /* + this.asusLinuxProxy.connectSignal( + "NotifyCharge", + (proxy: any = null, name: string, data: string) => { + if (proxy) { + Log.info(`AniMe Power State has changed to ${data}% (${name}).`); + } + } + ); + */ + } catch (e) { + //@ts-ignore + log(`AniMe DBus initialization failed!`, e); + } + } + + stop() { + //@ts-ignore + log(`Stopping AniMe DBus client...`); + + if (this.isRunning()) { + this.connected = false; + this.asusLinuxProxy = null; + this.state = true; + } + } +} \ No newline at end of file diff --git a/desktop-extensions/gnome/src/modules/charge_dbus.ts b/desktop-extensions/gnome/src/modules/charge_dbus.ts new file mode 100644 index 00000000..3b79fc5a --- /dev/null +++ b/desktop-extensions/gnome/src/modules/charge_dbus.ts @@ -0,0 +1,149 @@ +declare const global: any, imports: any; +declare var asusctlGexInstance: any; +//@ts-ignore +const Me = imports.misc.extensionUtils.getCurrentExtension(); + +import * as Resources from './resources'; + +const {Gio, GLib} = imports.gi; + +export class ChargingLimit { + asusLinuxProxy: any = null; // type: Gio.DbusProxy (donno how to add) + connected: boolean = false; + lastState: number = 100; + pollerDelayTicks: number = 0; + timeoutChargePoller: number | null = null; + + constructor() { + // nothing for now + } + + public getChargingLimit() { + if (this.isRunning()) { + try { + let currentState = this.asusLinuxProxy.LimitSync().toString().trim(); + + return currentState; + } catch (e) { + //@ts-ignore + log(`Failed to fetch Charging Limit!`, e); + } + } + + return this.lastState; + } + + public setChargingLimit(limit: number) { + if (this.isRunning()) { + try { + if (limit > 0 && this.lastState !== limit) { + // update state + this.lastState = limit; + } + return this.asusLinuxProxy.SetLimitSync(limit); + } catch (e) { + //@ts-ignore + log(`Profile DBus set power profile failed!`, e); + } + } + } + + updateChargingLimit(curState: number) { + // return false; + if (curState > 0 && this.lastState !== curState) { + // disable the signal handler so we don't run in an infinite loop + // of notifying, setting, notifying, setting... + asusctlGexInstance.chargingLimit.chargingLimitSlider.block_signal_handler(asusctlGexInstance.chargingLimit._sliderChangedId); + asusctlGexInstance.chargingLimit.chargingLimitSlider.value = curState/100; + asusctlGexInstance.chargingLimit.chargingLimitSlider.unblock_signal_handler(asusctlGexInstance.chargingLimit._sliderChangedId); + + asusctlGexInstance.chargingLimit.chargeLimitLabel.set_text(`${curState}%`); + + // update state + this.lastState = curState; + } + } + + pollerChargingLimit() { + if(this.isRunning() && this.pollerDelayTicks <= 0){ + try { + let currentLimit = this.getChargingLimit(); + if (currentLimit !== this.lastState){ + this.updateChargingLimit(currentLimit); + + // Panel.Actions.notify( + // 'ASUS Notebook Control', + // `Charging Limit changed to ${currentLimit}%`, + // 'scalable/battery-symbolic.svg' + // ); + } + } catch (e) { + //@ts-ignore + log(`Charging Limit poller init failed!`, e); + } finally { + return this.isRunning() ? GLib.SOURCE_CONTINUE : GLib.SOURCE_REMOVE; + } + } else if (this.isRunning() && this.pollerDelayTicks > 0) { + this.pollerDelayTicks--; + return GLib.SOURCE_CONTINUE; + } else { + return GLib.SOURCE_REMOVE; + } + } + + isRunning(): boolean { + return this.connected; + } + + async start() { + //@ts-ignore + log(`Starting Charging Limit DBus client...`); + + try { + // creating the proxy + let xml = Resources.File.DBus('org-asuslinux-charge-4') + this.asusLinuxProxy = new Gio.DBusProxy.makeProxyWrapper(xml)( + Gio.DBus.system, + 'org.asuslinux.Daemon', + '/org/asuslinux/Charge' + ); + + this.connected = true; + this.lastState = this.getChargingLimit(); + + this.asusLinuxProxy.connectSignal( + "NotifyCharge", + (proxy: any = null, name: string, data: string) => { + if (proxy) { + //@ts-ignore + log(`Charging Limit has changed to ${data}% (${name}).`); + this.updateChargingLimit(parseInt(data)); + } + } + ); + + try { + this.timeoutChargePoller = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 5, this.pollerChargingLimit.bind(this)); + } catch (e) { + //@ts-ignore + log(`Charging Limit DBus Poller initialization failed!`, e); + } + } catch (e) { + //@ts-ignore + log(`Charging Limit DBus initialization failed!`, e); + } + } + + stop() { + //@ts-ignore + log(`Stopping Charging Limit DBus client...`); + + if (this.isRunning()) { + this.connected = false; + this.asusLinuxProxy = null; + this.lastState = 100; + GLib.Source.remove(this.timeoutChargePoller); + this.timeoutChargePoller = null; + } + } +} \ No newline at end of file diff --git a/desktop-extensions/gnome/src/modules/platform_dbus.ts b/desktop-extensions/gnome/src/modules/platform_dbus.ts new file mode 100644 index 00000000..05184b5d --- /dev/null +++ b/desktop-extensions/gnome/src/modules/platform_dbus.ts @@ -0,0 +1,194 @@ +declare const global: any, imports: any; +declare var asusctlGexInstance: any; +//@ts-ignore +const Me = imports.misc.extensionUtils.getCurrentExtension(); + +import * as Resources from './resources'; + +const { Gio } = imports.gi; + +export class Platform { + asusLinuxProxy: any = null; // type: Gio.DbusProxy + connected: boolean = false; + lastStatePostBootSound: boolean = false; + lastStateOverdrive: boolean = false; + lastStateMUX: boolean = false; + + constructor() { + // nothing for now + } + + public getPostBootSound() { + if (this.isRunning()) { + try { + let currentState = this.asusLinuxProxy.PostBootSoundSync(); + + return parseInt(currentState) == 1 ? true : false; + } catch (e) { + //@ts-ignore + log(`Failed to get POST Boot Sound state!`, e); + } + } + + return this.lastStatePostBootSound; + } + + public setPostBootSound(state: boolean) { + if (this.isRunning()) { + try { + if (state !== this.lastStatePostBootSound) { + this.lastStatePostBootSound = state; + } + + return this.asusLinuxProxy.SetPostBootSoundSync(state); + } catch (e) { + //@ts-ignore + log(`Platform DBus set Post Boot Sound failed!`, e); + } + } + } + + public getMUX() { + if (this.isRunning()) { + try { + let currentState = this.asusLinuxProxy.GpuMuxModeSync(); + + return parseInt(currentState) == 0 ? true : false; + } catch (e) { + //@ts-ignore + log(`Failed to get MUX state!`, e); + } + } + + return this.lastStatePostBootSound; + } + + public setMUX(state: boolean) { + if (this.isRunning()) { + try { + if (!state !== this.lastStateMUX) { + this.lastStateMUX = !state; + } + + return this.asusLinuxProxy.SetGpuMuxModeSync(!state); + } catch (e) { + //@ts-ignore + log(`Switching the MUX failed!`, e); + } + } + } + + public getOverdrive() { + if (this.isRunning()) { + try { + let currentState = this.asusLinuxProxy.PanelOverdriveSync(); + + return parseInt(currentState) == 1 ? true : false; + } catch (e) { + //@ts-ignore + log(`Failed to get Overdrive state!`, e); + } + } + + return this.lastStateOverdrive; + } + + public setOverdrive(state: boolean) { + if (this.isRunning()) { + try { + if (state !== this.lastStateOverdrive) { + this.lastStateOverdrive = state; + } + + return this.asusLinuxProxy.SetPanelOverdriveSync(state); + } catch (e) { + //@ts-ignore + log(`Overdrive DBus set overdrive state failed!`, e); + } + } + } + + isRunning(): boolean { + return this.connected; + } + + async start() { + //@ts-ignore + log(`Starting Platform DBus module...`); + + try { + let xml = Resources.File.DBus('org-asuslinus-platform-4') + this.asusLinuxProxy = new Gio.DBusProxy.makeProxyWrapper(xml)( + Gio.DBus.system, + 'org.asuslinux.Daemon', + '/org/asuslinux/Platform' + ); + + this.connected = true; + + if (asusctlGexInstance.supported.connector.supportedAttributes.bios_toggleSound) { + this.lastStatePostBootSound = this.getPostBootSound(); + this.asusLinuxProxy.connectSignal( + "NotifyPostBootSound", + (proxy: any = null, _name: string, data: boolean) => { + if (proxy) { + //@ts-ignore + log(`PostBootSound changed to ${data}`); + asusctlGexInstance.Platform.switchPostBootSound.setToggleState(this.lastStatePostBootSound); + } + } + ); + } + + if (asusctlGexInstance.supported.connector.supportedAttributes.bios_overdrive) { + this.lastStateOverdrive = this.getOverdrive(); + this.asusLinuxProxy.connectSignal( + "NotifyPanelOverdrive", + (proxy: any = null, _name: string, data: boolean) => { + if (proxy) { + //@ts-ignore + log(`Overdrive has changed to ${data}.`); + asusctlGexInstance.Platform.overdriveSwitch.setToggleState(this.lastStateOverdrive); + } + } + ); + } + + if (asusctlGexInstance.supported.connector.supportedAttributes.bios_toggleMUX) { + this.lastStateMUX = this.getMUX(); + this.asusLinuxProxy.connectSignal( + "NotifyGpuMuxMode", + (proxy: any = null, _name: string, data: boolean) => { + if (proxy) { + //@ts-ignore + log(`MUX has changed to ${data}.`); + asusctlGexInstance.Platform.switchMUX.setToggleState(this.lastStateMUX); + + // Panel.Actions.notify( + // 'ASUS Notebook Control', + // `MUX Mode has chnged. Please reboot to apply the changes.`, + // 'scalable/reboot.svg', + // 'reboot' + // ); + } + } + ); + } + } catch (e) { + //@ts-ignore + log(`Overdrive DBus init failed!`, e); + } + } + + stop() { + //@ts-ignore + log(`Stopping Overdrive DBus module...`); + + if (this.isRunning()) { + this.connected = false; + this.asusLinuxProxy = null; + this.lastStatePostBootSound = false; + this.lastStateOverdrive = false; + } + } +} \ No newline at end of file diff --git a/desktop-extensions/gnome/src/modules/resources.ts b/desktop-extensions/gnome/src/modules/resources.ts new file mode 100644 index 00000000..33142c63 --- /dev/null +++ b/desktop-extensions/gnome/src/modules/resources.ts @@ -0,0 +1,21 @@ +declare const global: any, imports: any; +//@ts-ignore +const ThisModule = imports.misc.extensionUtils.getCurrentExtension(); + +const GLib = imports.gi.GLib; + +export class File { + public static DBus(name: string) { + let file = `${ThisModule.path}/resources/dbus/${name}.xml`; + try { + let [_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/src/modules/supported_dbus.ts b/desktop-extensions/gnome/src/modules/supported_dbus.ts new file mode 100644 index 00000000..765ad25d --- /dev/null +++ b/desktop-extensions/gnome/src/modules/supported_dbus.ts @@ -0,0 +1,163 @@ +declare const global: any, imports: any; +//@ts-ignore +const Me = imports.misc.extensionUtils.getCurrentExtension(); + +import * as Resources from './resources'; + +import * as Platform from '../bindings/platform'; +import * as Aura from '../bindings/aura'; + +const { Gio } = imports.gi; + +export class Supported { + supportedProxy: any = null; // type: Gio.DbusProxy (donno how to add) + connectedSupported: boolean = false; + + // False, + // (True,), + // (True, True), + // ('X19b6', + // True, + // ['Static', + // 'Breathe', + // 'Strobe', + // 'Rainbow', + // 'Star', + // 'Rain', + // 'Highlight', + // 'Laser', + // 'Ripple', + // 'Pulse', + // 'Comet', + // 'Flash'], + // [], + // 2), + // (False, True, True, True, False, True) + + supportedAttributes: Platform.SupportedFunctions = { + anime_ctrl: false, + charge_ctrl: { + charge_level_set: false + }, + platform_profile: { + platform_profile: false, + fan_curves: false + }, + keyboard_led: { + dev_id: Aura.AuraDevice.Unknown, + brightness: false, + basic_modes: [], + basic_zones: [], + advanced_type: Platform.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() { + // nothing for now + } + + public getSupported() { + if (this.isRunning()) { + try { + let _supportedAttributes = this.supportedProxy.SupportedFunctionsSync(); + if (_supportedAttributes.length > 0) { + let valueString: string = ''; + + for (const [_key, value] of Object.entries(_supportedAttributes)) { + //@ts-ignore + valueString = value.toString(); + + switch (parseInt(_key)) { + case 0: + this.supportedAttributes.anime_ctrl = (valueString == 'true' ? true : false); + break; + + case 1: + this.supportedAttributes.charge_ctrl.charge_level_set = (valueString == 'true' ? true : false); + break; + + case 2: + let platformArray = valueString.split(','); + this.supportedAttributes.platform_profile.fan_curves = (platformArray[0] == 'true' ? true : false); + this.supportedAttributes.platform_profile.platform_profile = (platformArray[1] == 'true' ? true : false); + break; + + case 3: + let ledArray = valueString.split(','); + // let t: keyof typeof AuraDevice = ledArray[0]; // can't conevert + this.supportedAttributes.keyboard_led.dev_id = Aura.AuraDevice[ledArray[0] as Aura.AuraDevice]; + this.supportedAttributes.keyboard_led.brightness = (ledArray[1] == 'true' ? true : false); + this.supportedAttributes.keyboard_led.basic_modes = ledArray[2].split(',').map(function (value) { + return Aura.AuraModeNum[value as Aura.AuraModeNum] + }); + this.supportedAttributes.keyboard_led.basic_zones = ledArray[3].split(',').map(function (value) { + return Aura.AuraZone[value as Aura.AuraZone] + }); + this.supportedAttributes.keyboard_led.advanced_type = Platform.AdvancedAura[ledArray[4] as Platform.AdvancedAura]; + break; + + case 4: + let biosArray = valueString.split(','); + this.supportedAttributes.rog_bios_ctrl.post_sound = (biosArray[0] == 'true' ? true : false); + this.supportedAttributes.rog_bios_ctrl.gpu_mux = (biosArray[1] == 'true' ? true : false); + this.supportedAttributes.rog_bios_ctrl.panel_overdrive = (biosArray[2] == 'true' ? true : false); + this.supportedAttributes.rog_bios_ctrl.dgpu_disable = (biosArray[3] == 'true' ? true : false); + this.supportedAttributes.rog_bios_ctrl.egpu_enable = (biosArray[4] == 'true' ? true : false); + this.supportedAttributes.rog_bios_ctrl.mini_led_mode = (biosArray[5] == 'true' ? true : false); + break; + + default: + break; + } + } + } + } catch (e) { + //@ts-ignore + log(`Failed to fetch supported functionalities`, e); + } + } + } + + isRunning(): boolean { + return this.connectedSupported; + } + + async start() { + try { + // creating the proxy + let xml = Resources.File.DBus('org-asuslinux-supported-4'); + this.supportedProxy = new Gio.DBusProxy.makeProxyWrapper(xml)( + Gio.DBus.system, + 'org.asuslinux.Daemon', + '/org/asuslinux/Supported' + ); + + this.connectedSupported = true; + + this.getSupported(); + //@ts-ignore + log(`Supported Daemon client started successfully.`); + } catch (e) { + //@ts-ignore + log(`Supported DBus initialization failed!`, e); + } + } + + stop() { + //@ts-ignore + log(`Stopping Supported DBus client...`); + + if (this.isRunning()) { + this.connectedSupported = false; + this.supportedProxy = null; + } + } +} \ No newline at end of file diff --git a/desktop-extensions/gnome/tsconfig.json b/desktop-extensions/gnome/tsconfig.json new file mode 100644 index 00000000..97023ada --- /dev/null +++ b/desktop-extensions/gnome/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "target": "es2019", + // "module": "ES2015", + // "moduleResolution": "node", + // "rootDir": "./", + "strict": true, + "outDir": "./target", + "forceConsistentCasingInFileNames": true, + "downlevelIteration": true, + "lib": [ "es2019" ], + "pretty": true, + "sourceMap": true, + "declaration": true, + "removeComments": true, + "incremental": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "allowJs": true + }, + "include": [ + "src/*.ts", + "src/**/*.ts" + ] +} diff --git a/rog-platform/src/supported.rs b/rog-platform/src/supported.rs index 25a0ad98..10a64427 100644 --- a/rog-platform/src/supported.rs +++ b/rog-platform/src/supported.rs @@ -35,6 +35,7 @@ pub struct PlatformProfileFunctions { #[typeshare] #[derive(Serialize, Deserialize, Default, Type, Debug, Clone)] +#[zvariant(signature = "s")] pub enum AdvancedAura { #[default] None,