Last active
November 23, 2024 12:31
-
-
Save VMuliadi/8d2798e6a93afdba1803e4113e618382 to your computer and use it in GitHub Desktop.
Allow Linux computer to keep working even the lid was closed. Tested on Linux Fedora 29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo sed -i 's|#HandleLidSwitch=suspend|HandleLidSwitch=ignore|g' /etc/systemd/logind.conf | |
read -p "Are you going to restart your computer (y to restart)?" confirmation | |
if [[ $(echo ${confirmation}) == y || $(echo ${confirmation}) == Y ]]; then | |
sudo reboot | |
else echo "DONE" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment