My Laptop often have an issue where touchpad stops responding after the laptop wakes up from sleep. This script will restart and make it work properly.
- Laptop Model: HP ENVY X360
- Operating System: Zorin OS 17.3 Core
While tested on this specific setup, this solution might work for other laptops or Linux distributions experiencing similar touchpad issues after suspend, particularly those using the i2c_hid_acpi driver.
The problem is that the touchpad's driver ( i2c_hid_acpi ) sometimes fails to load properly after the system resumes from a low-power state.
The touchpad-reload script fixes this by:
sudo rmmod i2c_hid_acpi: This command unloads thei2c_hid_acpitouchpad's driver from the system memory.sudo modprobe i2c_hid_acpi: This command then loads thei2c_hid_acpimodule back into memory, forcing it to re-load and properly detect your touchpad.
The script is placed in a special directory (/lib/systemd/system-sleep/) where systemd (system service manager) automatically runs scripts after a suspend/resume event. Making the script executable (sudo chmod +x) allows the system to run it as a program.
Follow these simple steps to install the touchpad fix:
-
Download the Script: Download the
touchpad-reloadfile directly from this repository to your laptop (e.g., into yourDownloadsfolder). -
Open a Terminal: Press
Ctrl + Alt + Tor oopen your terminal. -
Move the Script to the System Directory: Place the downloaded
touchpad-reloadfile into the correct system directory (/lib/systemd/system-sleep/). Assuming the file is in yourDownloadsfolder, use this command:sudo mv ~/Downloads/touchpad-reload /lib/systemd/system-sleep/You will be asked for root password.
-
Make the Script Executable: For the system to run the script, it must have executable permissions. In the terminal, run:
sudo chmod +x /lib/systemd/system-sleep/touchpad-reload
-
Reboot Your System: It's recommended to reboot your laptop to ensure the script works properly. Simply type in the terminal:
sudo reboot
After rebooting, you're good to go!
-
Test the Fix (Optional): After rebooting and logging in, put your laptop to sleep. Then, wake it up. Your touchpad should now work as normal.
To remove the fix, simply delete the script file:
- Open a Terminal:
Ctrl + Alt + T - Delete the script:
Enter your password and it gone!
sudo rm /lib/systemd/system-sleep/touchpad-reload
This script involves modifying system files, use it at your own risk. Always ensure you have backups of important data.
If this script helped you, please consider starring this repository! If you have any feedback, questions, or discover that this solution works on other laptop models or distributions, feel free to open an issue or reach out.
This project is licensed under the MIT License - see the LICENSE file for details.