Kali Linux: How to keep your laptop running when you close the lid

I wanted to run some software on my laptop but I wanted to close the lid of my laptop so it would be easier to carry with me but every time when I closed the lid my laptop went to sleep
and stopped everything what it was doing =( I didn’t find any settings from Kali Linux GUI but you can do some small command line kung fu:

This setting disable the sleep mode when your laptop charger is plugged in and you close the lid:

gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action nothing

And this one disable the sleep mode when you are running your laptop on battery mode:

gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action nothing

After that your laptop should stay a wake even if you close the lid =)

11 comments to Kali Linux: How to keep your laptop running when you close the lid

  • Dick Rees

    Hi Blog,
    This might be off topic, however Yep, the questions says almost all. Actually I´m running windows 8 with Virtualbox and I wanted to use Kali linux, ok, lets say just a linux with it. As my 535u3c laptop is brand new,I dont want to screw up the boot with Grub. And the problem is, Kali linux has max resolution 1024×800 or something like that. Even in full screen mode…The host has 1366×768…Also with Widescreen…The Kali is only 4:3 mode. And the graphics is 7500g with amd trinity 3 series a6-4455m. Also 4Gb of integraded ram(soldered to the MB, thats why integraded…)…The windows 8 system has all the drivers installed and updated to the latest, soo there isnt the problem… Well, couldnt give more information about it anyway. I ill only accept right answers and not vague answers, that are made as conclusion from my text…Also would appreciate Answers with a link to the original text to prove the answer, but thats secondary…Anyway, I would like to thank all the answers in advance…
    All the Best

  • Nasha Jojima

    Thank U man, I tryed to find were I can change this option, and nothing.
    Now I can leave my nb working when I do other things at home.

  • tony

    doesn’t work. I get:
    ** (process:3281): WARNING **: Command line `dbus-launch –autolaunch=4a996226fc4af57cb359f8eb53dff49e –binary-syntax –close-stderr’ exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n

    ** (process:3281): WARNING **: Command line `dbus-launch –autolaunch=4a996226fc4af57cb359f8eb53dff49e –binary-syntax –close-stderr’ exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n

    • Then you did something wrong. I Copied and pasted the commands into a terminal window and it works like a champ on Kali 1.09.

      Select the entire command, CTRL C.
      To paste into terminal SHIFT CTRL V

  • Cory

    Nice, this work like a charm!!!! Thank you so much for this. It really annoying that I have to start all over when I close my lid on my laptop!!

  • Rob

    I am using Kali 64 2.0. When I try the above commands i get:

    “No such key ‘lid-close-ac-action’

    ???

  • drkurrey

    HandleLidSwitch=ignore

    works for Kali 2.0

  • Milton

    In kali 2.0 go to tweak tool>Power> and it should be here.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>