# ROG-Core rog-core is a utility for Linux to control many aspects (eventually) of the ASUS ROG laptops like the Zephyrus GX502GW. One of the benefits of this app (for me at least) is that you *don't* require a kernel with correct support for the laptop keyboard EC. The app reads and writes direct to the device interrupts, and can be customised (in source) quite extensively to do what you want such as directly controlling your laptop backlight rather than emitting a key-press for the DE to handle. There is also the possibility of rebinding fn keys to be macros which emit a series of keyboard presses. Other laptop functions such as fan modes or battery charge limiting will need kernel level support. ## Discord [Discord server link](https://discord.gg/uKxdua) ## SUPPORTED LAPTOPS - GM501 (multizone needs testing, if you have this laptop please create an issue in the repo) - GX502 - GX531 - G712 - G531 - GA14/GA401 *is* supported, including the AniMe display. You will need kernel [patches](https://lab.retarded.farm/zappel/asus-rog-zephyrus-g14/-/tree/master/kernel_patches). - GA15/GA502 appears to have most things working **Please help test or provide info for:** - GL703(0x1869) - GL553(0x1854) GL753 (attempted support from researching 2nd-hand info, multizone may work) **Laptop support is added on a per-case basis** as the EC for the keyboard varies a little between models, e.g, some RGB modes are missing, or it's a single colour. As far as I can see, the EC does not give us a way to find what modes are supported. ## Implemented - [X] Setting/modifying built-in LED modes - [X] Per-key LED setting (PARTIALLY COMPLETE) - [X] Fancy LED modes (See examples) - [X] Daemon mode - [X] Saving settings for reload - [ ] System control + [ ] ROG key custom mapping (Can be done in source) + [X] Fan/Performance mode + [ ] Screen off? Now mapped to a keycode but has no effect + [X] Screen brightness up/down + [X] Touchpad toggle (using a virtual keyboard to emit F21...) + [X] Sleep + [X] Airplane mode - [X] Capture and use hotkeys + [X] Aura control by Aura keys + [X] Volume + media controls work + [ ] Mic mute - unsure which key should be emitted for this to work. The key by itself emits a code. - [X] Logging - required for journalctl - [X] AniMatrix display on G14 models that include it - [X] Set battery charge limit (with kernel supporting this) ## Requirements for compiling - `rustc` + `cargo` + `make` - `libusb-1.0-0-dev` - `libdbus-1-dev` - `llvm` - `libclang-dev` ## Installing Run `make` then `sudo make install`. If you want to use the daemon mode on system boot you'll need to enable and start the systemd service with: ``` $ sudo systemctl start rog-core.service $ sudo systemctl enable rog-core.service ``` If you are upgrading from a previous installed version, you will also need to reload service files. ``` $ sudo systemctl daemon-reload ``` You may also need to activate the service for debian install. If running Pop!_OS, I suggest disabling `system76-power` gnome-shell extension, or at least limiting use of the power-management parts as `rog-core` lets you set the same things (one or the other will overwrite pstates). I will create a shell extension at some point similar to system76, but using the rog-core parts. It is safe to leave `system76-power.service` enabled and use for switching between graphics modes. ### Ubuntu PPA Alternatively, instead of building manually you can use the PPA. ``` sudo add-apt-repository ppa:lukedjones/rog-core sudo apt-get update sudo apt-get install rog-core ``` enable and start the service: ``` sudo systemctl start rog-core.service sudo systemctl enable rog-core.service ``` ### Gentoo ebuild Thanks to @aspann you can grab it here [sys-power/rog-core](https://lab.retarded.farm/zappel/zGentoo/-/tree/master/sys-power/rog-core) ### Arch AUR You can find the thingimajig [here](https://aur.archlinux.org/packages/rog-core/) ## Updating Occasionally I might break things for you by tweaking or changing the config file layout. Usually this will mean you need to remove `/etc/rog-core.conf` and restart the daemon to create a new one. You *can* back up the old one and copy settings back over (then restart daemon again). # Usage **NOTE! Fan mode toggling requires a newer kernel**. I'm unsure when the patches required for it got merged - I've tested with the 5.6.6 kernel and above only. To see if the fan-mode changed cat either: - `cat /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy` or - `cat /sys/devices/platform/asus-nb-wmi/fan_boost_mode` The numbers are 0 = Normal/Balanced, 1 = Boost, 2 = Silent. Running the program as a daemon manually will require root. Standard (non-daemon) mode expects to be communicating with the daemon mode over dbus. Commands are given by: ``` rog-core