Neu hinzugefügt: - tools/superx-ctrl.py — zentrale CLI-Steuerung (Frostbay + Tablet RGB + EC Turbo) - tools/tablet-rgb.py — Tablet RGB via HIDRAW - tools/ec-read.py — EC Turbo Status Reader - tools/turbo-*.py — 7 Turbo-Debug/Listener-Scripts - tools/patch-hhd-superx.py — HHD Patch für Super X Turbo-Bypass - udev/99-superx-hid.rules — HIDRAW-Zugriffsregel (0x1A86:0x1305) - dms/plugins/SuperXCtrl/ — DMS Widget (plugin.json + QML + Settings) - README.md — vollständig überarbeitet mit Architektur, Nutzung, Verzeichnisstruktur Geändert: - tools/frostbay_ble.py — rgb-brightness Subcommand hinzugefügt (0xFD Mode)
58 lines
No EOL
2.3 KiB
Python
58 lines
No EOL
2.3 KiB
Python
#!/usr/bin/env python3
|
|
"""Patch HHD __init__.py: enable turbo for Super X even without oxp-platform."""
|
|
filepath = "/usr/lib/python3.14/site-packages/hhd/device/oxp/__init__.py"
|
|
|
|
with open(filepath) as f:
|
|
c = f.read()
|
|
|
|
old = """ turbo = False
|
|
if self.dconf.get("turbo", True) and os.path.exists(
|
|
"/sys/devices/platform/oxp-platform/tt_toggle"
|
|
):
|
|
try:
|
|
with open("/sys/devices/platform/oxp-platform/tt_toggle", "w") as f:
|
|
f.write("1")
|
|
logger.info(f"Turbo button takeover enabled")
|
|
turbo = True
|
|
|
|
if os.path.exists("/sys/devices/platform/oxp-platform/tt_led"):
|
|
with open("/sys/devices/platform/oxp-platform/tt_led", "w") as f:
|
|
f.write("0")
|
|
except Exception:
|
|
logger.warning(
|
|
f"Turbo takeover failed. Ensure you have the latest oxp-sensors driver installed."
|
|
)
|
|
self.turbo = turbo"""
|
|
|
|
new = """ turbo = False
|
|
from hhd.controller.lib.hid import enumerate_unique
|
|
has_superx = bool(enumerate_unique(vid=0x1A86, pid=0x1305, usage_page=0xFF00, usage=0xFF00))
|
|
if self.dconf.get("turbo", True):
|
|
if os.path.exists(
|
|
"/sys/devices/platform/oxp-platform/tt_toggle"
|
|
):
|
|
try:
|
|
with open("/sys/devices/platform/oxp-platform/tt_toggle", "w") as f:
|
|
f.write("1")
|
|
logger.info(f"Turbo button takeover enabled")
|
|
turbo = True
|
|
|
|
if os.path.exists("/sys/devices/platform/oxp-platform/tt_led"):
|
|
with open("/sys/devices/platform/oxp-platform/tt_led", "w") as f:
|
|
f.write("0")
|
|
except Exception:
|
|
logger.warning(
|
|
f"Turbo takeover failed. Ensure you have the latest oxp-sensors driver installed."
|
|
)
|
|
elif has_superx:
|
|
logger.info(f"Super X turbo button enabled via HID vendor device.")
|
|
turbo = True
|
|
self.turbo = turbo"""
|
|
|
|
assert old in c, "Patch target not found"
|
|
c = c.replace(old, new)
|
|
|
|
with open(filepath, "w") as f:
|
|
f.write(c)
|
|
|
|
print("✅ PATCHED: __init__.py — Super X turbo bypasses oxp-platform check") |