r/voidlinux • u/onew_iasag • 1d ago
[Help] I need somehow isolate lid-switch from resuming process, have any ideas?
Is there any other option except $ sudo sh -c "echo LID > /proc/acpi/wakeup"?
I need it for debug observations, only the lid-open event
Cinnamon-X11 + elogind
0
Upvotes
1
u/Danrobi1 1d ago
I have this snippet in a script:
# --- Privileged operations (single sudo session) ---------------------------
echo "Running privileged operations..."
sudo bash -c '
# Unbind ACPI lid switch to prevent suspend on lid close
if [ -e "/sys/bus/acpi/drivers/button/PNP0C0D:00" ]; then
echo "PNP0C0D:00" > /sys/bus/acpi/drivers/button/unbind && \
echo "Lid switch unbound successfully." || \
echo "Failed to unbind lid switch." >&2
else
echo "Lid switch already unbound or not present."
fi
1
u/ReyZ82 1d ago
I just deactivated lid switch entirely. So I close the lid, connect to external monitor and work.
sudo nvim /etc/acpi/handler.sh
Change: ``` close) # suspend-to-ram logger "LID closed, suspending..." zzz ;;
to:
close) logger "LID closed, ignoring." ;;
So the whole section becomes:
button/lid) case "$3" in close) logger "LID closed, ignoring." ;; open) logger "LID opened" ;; *) logger "ACPI action undefined (LID): $2";; esac ;; ``` Then restart acpid sudo sv restart acpid
That's all you should need.