Skip to content

Instantly share code, notes, and snippets.

@pabzdzdzwiagief
Last active December 31, 2017 13:18
Show Gist options
  • Save pabzdzdzwiagief/13169fba4331fec5c40a to your computer and use it in GitHub Desktop.
Save pabzdzdzwiagief/13169fba4331fec5c40a to your computer and use it in GitHub Desktop.
An systemd task for turning wakeup on USB off
# /etc/systemd/system/usb-wakeup-fix.service
# sudo systemctl enable usb-wakeup-fix.service
[Unit]
Description=Disable wakeup on USB devices
RequiresMountsFor=/proc/acpi/wakeup
DefaultDependencies=no
StopWhenUnneeded=yes
Before=sleep.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c '</proc/acpi/wakeup /bin/grep USB | /bin/grep enabled | /usr/bin/cut -d\' \' -f1 | xargs -i sh -c "echo {} > /proc/acpi/wakeup"'
[Install]
WantedBy=sleep.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment