The laptop model's hardware module and a memory-pressure module for any machine (hq research 027/03, 026/05, to-be 42 phase 3). The predecessor's polling auto-profile and mem-guard user scripts become each module's own Go code launched by the node runtime (ADR 0198): a profile switcher woken by the kernel's power-supply uevents, and a guard that warns on RAM, swap or PSI before systemd-oomd acts, on the desktop over the account's bus and always as an event. supergfxctl and triggerhappy are kept as found (research 027 Q1).
255 lines
12 KiB
JSON
255 lines
12 KiB
JSON
{
|
|
"module": "asus-zephyrus-g14",
|
|
"version": "1",
|
|
"capabilities": [
|
|
"package-manager",
|
|
"service-manager"
|
|
],
|
|
"emits": [
|
|
"profile.switched"
|
|
],
|
|
"tools": [
|
|
"zephyrus_brightness",
|
|
"zephyrus_battery",
|
|
"zephyrus_charge_limit",
|
|
"zephyrus_gpu_mode",
|
|
"zephyrus_profile",
|
|
"zephyrus_thermals",
|
|
"zephyrus_power_draw",
|
|
"zephyrus_profile_policy",
|
|
"zephyrus_fan_curves",
|
|
"zephyrus_check"
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "asusctl",
|
|
"type": "package",
|
|
"package": "asusctl"
|
|
},
|
|
{
|
|
"id": "playerctl",
|
|
"type": "package",
|
|
"package": "playerctl"
|
|
},
|
|
{
|
|
"id": "xinput",
|
|
"type": "package",
|
|
"package": "xorg-xinput"
|
|
},
|
|
{
|
|
"id": "asusd",
|
|
"type": "service",
|
|
"unit": "asusd.service",
|
|
"state": "running"
|
|
},
|
|
{
|
|
"id": "supergfxd",
|
|
"type": "service",
|
|
"unit": "supergfxd.service",
|
|
"state": "running",
|
|
"boot": "enabled"
|
|
},
|
|
{
|
|
"id": "scripts",
|
|
"type": "archive",
|
|
"path": "/usr/local/lib/asus-zephyrus-g14",
|
|
"artifact": "scripts"
|
|
},
|
|
{
|
|
"id": "nvidia-options",
|
|
"type": "file",
|
|
"path": "/etc/modprobe.d/g14-nvidia-power.conf",
|
|
"mode": "0644",
|
|
"content": "# Managed by the mesh (module asus-zephyrus-g14). Replaced on every push; edit the catalogue instead.\n#\n# The discrete GPU's driver options on the ROG Zephyrus G14 (GA403, RTX 40 series, hybrid graphics).\n#\n# NVreg_DynamicPowerManagement=0x00 turns runtime D3 off. With it on, a change of power source sends\n# the driver an ACPI notification it fails to handle on this model (\"RmHandleDNotifierEvent: Failed to\n# handle ACPI D-Notifier event, status=0x62\"), and the GPU stops making progress until the machine is\n# powered off. Off costs a few idle watts in hybrid mode and keeps the machine up.\n#\n# NVreg_PreserveVideoMemoryAllocations=1 saves video memory across suspend, so what used the GPU still\n# works after waking. It needs nvidia-suspend, -hibernate and -resume to run around a sleep, which this\n# module's drop-ins on the sleep services ask for.\n#\n# A change here applies when the driver next loads: at the next boot.\noptions nvidia NVreg_PreserveVideoMemoryAllocations=1\noptions nvidia NVreg_DynamicPowerManagement=0x00\n"
|
|
},
|
|
{
|
|
"id": "video-options",
|
|
"type": "file",
|
|
"path": "/etc/modprobe.d/video-brightness-switch.conf",
|
|
"mode": "0644",
|
|
"content": "# Managed by the mesh (module asus-zephyrus-g14). Replaced on every push; edit the catalogue instead.\n#\n# The ACPI video driver does not change the backlight itself on the brightness keys: on this model it\n# moves the wrong one. The keys are triggerhappy's (see /etc/triggerhappy/triggers.d/asus-g14.conf).\n# Applies when the module next loads: at the next boot.\noptions video brightness_switch_enabled=0\n"
|
|
},
|
|
{
|
|
"id": "suspend-drop-ins",
|
|
"type": "directory",
|
|
"path": "/etc/systemd/system/systemd-suspend.service.d",
|
|
"mode": "0755"
|
|
},
|
|
{
|
|
"id": "nvidia-on-suspend",
|
|
"type": "file",
|
|
"path": "/etc/systemd/system/systemd-suspend.service.d/asus-zephyrus-g14-nvidia.conf",
|
|
"mode": "0644",
|
|
"content": "# Managed by the mesh (module asus-zephyrus-g14). Replaced on every push; edit the catalogue instead.\n#\n# The NVIDIA driver's own sleep actions, asked for by the sleep itself rather than enabled as\n# links: the mesh declares files and never makes links (novox/hq ADR 0012), and the host's service\n# shape must not start these units by hand, which would put the GPU to sleep with the machine awake.\n[Unit]\nWants=nvidia-suspend.service nvidia-resume.service\n"
|
|
},
|
|
{
|
|
"id": "hibernate-drop-ins",
|
|
"type": "directory",
|
|
"path": "/etc/systemd/system/systemd-hibernate.service.d",
|
|
"mode": "0755"
|
|
},
|
|
{
|
|
"id": "nvidia-on-hibernate",
|
|
"type": "file",
|
|
"path": "/etc/systemd/system/systemd-hibernate.service.d/asus-zephyrus-g14-nvidia.conf",
|
|
"mode": "0644",
|
|
"content": "# Managed by the mesh (module asus-zephyrus-g14). Replaced on every push; edit the catalogue instead.\n#\n# The NVIDIA driver's own sleep actions, asked for by the sleep itself rather than enabled as\n# links: the mesh declares files and never makes links (novox/hq ADR 0012), and the host's service\n# shape must not start these units by hand, which would put the GPU to sleep with the machine awake.\n[Unit]\nWants=nvidia-hibernate.service nvidia-resume.service\n"
|
|
},
|
|
{
|
|
"id": "suspend-then-hibernate-drop-ins",
|
|
"type": "directory",
|
|
"path": "/etc/systemd/system/systemd-suspend-then-hibernate.service.d",
|
|
"mode": "0755"
|
|
},
|
|
{
|
|
"id": "nvidia-on-suspend-then-hibernate",
|
|
"type": "file",
|
|
"path": "/etc/systemd/system/systemd-suspend-then-hibernate.service.d/asus-zephyrus-g14-nvidia.conf",
|
|
"mode": "0644",
|
|
"content": "# Managed by the mesh (module asus-zephyrus-g14). Replaced on every push; edit the catalogue instead.\n#\n# The NVIDIA driver's own sleep actions, asked for by the sleep itself rather than enabled as\n# links: the mesh declares files and never makes links (novox/hq ADR 0012), and the host's service\n# shape must not start these units by hand, which would put the GPU to sleep with the machine awake.\n[Unit]\nWants=nvidia-suspend-then-hibernate.service nvidia-resume.service\n"
|
|
},
|
|
{
|
|
"id": "powerd-drop-ins",
|
|
"type": "directory",
|
|
"path": "/etc/systemd/system/nvidia-powerd.service.d",
|
|
"mode": "0755"
|
|
},
|
|
{
|
|
"id": "powerd-opt-in",
|
|
"type": "file",
|
|
"path": "/etc/systemd/system/nvidia-powerd.service.d/asus-zephyrus-g14.conf",
|
|
"mode": "0644",
|
|
"content": "# Managed by the mesh (module asus-zephyrus-g14). Replaced on every push; edit the catalogue instead.\n#\n# nvidia-powerd (Dynamic Boost) was the first error in the chain that hung this model's GPU on a change\n# of power source, and asusd starts it on mains. It runs only when the kernel command line says\n# zephyrus.nvidia-powerd — an explicit opt-in, at boot.\n[Unit]\nConditionKernelCommandLine=zephyrus.nvidia-powerd\n"
|
|
},
|
|
{
|
|
"id": "logind-drop-ins",
|
|
"type": "directory",
|
|
"path": "/etc/systemd/logind.conf.d",
|
|
"mode": "0755"
|
|
},
|
|
{
|
|
"id": "logind-power",
|
|
"type": "file",
|
|
"path": "/etc/systemd/logind.conf.d/power.conf",
|
|
"mode": "0644",
|
|
"content": "# Managed by the mesh (module asus-zephyrus-g14). Replaced on every push; edit the catalogue instead.\n#\n# The power key and the lid suspend, on battery, on mains and docked alike.\n[Login]\nHandlePowerKey=suspend\nHandleLidSwitch=suspend\nHandleLidSwitchExternalPower=suspend\nHandleLidSwitchDocked=suspend\n"
|
|
},
|
|
{
|
|
"id": "logind",
|
|
"type": "service",
|
|
"unit": "systemd-logind.service",
|
|
"reload-on": [
|
|
"logind-power"
|
|
]
|
|
},
|
|
{
|
|
"id": "backlight-rule",
|
|
"type": "file",
|
|
"path": "/etc/udev/rules.d/90-backlight.rules",
|
|
"mode": "0644",
|
|
"content": "# Managed by the mesh (module asus-zephyrus-g14). Replaced on every push; edit the catalogue instead.\n#\n# The backlights are writable by the video group, so the brightness keys and the module's brightness tool\n# move the panel without root.\nACTION==\"add\", SUBSYSTEM==\"backlight\", RUN+=\"/usr/bin/chgrp video /sys/class/backlight/%k/brightness\", RUN+=\"/usr/bin/chmod g+w /sys/class/backlight/%k/brightness\"\n"
|
|
},
|
|
{
|
|
"id": "udev",
|
|
"type": "service",
|
|
"unit": "systemd-udevd.service",
|
|
"reload-on": [
|
|
"backlight-rule"
|
|
]
|
|
},
|
|
{
|
|
"id": "triggerhappy-drop-ins",
|
|
"type": "directory",
|
|
"path": "/etc/systemd/system/triggerhappy.service.d",
|
|
"mode": "0755"
|
|
},
|
|
{
|
|
"id": "triggerhappy-as-account",
|
|
"type": "file",
|
|
"path": "/etc/systemd/system/triggerhappy.service.d/asus-zephyrus-g14.conf",
|
|
"mode": "0644",
|
|
"content": "# Managed by the mesh (module asus-zephyrus-g14). Replaced on every push; edit the catalogue instead.\n#\n# triggerhappy runs the vendor-key triggers as the operator's account, not as root: it opens the input\n# devices first and then drops to the account with its groups (input, video), so the triggers reach the\n# account's own session bus and the panel through the video group, with no su and no hard-coded user.\n[Service]\nExecStart=\nExecStart=/usr/bin/thd --triggers /etc/triggerhappy/triggers.d/ --socket /run/thd.socket --user ${machine:account} --deviceglob /dev/input/event*\n"
|
|
},
|
|
{
|
|
"id": "vendor-keys",
|
|
"type": "file",
|
|
"path": "/etc/triggerhappy/triggers.d/asus-g14.conf",
|
|
"mode": "0644",
|
|
"content": "# Managed by the mesh (module asus-zephyrus-g14). Replaced on every push; edit the catalogue instead.\n#\n# The ROG Zephyrus G14's vendor keys, which reach no X client. Run as the operator's account (see the\n# module's drop-in on triggerhappy.service).\nKEY_PROG1\t1\t/usr/local/lib/asus-zephyrus-g14/bin/zephyrus-session playerctl play-pause\nKEY_PROG3\t1\t/usr/local/lib/asus-zephyrus-g14/bin/zephyrus-session playerctl previous\nKEY_PROG4\t1\t/usr/local/lib/asus-zephyrus-g14/bin/zephyrus-session playerctl next\nKEY_BRIGHTNESSDOWN\t1\t/usr/local/lib/asus-zephyrus-g14/bin/zephyrus-backlight -\nKEY_BRIGHTNESSDOWN\t2\t/usr/local/lib/asus-zephyrus-g14/bin/zephyrus-backlight -\nKEY_BRIGHTNESSUP\t1\t/usr/local/lib/asus-zephyrus-g14/bin/zephyrus-backlight +\nKEY_BRIGHTNESSUP\t2\t/usr/local/lib/asus-zephyrus-g14/bin/zephyrus-backlight +\nKEY_F21\t1\t/usr/local/lib/asus-zephyrus-g14/bin/zephyrus-touchpad reset\n"
|
|
},
|
|
{
|
|
"id": "triggerhappy",
|
|
"type": "service",
|
|
"unit": "triggerhappy.service",
|
|
"state": "running",
|
|
"boot": "enabled",
|
|
"restart-on": [
|
|
"triggerhappy-as-account",
|
|
"vendor-keys",
|
|
"scripts"
|
|
]
|
|
},
|
|
{
|
|
"id": "upower-package",
|
|
"type": "package",
|
|
"package": "upower"
|
|
},
|
|
{
|
|
"id": "upower-drop-ins",
|
|
"type": "directory",
|
|
"path": "/etc/UPower/UPower.conf.d",
|
|
"mode": "0755"
|
|
},
|
|
{
|
|
"id": "low-battery",
|
|
"type": "file",
|
|
"path": "/etc/UPower/UPower.conf.d/50-asus-zephyrus-g14.conf",
|
|
"mode": "0644",
|
|
"content": "# Managed by the mesh (module asus-zephyrus-g14). Replaced on every push; edit the catalogue instead.\n#\n# On low battery the machine suspends rather than powering off, at 7 % — s2idle still draws a little,\n# so it leaves headroom. A drop-in over the package's own UPower.conf, which stays the package's.\n[UPower]\nUsePercentageForPolicy=true\nPercentageLow=15.0\nPercentageCritical=10.0\nPercentageAction=7.0\nCriticalPowerAction=Suspend\nAllowRiskyCriticalPowerAction=true\n"
|
|
},
|
|
{
|
|
"id": "upower",
|
|
"type": "service",
|
|
"unit": "upower.service",
|
|
"state": "running",
|
|
"boot": "enabled",
|
|
"restart-on": [
|
|
"low-battery"
|
|
]
|
|
},
|
|
{
|
|
"id": "xorg-drop-ins",
|
|
"type": "directory",
|
|
"path": "/etc/X11/xorg.conf.d",
|
|
"mode": "0755"
|
|
},
|
|
{
|
|
"id": "touchpad",
|
|
"type": "file",
|
|
"path": "/etc/X11/xorg.conf.d/30-asus-zephyrus-g14-touchpad.conf",
|
|
"mode": "0644",
|
|
"content": "# Managed by the mesh (module asus-zephyrus-g14). Replaced on every push; edit the catalogue instead.\n#\n# The touchpad's settings, applied by X every time the device appears — at login and after every\n# resume, when the device is initialised again. This replaces the predecessor's sleep hook, which ran\n# xinput after a resume as a named person on a guessed display.\nSection \"InputClass\"\n Identifier \"asus-zephyrus-g14 touchpad\"\n MatchIsTouchpad \"on\"\n Option \"Tapping\" \"on\"\n Option \"NaturalScrolling\" \"true\"\n Option \"AccelSpeed\" \"0.15\"\nEndSection\n"
|
|
}
|
|
],
|
|
"build": {
|
|
"artifacts": [
|
|
{
|
|
"name": "tools-go",
|
|
"kind": "bundle",
|
|
"language": "go",
|
|
"system": "arch",
|
|
"from": "cmd/zephyrus",
|
|
"binary": "zephyrus",
|
|
"loads": [
|
|
"zephyrus"
|
|
]
|
|
},
|
|
{
|
|
"name": "scripts",
|
|
"kind": "archive",
|
|
"from": "files"
|
|
}
|
|
]
|
|
}
|
|
}
|