You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support additional i2c touchpad bus drivers in restart trackpad (#13398) - #13805
omarchy-restart-trackpad only scanned /sys/bus/i2c/drivers/i2c_hid_acpi, missing laptops whose touchpads use elan_i2c or i2c_hid_of drivers, and exited 0 silently even when no device was found.
Changes
Expand driver scanning in bin/omarchy-restart-trackpad to include elan_i2c and i2c_hid_of.
Report an error and exit non-zero if no matching trackpad device is found.
Add automated test in test/shell.d/restart-trackpad-test.sh.
Thanks for working on this! Broadening the driver list to include elan_i2c and i2c_hid_of, along with reporting an error on missing devices, addresses #13398 nicely.
While ACPI-enumerated touchpads are named i2c-<ID>:<instance> (such as i2c-ELAN1000:00), touchpads connected via SMBus/I2C companion buses (common for ELAN hardware) are named <bus>-<addr> (e.g., 0-0015 or 1-002c). These do not match i2c-*, causing the script to report No supported trackpad device found to restart. and exit 1 on those systems.
As noted in #13539, driver control entries in sysfs (bind, unbind, uevent, and module) never contain hyphens, whereas both ACPI (i2c-...) and companion (<bus>-<addr>) device nodes do. Changing the pattern to *-* allows both formats to be detected and reset:
Mock sleep: The test executes sleep 1 during the rebind test, adding ~1 second to the suite run. Adding a dummy sleep executable to $bin_dir keeps the test near-instant.
Mock lsmod: Test 3 verifies the failure path when no sysfs devices are present. If run on a system where the intel_quicki2c module happens to be loaded in the host kernel, the real lsmod detects it, triggers the reload path, sets found=1, and causes Test 3 to fail. Mocking lsmod (returning non-zero or empty output) in $bin_dir ensures test isolation from the host environment.
If you'd prefer not to receive these independent reviews on your PRs, reply to this comment, and I won't review your future PRs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #13398
Summary
omarchy-restart-trackpadonly scanned/sys/bus/i2c/drivers/i2c_hid_acpi, missing laptops whose touchpads useelan_i2cori2c_hid_ofdrivers, and exited 0 silently even when no device was found.Changes
bin/omarchy-restart-trackpadto includeelan_i2candi2c_hid_of.test/shell.d/restart-trackpad-test.sh.