{"id":601,"date":"2020-12-21T17:53:15","date_gmt":"2020-12-21T22:53:15","guid":{"rendered":"http:\/\/brian.digitalmaddox.com\/blog\/?p=601"},"modified":"2020-12-21T17:53:15","modified_gmt":"2020-12-21T22:53:15","slug":"hey-why-does-my-linux-laptop-keep-waking-up","status":"publish","type":"post","link":"https:\/\/brian.digitalmaddox.com\/blog\/?p=601","title":{"rendered":"Hey Why Does My Linux Laptop Keep Waking up?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A couple of weeks ago I got myself a nice cheap laptop that was on sale for Black Friday.  However today I noticed that every time I closed the lid and put the laptop aside, it was waking up.  Slack was making notification noises when the lid was closed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First thing I did was check out \/proc\/acpi\/wakeup by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep enabled \/proc\/acpi\/wakeup<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">My aha moment came when I saw XHC was enabled to wake up the system from a suspend.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>XHC S3 *enabled pci:0000:00:14.0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The above line in the output says that USB 3.0 (XHCI) devices are able to wake up the laptop.  Since I have a USB wireless mouse plugged in, I noticed of course it would roll around after I&#8217;d close the lid, thus waking up the laptop.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An easy fix for this is to make a file in <em>\/etc\/udev\/rules.d<\/em> like the following;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">xhc.rules<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ACTION==\"add\", KERNEL==\"0000:00:14.0\", SUBSYSTEM==\"pci\", RUN+=\"\/bin\/sh -c 'echo XHC &gt; \/proc\/acpi\/wakeup'\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For your own system, replace the <em>0000:00:14.0<\/em> with the address given after the pci: output in the above grep.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now I can close the lid and not have to worry about turning the mouse off first.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A couple of weeks ago I got myself a nice cheap laptop that was on sale for Black Friday. However today I noticed that every time I closed the lid and put the laptop aside, it was waking up. Slack &hellip; <a href=\"https:\/\/brian.digitalmaddox.com\/blog\/?p=601\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-601","post","type-post","status-publish","format-standard","hentry","category-quicktip"],"_links":{"self":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=601"}],"version-history":[{"count":2,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/601\/revisions"}],"predecessor-version":[{"id":603,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/601\/revisions\/603"}],"wp:attachment":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}