this post was submitted on 07 Feb 2024
49 points (98.0% liked)

Linux

48371 readers
1701 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

It is incredibly annoying to me that my mouse wakes the computer when I barely touch it. If I want my PC to turn on, I press the Super key.

I find very hacky scripts online, I tried some but they didn't work. How did you disable it?

This option is missing from settings.

top 20 comments
sorted by: hot top controversial new old
[–] MyNameIsRichard@lemmy.ml 18 points 9 months ago (2 children)

I created a systemd service by putting the following in /etc/systemd/system/disable-mouse-wakeup.service


[Unit]
Description=Disable Mouse wakeup triggers

[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo XHC0 > /proc/acpi/wakeup"
ExecStop=/bin/sh -c "echo XHC0 > /proc/acpi/wakeup"
RemainAfterExit=yes

[Install] 
WantedBy=multi-user.target

Then I ran sudo systemctl enable --now disable-mouse-wakeup

It works perfectly on my AMD machine.

[–] Frederic@beehaw.org 3 points 9 months ago

On mine it was playing with some /sys/bus/usb/devices/1-4/power/wakeup or something, (use the right device number from lsusb), also there is some settings in the BIOS to power or not USB when sleeping, obviously if some USB port have no power, wakeup cannot work :) Every setup/BIOS is kinda different though.

And I have had the same problem as OP with just knocking the desk and the computer wakes up and it is annoying!

My latest trackball I switched it to Bluetooth mode so when PC is sleeping, no BT at all.

[–] GravitySpoiled@lemmy.ml 1 points 9 months ago (2 children)

unfortunately, that doesn't work.

[–] fuckwit_mcbumcrumble@lemmy.world 3 points 9 months ago (2 children)

What system do you have? Laptop or desktop, if laptop which one, if desktop which mobo do you have? Check your bios for any sleep options, specifically S0 vs S3 standby.

S0 standby vs S3 standby can change things a lot. If you're in S3 standby then it's up to your bios/firmware to handle waking from sleep. If you're in S0 standby then your OS is in control.

[–] GravitySpoiled@lemmy.ml 1 points 9 months ago* (last edited 9 months ago)

There was a setting in bios for wakeup. It was turned off. I turned it on but nothing changed.

[–] GravitySpoiled@lemmy.ml 1 points 9 months ago

I'll check now, thanks!

[–] MyNameIsRichard@lemmy.ml 1 points 9 months ago* (last edited 9 months ago) (1 children)

Run cat /proc/acpi/wakeup and try some of the other devices instead of XHC0 if they are enabled

Edit: Remember to run sudo systemctl stop disable-mouse-wakeup to reset them if it doesn't work

[–] GravitySpoiled@lemmy.ml 1 points 9 months ago* (last edited 9 months ago) (1 children)

Unfortunately, disabling the devices doesn't work.

RP01	  S4	*enabled   pci:0000:00:1c.0
RP05	  S4	*enabled   pci:0000:00:1c.4
RP06	  S4	*enabled   pci:0000:00:1c.5
LID0	  S3	*enabled   platform:PNP0C0D:00
PBTN	  S3	*enabled   platform:PNP0C0C:00

I had this device earlier but I disabled it with your systemctl service earlier and although I stopped the service, it didn't come back. Probably, it's back on next reboot. XHC S0 *enabled pci:0000:00:14.0

I didn't test LID0 or Powerbutton.

[–] reddthat@reddthat.com 4 points 9 months ago

Those wakelock devices map to specific devices. If you run lsusb you will see the pci:0000:00:1c.4 and others.

  • Find the one that your mouse is.
  • Do the echo command into that device RP05.
  • Confirm it's disabled.
  • suspend & then try moving the mouse
  • if it works edit the systemd script with the correct echo command
  • make sure you make the service Enabled (otherwise it won't start on boot)
  • reboot and confirm it's still disabled.

That should be what is needed to disable waking up from the mouse.

[–] Doompickaxe@feddit.de 6 points 9 months ago (2 children)

Maybe a setting in the BIOS? It will most probably not have a setting for the Mouse but USB

[–] turbowafflz@lemmy.world 6 points 9 months ago

Yeah this is a hardware thing. If there's no bios setting you might just be able to switch your mouse to a different usb port, most motherboards can only wake from 2 of them

[–] GravitySpoiled@lemmy.ml 1 points 9 months ago

As dar as I remember there is no setting for it in the bios, but I'll check

[–] Akip@feddit.de 4 points 9 months ago

you can try if your monitor has a USB hub put it on there, when the monitor is off so goes the mouse.

[–] s38b35M5@lemmy.world 3 points 9 months ago

Which distro? Do you have tlp installed? If so, you an use tlpui to configure lots of power related settings.

I've been working on a fix for a similar issue, but it might not apply because my issue is caused by my mouse's wireless reciever. I wrote a little script to replace the bluetooth wakup config file, and it works when I manually run it. However, this resets every time I restart and I'm having difficulty getting it to run on startup, probably because it requires sudo.

[–] aes@programming.dev 2 points 9 months ago

Turn the mouse upside down.

Also, check your BIOS settings. Turning it on from completely off also sounds sus, surely it's 'hibernating' or something, right?

[–] MangoPenguin@lemmy.blahaj.zone 1 points 9 months ago (1 children)

It's amazing how difficult this is to do. I like Linux and all, but seriously in Windows this is a couple clicks to fix.

[–] Pantherina@feddit.de -2 points 9 months ago

Plug it out lol

[–] peasntanks@lemmy.ml -3 points 9 months ago

I just unplug the mouses USB from the PC and plug it back in after putting the PC to sleep. Et voila, pc no longer wakes from mouse.