Fixes suspend-on-lid-close with the Redmibook Pro 15S
NEW: can also be just a lid-close listener with lid_event_command.rs
Tested on BIOS versions:
RMACZ5B0P0505
RMACZ5B0P0909
THIS IS NOT MY CODE - Written by Liu Jin!!!
I was trying to find a solution for this for years, and just today found a random Chinese forum site that had a solution. This doesn't seem to be documented anywhere else on the internet.
Dependencies:
rust
evemu
acpid
Installation:
sudo usermod -aG input $USER
git clone https://github.com/ThatOneCalculator/redmibook-pro-15s-acpi-sleep-listener/ && cd redmibook-pro-15s-acpi-sleep-listener
rustc lid_event.rs && sudo install -Dm755 ./lid_event /usr/local/bin/
sudo cp ./lid-event.service /etc/systemd/system/
systemctl daemon-reload && systemctl enable --now lid-event.service