Skip to content

Instantly share code, notes, and snippets.

@barron9
Last active May 5, 2023 13:33
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 barron9/5554e87451059d8dc106facb4649eb1f to your computer and use it in GitHub Desktop.
Save barron9/5554e87451059d8dc106facb4649eb1f to your computer and use it in GitHub Desktop.
ubuntu 22.04 a4tech fstyler wireless keyboard wake fix service
[Unit]
Description=Run script after screen unlock/wake
After=sleep.target
After=suspend.target
[Service]
User=root
Type=oneshot
ExecStart=/home/berkin/wakefix.sh
[Install]
WantedBy=suspend.target
WantedBy=sleep.target
for port in $(lspci | grep USB | cut -d' ' -f1); do
echo -n "0000:${port}"| sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind;
sleep 5;
echo -n "0000:${port}" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind;
sleep 5;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment