How to Keep Your laptop running with a closed lid

Опубликовано: 13 Март 2026
на канале: EZ Tips & Tricks
5,304
37

In this video I am going to show you how to closed your laptop lid doing nothing. This is very useful when you're using a second monitor to your laptop. You can closed you laptop lid while working on the other monitor without an additional docking station.
Here is the link to the website and the script:
https://askubuntu.com/questions/81503...

Copy ONLY the Script below:
and paste it to a Text editor.

#!/usr/bin/env python3
import subprocess

key = ["org.gnome.settings-daemon.plugins.power",
"lid-close-ac-action", "lid-close-battery-action"]

currstate = subprocess.check_output(["gsettings", "get",
key[0], key[1]]).decode("utf-8").strip()

if currstate == "'suspend'":
command = "'nothing'"
subprocess.Popen(["notify-send", "Lid closes with no action"])
else:
command = "'suspend'"
subprocess.Popen(["notify-send", "Suspend will be activated when lid closes"])

for k in [key[1], key[2]]:
subprocess.Popen(["gsettings", "set", key[0], k, command])

I hope you find this video useful! please subscribe!
Link for credit: Audionautix is licensed under a Creative Commons Attribution license (https://creativecommons.org/licenses/...)
Artist: http://audionautix.com/