Keep Linux Running When Laptop Lid is Closed!
In the Operating system you can turn off sleep mode on lid close, to do nothing when the laptop lid is closed from the settings > System > Power & battery
In this Windows operating system you can turn off it by Graphic User Interface (GUI) and it's easy to setup it, but in the Linux operating system, you can't turn off by system settings, there is setting to turn off it, you have to do manually with Command Line Interface, and it's not easy for normal user, even advance user also can't remember every time the command. So I am going to show you how you can disable sleep mode on lid close and set your Linux system to do nothing when the laptop lid is closed. This is useful if you want to run downloads, servers, or access your Linux system remotely even after closing the lid.
This configuration will works on most Linux distributions like Ubuntu, Debian, Kali Linux, Linux Mint, Parrot OS and others.
Open the terminal, then open the logind.conf in nano editor by following command-
sudo nano /etc/systemd/logind.confRemove # tag on change to suspend into ignore this line - #HandleLidSwitch=suspend
HandleLidSwitch=suspend
Remove # tag on change to suspend into ignore this line - #HandleLidSwitchExternalPower=suspend
HandleLidSwitchExternalPower=suspend
Just the remove the # tag in this line - #HandleLidSwitchDocked=ignore
HandleLidSwitchDocked=ignore
Now save the file by pressing- Ctrl+O then press enter, for exit the Nano editor press Crtl+X
Restart the system login configuration by this command-
sudo systemctl restart systemd-logindSystem will restart and may ask multiple time the system password, after restart your system ready to perform any task also while closing the laptop lid. Thats all.
If you are facing any issue while configuration, you can watch the full video -
Leave Keep Linux Running When Laptop Lid is Closed! to:
Read more #hive-197685 posts
Best Posts From AN1INFo
We have not curated any of an1info's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From AN1INFo
- Set Up Google Authenticator 2FA on a Linux System
- How to install VMware tools in Windows and Linux.
- Install Ubuntu 26.04 LTS on MAC VMware Fusion
- Download and Configure Ubuntu 26.04 for installation on VMware Fusion.
- Download and install VMware Fusion on Mac.
- How to Fix Internet Not Working in Linux VMware (Windows 11 VM)
- BYPASS “Install Driver” | Install Windows 11 on Linux VMware Workstation. (Part- 2)
- Install Windows 11 on Linux VMware Workstation. (Part- 1)
- Fix “Could not open /dev/vmmon” Error on Linux | VMware Workstation Kernel Module Fix
- Download and Configuration for Installing Windows 11 on Linux VMware Workstation.
- gcc not found on Linux VMware.
- Install VMware Workstation Pro on Linux + Fix vmmon, gcc & All Errors (Full Guide)
- Install OBS Studio on Linux, Free open-source Broadcaster Software.
- How to create a Windows 11 bootable pen drive on Linux
- Fix Linux Remote Desktop Password Changing After Reboot
- Upgraded My Studio with a microphone stand.
- Fix ‘Unable to Access Location’ Error in Linux
- Microsoft Office 2024 Free Download on Windows (No Crack, 100% Legal)
- Keep Linux Running When Laptop Lid is Closed!
- Most popular data compression encrypt software for Windows, MacOS and Linux operating system.