Skip to content

Instantly share code, notes, and snippets.

@jaredumbehr
Forked from ozzbetto/scroll-refresh.sh
Created September 28, 2021 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredumbehr/2c5433deb86e42583ddd7955de756fe8 to your computer and use it in GitHub Desktop.
Save jaredumbehr/2c5433deb86e42583ddd7955de756fe8 to your computer and use it in GitHub Desktop.
Mouse scroll does no work in linux after suspend
Run commands automatically after suspend:
1) Create script with commands (open Terminal and type)
sudo touch yourscriptname.sh
This will create the file in your home folder.
2) Edit script
sudo nano yourscriptname.sh
Paste this in and save the file:
#!/bin/bash
modprobe -r psmouse && modprobe psmouse
3) Move to your "system" folder
cd /etc/systemd/system
4) Create service:
sudo touch yourservicename.service
5) Edit service:
nano yourservicename.service
Paste this in and save it afterwards
[Unit]
Description=Run user script after suspend
After=basic.target suspend.target hibernate.target
[Service]
User=root
Environment=DISPLAY=:0
ExecStart=/home/yourusername/yourscriptname.sh
[Install]
WantedBy=basic.target suspend.target hibernate.target
6) Run chmod
sudo chmod +x /home/yourusername/yourscriptname.sh
7) Then run the following commands
systemctl daemon-reload
And:
sudo systemctl enable yourservicename.service
That should fix it!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment