aboutsummaryrefslogtreecommitdiff
path: root/content/posts/2020-08-15-systemd-disable-wake-onmouse.md
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2023-06-27 14:50:20 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2023-06-27 14:50:20 +0200
commit8697555125c57ae64a0c9b78514b4aac4fd523de (patch)
treea699df53a7c35a4425f30bca86982c4341f6de40 /content/posts/2020-08-15-systemd-disable-wake-onmouse.md
parent33b2615a5038bc85036081e8b5e0da8584d88097 (diff)
downloadmitjafelicijan.com-8697555125c57ae64a0c9b78514b4aac4fd523de.tar.gz
Massive formatting and added figcaption
Diffstat (limited to 'content/posts/2020-08-15-systemd-disable-wake-onmouse.md')
-rw-r--r--content/posts/2020-08-15-systemd-disable-wake-onmouse.md43
1 files changed, 22 insertions, 21 deletions
diff --git a/content/posts/2020-08-15-systemd-disable-wake-onmouse.md b/content/posts/2020-08-15-systemd-disable-wake-onmouse.md
index fabdc32..55086b1 100644
--- a/content/posts/2020-08-15-systemd-disable-wake-onmouse.md
+++ b/content/posts/2020-08-15-systemd-disable-wake-onmouse.md
@@ -5,39 +5,41 @@ date: 2020-08-15T12:00:00+02:00
5draft: false 5draft: false
6--- 6---
7 7
8I recently bought [ThinkPad X220](https://www.laptopmag.com/reviews/laptops/lenovo-thinkpad-x220) 8I recently bought [ThinkPad
9just as a joke on eBay to test Linux distributions and play around with things 9X220](https://www.laptopmag.com/reviews/laptops/lenovo-thinkpad-x220) just as a
10and not destroy my main machine. Little to my knowledge I felt in love with it. 10joke on eBay to test Linux distributions and play around with things and not
11Man, they really made awesome machines back then. 11destroy my main machine. Little to my knowledge I felt in love with it. Man,
12they really made awesome machines back then.
12 13
13After changing disk that came with it to SSD and installing Ubuntu to test if  14After changing disk that came with it to SSD and installing Ubuntu to test if 
14everything works I noticed that even after a single touch of my external mouse 15everything works I noticed that even after a single touch of my external mouse
15the system would wake up from sleep even though the lid was shut down. 16the system would wake up from sleep even though the lid was shut down.
16 17
17I wouldn't even noticed it if laptop didn't have 18I wouldn't even noticed it if laptop didn't have [LED
18[LED sleep indicator](https://support.lenovo.com/lk/en/solutions/~/media/Images/ContentImages/p/pd025386_x1_status_03.ashx?w=426&h=262). 19sleep indicator](https://support.lenovo.com/lk/en/solutions/~/media/Images/ContentImages/p/pd025386_x1_status_03.ashx?w=426&h=262).
19I already had a bad experience with Linux and it's power management. I had a 20I already had a bad experience with Linux and it's power management. I had a
20[Dell Inspiron 7537](https://www.pcmag.com/reviews/dell-inspiron-15-7537) laptop 21[Dell Inspiron 7537](https://www.pcmag.com/reviews/dell-inspiron-15-7537) laptop
21with a touchscreen and while traveling it decided to wake up and started cooking 22with a touchscreen and while traveling it decided to wake up and started cooking
22in my backpack to the point that the digitizer responsible for touch actually 23in my backpack to the point that the digitizer responsible for touch actually
23glue off and the whole screen got wrecked. So, I am a bit touchy about this. 24glue off and the whole screen got wrecked. So, I am a bit touchy about this.
24 25
25I went on solution hunting and to my surprise there is no easy way to disable 26I went on solution hunting and to my surprise there is no easy way to disable
26specific devices to perform wake up. Why is this not under the power management  27specific devices to perform wake up. Why is this not under the power management 
27tab in setting is really strange. 28tab in setting is really strange.
28 29
29After googling for a solution I found [this nice article describing the solution](https://codetrips.com/2020/03/18/ubuntu-disable-mouse-wake-from-suspend/) 30After googling for a solution I found [this nice article describing the
30that worked for me. The only problem with this solution was that he added his 31solution](https://codetrips.com/2020/03/18/ubuntu-disable-mouse-wake-from-suspend/)
31solution to `.bashrc` and this triggers `sudo` that asks for a password each 32that worked for me. The only problem with this solution was that he added his
32time new terminal is opened, which get annoying quickly since I open a lot of 33solution to `.bashrc` and this triggers `sudo` that asks for a password each
34time new terminal is opened, which get annoying quickly since I open a lot of
33terminals all the time. 35terminals all the time.
34 36
35I followed his instructions and got to solution 37I followed his instructions and got to solution `sudo sh -c "echo 'disabled' >
36`sudo sh -c "echo 'disabled' > /sys/bus/usb/devices/2-1.1/power/wakeup"`. 38/sys/bus/usb/devices/2-1.1/power/wakeup"`.
37 39
38I created a system service file `sudo nano /etc/systemd/system/disable-mouse-wakeup.service` 40I created a system service file `sudo nano
39and removed `sudo` and replaced `sh` with `/usr/bin/sh` and pasted all that 41/etc/systemd/system/disable-mouse-wakeup.service` and removed `sudo` and
40in `ExecStart`. 42replaced `sh` with `/usr/bin/sh` and pasted all that in `ExecStart`.
41 43
42```ini 44```ini
43[Unit] 45[Unit]
@@ -68,4 +70,3 @@ This will permanently disable that device from wakeing up you computer on boot.
68If you have many devices you would like to surpress from waking up your machine 70If you have many devices you would like to surpress from waking up your machine
69I would create a shell script and call that instead of direclty doing it in 71I would create a shell script and call that instead of direclty doing it in
70service file. 72service file.
71