diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-06-27 14:50:20 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-06-27 14:50:20 +0200 |
| commit | 8697555125c57ae64a0c9b78514b4aac4fd523de (patch) | |
| tree | a699df53a7c35a4425f30bca86982c4341f6de40 /content/posts/2020-08-15-systemd-disable-wake-onmouse.md | |
| parent | 33b2615a5038bc85036081e8b5e0da8584d88097 (diff) | |
| download | mitjafelicijan.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.md | 43 |
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 | |||
| 5 | draft: false | 5 | draft: false |
| 6 | --- | 6 | --- |
| 7 | 7 | ||
| 8 | I recently bought [ThinkPad X220](https://www.laptopmag.com/reviews/laptops/lenovo-thinkpad-x220) | 8 | I recently bought [ThinkPad |
| 9 | just as a joke on eBay to test Linux distributions and play around with things | 9 | X220](https://www.laptopmag.com/reviews/laptops/lenovo-thinkpad-x220) just as a |
| 10 | and not destroy my main machine. Little to my knowledge I felt in love with it. | 10 | joke on eBay to test Linux distributions and play around with things and not |
| 11 | Man, they really made awesome machines back then. | 11 | destroy my main machine. Little to my knowledge I felt in love with it. Man, |
| 12 | they really made awesome machines back then. | ||
| 12 | 13 | ||
| 13 | After changing disk that came with it to SSD and installing Ubuntu to test if | 14 | After changing disk that came with it to SSD and installing Ubuntu to test if |
| 14 | everything works I noticed that even after a single touch of my external mouse | 15 | everything works I noticed that even after a single touch of my external mouse |
| 15 | the system would wake up from sleep even though the lid was shut down. | 16 | the system would wake up from sleep even though the lid was shut down. |
| 16 | 17 | ||
| 17 | I wouldn't even noticed it if laptop didn't have | 18 | I 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). | 19 | sleep indicator](https://support.lenovo.com/lk/en/solutions/~/media/Images/ContentImages/p/pd025386_x1_status_03.ashx?w=426&h=262). |
| 19 | I already had a bad experience with Linux and it's power management. I had a | 20 | I 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 |
| 21 | with a touchscreen and while traveling it decided to wake up and started cooking | 22 | with a touchscreen and while traveling it decided to wake up and started cooking |
| 22 | in my backpack to the point that the digitizer responsible for touch actually | 23 | in my backpack to the point that the digitizer responsible for touch actually |
| 23 | glue off and the whole screen got wrecked. So, I am a bit touchy about this. | 24 | glue off and the whole screen got wrecked. So, I am a bit touchy about this. |
| 24 | 25 | ||
| 25 | I went on solution hunting and to my surprise there is no easy way to disable | 26 | I went on solution hunting and to my surprise there is no easy way to disable |
| 26 | specific devices to perform wake up. Why is this not under the power management | 27 | specific devices to perform wake up. Why is this not under the power management |
| 27 | tab in setting is really strange. | 28 | tab in setting is really strange. |
| 28 | 29 | ||
| 29 | After googling for a solution I found [this nice article describing the solution](https://codetrips.com/2020/03/18/ubuntu-disable-mouse-wake-from-suspend/) | 30 | After googling for a solution I found [this nice article describing the |
| 30 | that worked for me. The only problem with this solution was that he added his | 31 | solution](https://codetrips.com/2020/03/18/ubuntu-disable-mouse-wake-from-suspend/) |
| 31 | solution to `.bashrc` and this triggers `sudo` that asks for a password each | 32 | that worked for me. The only problem with this solution was that he added his |
| 32 | time new terminal is opened, which get annoying quickly since I open a lot of | 33 | solution to `.bashrc` and this triggers `sudo` that asks for a password each |
| 34 | time new terminal is opened, which get annoying quickly since I open a lot of | ||
| 33 | terminals all the time. | 35 | terminals all the time. |
| 34 | 36 | ||
| 35 | I followed his instructions and got to solution | 37 | I 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 | ||
| 38 | I created a system service file `sudo nano /etc/systemd/system/disable-mouse-wakeup.service` | 40 | I created a system service file `sudo nano |
| 39 | and 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 |
| 40 | in `ExecStart`. | 42 | replaced `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. | |||
| 68 | If you have many devices you would like to surpress from waking up your machine | 70 | If you have many devices you would like to surpress from waking up your machine |
| 69 | I would create a shell script and call that instead of direclty doing it in | 71 | I would create a shell script and call that instead of direclty doing it in |
| 70 | service file. | 72 | service file. |
| 71 | |||
