Skip to content

Instantly share code, notes, and snippets.

@ozzbetto
Last active November 14, 2021 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ozzbetto/e0322d472e8d49fa704cb9ebfae54669 to your computer and use it in GitHub Desktop.
Save ozzbetto/e0322d472e8d49fa704cb9ebfae54669 to your computer and use it in GitHub Desktop.
Mouse scroll does no work in linux after suspend
#This command will refresh the scroll in Linux after suspend
#!/bin/bash
modprobe -r psmouse && modprobe psmouse
@ozzbetto
Copy link
Author

  1. Create a file in your home folder
    touch your_script_name.sh

  2. Edit the file
    vi your_script_name.sh

  3. Move to your "system" folder

cd /etc/systemd/system
4) Create service:

sudo touch your_service_name.service
5) Edit service:

nano your_service_name.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/your_username/your_script_name.sh

[Install]
WantedBy=basic.target suspend.target hibernate.target
6) Run chmod

sudo chmod +x /home/your_username/your_script_name.sh
7) Then run the following commands

systemctl daemon-reload
And:

sudo systemctl enable your_service_name.service
That should fix it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment