rofi, clipmenu, feh, i3status-rust and the laptop's model module wrote files into i3's config.d, naming no dependency on the window manager. They now contribute their lines; i3 places them under a line naming each module, and config.d is the operator's alone. The catalogue-wide test composes the contributions as the controller does and checks the whole with i3 -C.
225 lines
13 KiB
JSON
225 lines
13 KiB
JSON
{
|
|
"module": "asus-zephyrus-g14",
|
|
"version": "1",
|
|
"capabilities": [
|
|
"package-manager",
|
|
"service-manager"
|
|
],
|
|
"requires": [
|
|
"x11-display"
|
|
],
|
|
"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_keys",
|
|
"zephyrus_check"
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "asusctl",
|
|
"type": "package",
|
|
"package": "asusctl"
|
|
},
|
|
{
|
|
"id": "playerctl",
|
|
"type": "package",
|
|
"package": "playerctl"
|
|
},
|
|
{
|
|
"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": "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": "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"
|
|
}
|
|
]
|
|
},
|
|
"contributions": [
|
|
{
|
|
"seat": "node-hotkeys",
|
|
"kind": "trigger",
|
|
"content": "# The ROG Zephyrus G14's vendor keys, which reach no X client: media (the M-keys), panel brightness,\n# and the touchpad key. Each runs this module's own script, as the operator's account.\nKEY_PROG1\t1\t/usr/local/lib/asus-zephyrus-g14/bin/zephyrus-session /usr/local/lib/asus-zephyrus-g14/bin/zephyrus-media play-pause\nKEY_PROG3\t1\t/usr/local/lib/asus-zephyrus-g14/bin/zephyrus-session /usr/local/lib/asus-zephyrus-g14/bin/zephyrus-media previous\nKEY_PROG4\t1\t/usr/local/lib/asus-zephyrus-g14/bin/zephyrus-session /usr/local/lib/asus-zephyrus-g14/bin/zephyrus-media 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"
|
|
},
|
|
{
|
|
"seat": "node-display-session",
|
|
"kind": "config",
|
|
"content": "# The laptop's own lines in i3 (module asus-zephyrus-g14, novox/hq ADR 0208, ADR 0210). Owned by the\n# mesh: replaced at every push. Once the controller places contributions to node-display-session\n# (ADR 0210), these become the module's contribution instead of a file in i3's directory.\n#\n# The keys the firmware turns into ordinary key presses. The vendor keys that reach no X client are\n# triggerhappy's (/etc/triggerhappy/triggers.d/asus-g14.conf): M4 and Fn+F4/F5 for media, Fn+F7/F8 for\n# the panel, Fn+F10 for the touchpad. The keyboard backlight (Fn+F2/F3) is the firmware's and asusd's.\n\n# Fn+F6, the screenshot key: the firmware sends Super+Shift+S. Released before it runs, because the\n# screenshot grabs the pointer to select a region, which fails while the key is still held.\nbindsym --release $mod+Shift+s exec --no-startup-id $XDG_CONFIG_HOME/i3/scripts/screenshot.sh\n\n# Fn+F9, the display key: the firmware sends Super+P. Odd workspaces to the panel, even ones to the\n# external output.\nbindsym $mod+p exec --no-startup-id /usr/local/lib/asus-zephyrus-g14/bin/zephyrus-display order\n\n# The keyboard backlight's level, shown when it changes.\nexec --no-startup-id /usr/local/lib/asus-zephyrus-g14/bin/zephyrus-kbd-notify\n"
|
|
},
|
|
{
|
|
"seat": "node-display-session",
|
|
"kind": "config",
|
|
"content": "# The laptop's own lines in i3 (module asus-zephyrus-g14, novox/hq ADR 0208, ADR 0210). Owned by the\n# mesh: replaced at every push. Once the controller places contributions to node-display-session\n# (ADR 0210), these become the module's contribution instead of a file in i3's directory.\n#\n# The model's panel and touchpad.\n\n# The internal panel is the primary output, where the bars' tray goes. Which monitors are on and where\n# is the display server's (autorandr, run at every session start).\nexec --no-startup-id /usr/local/lib/asus-zephyrus-g14/bin/zephyrus-display primary\n\n# The touchpad's settings again, by hand. X applies them itself whenever the device appears.\nbindsym $mod+Shift+x exec --no-startup-id /usr/local/lib/asus-zephyrus-g14/bin/zephyrus-touchpad reset\n"
|
|
}
|
|
],
|
|
"shell": [
|
|
{
|
|
"for": "after-wake",
|
|
"slot": "normal",
|
|
"code": "# The touchpad's settings again after waking, in the operator's session: X applies the module's\n# input class when the device appears, and this covers a wake that does not initialise it again.\n# Runs as root from the power module; the reset itself runs as the session's owner.\nsleep 2\nowner=$(ps -o user= -C i3 | head -n 1)\n[ -n \"$owner\" ] && runuser -u \"$owner\" -- /usr/local/lib/asus-zephyrus-g14/bin/zephyrus-touchpad reset\ntrue\n"
|
|
}
|
|
]
|
|
}
|