summaryrefslogtreecommitdiff
path: root/site/desktop
diff options
context:
space:
mode:
authorJoshua Yun <joshua@joshuayun.com>2024-01-09 17:46:32 -0500
committerJoshua Yun <joshua@joshuayun.com>2024-01-09 17:46:32 -0500
commit3a294b3292e156903dd5d986120d7ad24737919d (patch)
tree6d8f54f7eea9871015ec5acf4cef4a996ed5a154 /site/desktop
parente5ace8b350a211ded979eb9c3049b527658ca986 (diff)
downloadwiki-3a294b3292e156903dd5d986120d7ad24737919d.tar.gz
Added acpi disabling to the wiki
Diffstat (limited to 'site/desktop')
-rw-r--r--site/desktop/desktop/index.html119
1 files changed, 119 insertions, 0 deletions
diff --git a/site/desktop/desktop/index.html b/site/desktop/desktop/index.html
index cbbdf4f..3706b8e 100644
--- a/site/desktop/desktop/index.html
+++ b/site/desktop/desktop/index.html
@@ -389,6 +389,17 @@
+ <label class="md-nav__link md-nav__link--active" for="__toc">
+
+
+ <span class="md-ellipsis">
+ Desktop
+ </span>
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
<a href="./" class="md-nav__link md-nav__link--active">
@@ -399,6 +410,49 @@
</a>
+
+
+<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
+
+
+
+
+
+
+ <label class="md-nav__title" for="__toc">
+ <span class="md-nav__icon md-icon"></span>
+ Table of contents
+ </label>
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
+
+ <li class="md-nav__item">
+ <a href="#disabling-acpi-for-sleep" class="md-nav__link">
+ <span class="md-ellipsis">
+ Disabling ACPI for sleep
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Disabling ACPI for sleep">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#making-changes-persistant" class="md-nav__link">
+ <span class="md-ellipsis">
+ Making changes persistant
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ </ul>
+
+</nav>
+
</li>
@@ -665,6 +719,38 @@
+ <label class="md-nav__title" for="__toc">
+ <span class="md-nav__icon md-icon"></span>
+ Table of contents
+ </label>
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
+
+ <li class="md-nav__item">
+ <a href="#disabling-acpi-for-sleep" class="md-nav__link">
+ <span class="md-ellipsis">
+ Disabling ACPI for sleep
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Disabling ACPI for sleep">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#making-changes-persistant" class="md-nav__link">
+ <span class="md-ellipsis">
+ Making changes persistant
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ </ul>
+
</nav>
</div>
</div>
@@ -682,6 +768,39 @@
<p>This page describes several useful tips and configurations that I've used.</p>
<p><a href="../thunderbird/">Thunderbird</a></p>
<p><a href="../syncthing/">Syncthing on Artix</a></p>
+<h2 id="disabling-acpi-for-sleep">Disabling ACPI for sleep</h2>
+<p>Somtimes we cannot sleep the computer due to ACPI devices being annoying.
+To fix this, we need to disable their wakeup ability.</p>
+<p>The following command will look at the status of the ACPI devices:</p>
+<pre><code>cat /proc/acpi/wakeup
+</code></pre>
+<p>The following command will toggle the status of the ACPI device:</p>
+<pre><code>echo GP12 &gt; /proc/acpi/wakeup
+</code></pre>
+<h3 id="making-changes-persistant">Making changes persistant</h3>
+<p>To make the changes persistant, we shall use a oneshot systemd service.</p>
+<pre><code>/etc/systemd/system/disable-acpi.service
+----------------------------------------
+[Unit]
+Description="Disable ACPI for sleeping"
+
+[Service]
+ExecStart=/bin/sh -c "/etc/suspend"
+Type=oneshot
+
+[Install]
+WantedBy=multi-user.target
+</code></pre>
+<p>The script /etc/suspend` works by disabling all devices if they are enabled:</p>
+<pre><code>#!/bin/sh
+
+declare -a devices=(INSERT DEVICE LIST HERE)
+for device in "${devices[@]}"; do
+ if grep -qw ^$device.*enabled /proc/acpi/wakeup; then
+ sudo sh -c "echo $device &gt; /proc/acpi/wakeup"
+ fi
+done
+</code></pre>