From 3a294b3292e156903dd5d986120d7ad24737919d Mon Sep 17 00:00:00 2001 From: Joshua Yun Date: Tue, 9 Jan 2024 17:46:32 -0500 Subject: Added acpi disabling to the wiki --- site/desktop/desktop/index.html | 119 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) (limited to 'site/desktop') 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 @@ + + @@ -399,6 +410,49 @@ + + + + @@ -665,6 +719,38 @@ + + + @@ -682,6 +768,39 @@

This page describes several useful tips and configurations that I've used.

Thunderbird

Syncthing on Artix

+

Disabling ACPI for sleep

+

Somtimes we cannot sleep the computer due to ACPI devices being annoying. +To fix this, we need to disable their wakeup ability.

+

The following command will look at the status of the ACPI devices:

+
cat /proc/acpi/wakeup
+
+

The following command will toggle the status of the ACPI device:

+
echo GP12 > /proc/acpi/wakeup
+
+

Making changes persistant

+

To make the changes persistant, we shall use a oneshot systemd service.

+
/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
+
+

The script /etc/suspend` works by disabling all devices if they are enabled:

+
#!/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 > /proc/acpi/wakeup"
+    fi
+done
+
-- cgit v1.2.3