pm-utils script to disable wakup by events from USB devices on Sony Vaio 1311s9rb
#!/bin/bash | |
# /usr/lib/pm-utils/sleep.d/45fix-usb-wakup | |
# Disable wakup from USB devices on Sony Vaio 1311s9rb | |
function print_state { | |
cat /proc/acpi/wakeup | grep $1 | cut -f3 | cut -d' ' -f1 | tr -d '*' | |
} | |
function disable_wakup { | |
dev=$1 | |
if [ "`print_state $dev`" == "enabled" ]; then | |
echo $dev > /proc/acpi/wakeup | |
fi | |
} | |
function enable_wakup { | |
dev=$1 | |
if [ "`print_state $dev`" == "disabled" ]; then | |
echo $dev > /proc/acpi/wakeup | |
fi | |
} | |
case $1 in | |
hibernate) | |
echo "Going to suspend to disk!" | |
;; | |
suspend) | |
echo "Fixing acpi settings." | |
# Disable wakup by events from USB hubs | |
# (e.g. mouse move on some mices) | |
disable_wakup XHC | |
disable_wakup EHC1 | |
disable_wakup EHC2 | |
echo "Suspending to RAM." | |
;; | |
thaw) | |
echo "Suspend to disk is now over!" | |
;; | |
resume) | |
echo "We are now resuming." | |
;; | |
*) | |
echo "Somebody is callin me totally wrong." | |
;; | |
esac |
This comment has been minimized.
This comment has been minimized.
Thanks a bunch ... working perfectly to prevent USB keyboard waking system in Kubuntu 14.04 desktop. |
This comment has been minimized.
This comment has been minimized.
What is purpose of |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Thanks! Here is modified version for systemd sleep hook for those who are not using pm-utils: https://gist.github.com/kepi/9dea7aee8a59f3e7c10a