Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It's really annoying as I have to unplug the mouse after a suspend to ensure that an occasional bump doesn't wake up the system. I haven't found anything in system settings which could disable this neither by googling around.

share|improve this question

I haven't checked the BIOS yet, but I've found a solution!

Short summary: In "/proc/acpi/wakeup", you can see which devices are currently enabled to resume from suspend. That list shows names (abbreviated) of so called "Devices". Example "PWRB" means "power button".

If you write device-names to that file, you toggle them between enabled/disabled.

I wrote a small HowTo for disabling wakeup-by-mouse, based on a blog where I found that info.

share|improve this answer
This sounds much better than my answer, and I've edited my answer accordingly. Thanks! – Robie Basak Mar 8 '13 at 9:59
So, this works (however, I notice in passing that just using sudo won't work: one has to do sudo su first, then echo to /proc/acpi/wakeup. However, I'm wondering whether anyone has found a way to just disable the mouse? I have both on my desktop connected via (wireless) USB and this will disable the wake from keyboard too. – Marco Oct 3 '14 at 7:38
This worked fine for me. – Devid Dec 9 '15 at 12:00

Thanks to all posters as the mouse wakeup is a major inconvenience and I got my answers here. I wish to add my twist to the solutions as that may help in more cases. I had to disable 3 different items in /proc/acpi/wakeup. My devices: EHC1, EHC2, XHCI. The first 2 are usb2 and the 3rd a usb3 entry. Please note that although the usb transceiver for my mouse is plugged into a usb2 port and nothing is in any usb3 port, the computer will wake on mouse moves until all 3 items are disabled.

$ cat /proc/acpi/wakeup | sort 
Device  S-state   Status   Sysfs node
EHC1      S3    *disabled  pci:0000:00:1d.0
EHC2      S3    *disabled  pci:0000:00:1a.0
GLAN      S4    *enabled   pci:0000:08:00.0
.. ,, ..
USB7      S3    *disabled
WLAN      S3    *disabled  pci:0000:03:00.0
XHCI      S3    *disabled  pci:0000:07:00.0

To have the wakeup items disabled on every startup, you can add something like this to /etc/rc.local ..

echo EHC1 > /proc/acpi/wakeup
echo EHC2 > /proc/acpi/wakeup
echo XHCI > /proc/acpi/wakeup
share|improve this answer

There may be a way specific to your hardware, in which case the option may be available through your system's BIOS settings.

Getting to your BIOS menu to change settings is also system specific. Usually you press a key just after rebooting, and the key to press is often displayed on the screen.

However, user138339's answer seems like a more general way to achieve what you need, and you can do this from the running system.

share|improve this answer

this script solved my problem. check it out.


# allow only one instance
r=$(pidof -x -o $$
set -- $r
if [ "${#@}" -ge 1 ]; then
    echo "Script already running. Exit..."

dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'" | ( while read line; do
    if echo $line | grep "boolean true" &> /dev/null; then
            xinput --set-prop "Dell Premium USB Optical Mouse" "Device Enabled" "0"
            xset dpms force off
            xinput --set-prop "Dell Premium USB Optical Mouse" "Device Enabled" "1"
done )

All you have to do is, first, run sudo xinput list, find the given Name of your USB mouse, and put it on the script. Then, save the file as "", make it executable, and set it to run on startup.

share|improve this answer

This is my step-by-step "tutorial" to make it work for you:

  1. Use command cat /proc/acpi/wakeup to show the list of wake up devices
  2. Use command sudo sh -c "echo XXXX >/proc/acpi/wakeup" (replace "XXXX" with your device code) to toggle the device state (enabled/disabled). Go one device at a time and try to suspend your machine and wake it up using the device you want to disable until the deserved device will not be able to wake up the machine. Don't forget to always enable back the devices that you do not want to have disabled.
  3. When you find the right device create on your desktop file "acpi_wakeup" containing following code: #!/bin/sh printf "XXXX" > /proc/acpi/wakeup (don't forget to replace "XXXX" with your device code)
  4. Move or copy the file to folder /etc/init.d/. To copy the file use following command: sudo cp /home/USERNAME/Desktop/acpi_wakeup /etc/init.d/acpi_wakeup (replace "USERNAME" with your actual user name)
  5. Make the file executable: sudo chmod 755 /etc/init.d/acpi_wakeup
  6. Then use 'update-rc.d' to make the required symbolic links automatically in other directories: sudo update-rc.d acpi_wakeup defaults (it shows WARNING: ...missing LSB tags and overrides but it is OK. You don't need to worry about it)
  7. Reboot your computer.

Sources and further reading:

share|improve this answer

My system is Ubuntu 15.10

I tried to used lsusb command to find what mouse device is. It's very simple, you type lsusb then unplug the mouse (in my case, it's a Bluetooth receiver) and type lsusb again. The device looks like this:

Bus 007 Device 008: ID 24ae:2000

Now find it in /sys/bus/usb/devices/ folder by using the same way (unplug/plug). In my case, I found that they are somewhere in folders start with 7-2*.

Now try to read the idProduct and idVendor. For example: cat /sys/bus/usb/devices/7-2.3/idProduct => 2000, cat /sys/bus/usb/devices/7-2.3/idVendor => 24ae. That's it.

Finally I create a script in /lib/systemd/system-sleep directory, name it whatever you want.

#! /bin/sh

if [ ! -r /sys/bus/usb/devices/7-2.3/power/wakeup ]; then
    exit 0
case "$1" in
    pre )
    echo disabled > /sys/bus/usb/devices/7-2.3/power/wakeup

All done.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.