How to Prevent a Linux Laptop from Entering Sleep Mode When the Lid is Closed
Initially, I thought it would be a simple setting adjustment, so I casually Googled it. Sure enough, there was a unanimous solution: modify /etc/systemd/logind.conf, change HandleLidSwitch to ignore or lock, and then restart logind or reboot. I tried this, but it didn’t work at all on my Thinkpad X230. I then tried changing some other options in the aforementioned file, but none worked, and surprisingly, Ubuntu even reported errors. So, I reinstalled the more preferred Debian. Tried again, and it still didn’t work. Finally, I found a more brutal method. ...