Last active
December 31, 2017 13:18
-
-
Save pabzdzdzwiagief/13169fba4331fec5c40a to your computer and use it in GitHub Desktop.
An systemd task for turning wakeup on USB off
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /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