# Dietpi turn off screen but not put laptop to sleep?

**URL:** <https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569>\
**Category:** General Discussion\
**Created:** [10 October 2022 19:47 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569 "2022-10-10T19:47:53Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![KalixtShawxo](https://dietpi.com/forum/user_avatar/dietpi.com/kalixtshawxo/32/2631_2.png) [@KalixtShawxo](https://dietpi.com/forum/u/KalixtShawxo)\
**Post date:** [10 October 2022 19:47 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/1 "2022-10-10T19:47:53Z")

</div>

So crazy thing going on.  
I picked up a Dell laptop with some bad pixel issues in the screen, other than that it works great. I installed DietPi 8.9.2 no problem, with the mate desktop, I planned on using rhe laptop with a monitor and keyboard a la a skinny desktop. 👍😁. The problem I am running into is when I close the laptop and the screen goes out, Dietpi goes to sleep. I know someone is going to say “leave the screen open” but I’d rather not. I know how in windows to make the screen closing do nothing to the power,. But I am lost here. Do I need a different desktop than Mate or am missing something cause I can’t find any power or screen settings.

Thanks In advance for any help

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [10 October 2022 19:58 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/2 "2022-10-10T19:58:19Z")

</div>

I never tested it myself but did you try to install/use `mate-power-manager` ?? [Debian -- Details of package mate-power-manager in bullseye](https://packages.debian.org/bullseye/mate-power-manager)

```auto
apt install mate-power-manager

```

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [10 October 2022 20:03 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/3 "2022-10-10T20:03:43Z")

</div>

Yeah I also think you need to use the mate-power-manager.  
From the ubuntu mate forums:

To disable the lid action:

```auto
$ dconf write /org/mate/power-manager/button-lid-ac 'nothing'
$ dconf write /org/mate/power-manager/button-lid-battery 'nothing'

```

And to enable it:

```auto
$ dconf write /org/mate/power-manager/button-lid-ac 'suspend'
$ dconf write /org/mate/power-manager/button-lid-battery 'suspend'

```

[https://ubuntu-mate.community/t/command-to-prevent-laptop-to-go-into-standby-on-lid-close/12667/5](https://ubuntu-mate.community/t/command-to-prevent-laptop-to-go-into-standby-on-lid-close/12667/5)

---

<div class="post-metadata">

**Author:** ![KalixtShawxo](https://dietpi.com/forum/user_avatar/dietpi.com/kalixtshawxo/32/2631_2.png) [@KalixtShawxo](https://dietpi.com/forum/u/KalixtShawxo)\
**Post date:** [10 October 2022 20:18 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/4 "2022-10-10T20:18:55Z")

</div>

Awesome help guys. I will try it out and let you know. 👍

---

<div class="post-metadata">

**Author:** ![KalixtShawxo](https://dietpi.com/forum/user_avatar/dietpi.com/kalixtshawxo/32/2631_2.png) [@KalixtShawxo](https://dietpi.com/forum/u/KalixtShawxo)\
**Post date:** [10 October 2022 20:40 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/5 "2022-10-10T20:40:19Z")

</div>

Well it didn’t seem to make a difference at first, I changed the setting on the gui in mate after the install, closed the screen and it still powered down wirh the “blank” setting. So I changed it to “do nothing” and rebooted the laptop

Now it’s closed and fully functional. Hoping this will also help cool it down, she’s running a bit hot.

Thanks again, I knew I was missing something simple.

---

<div class="post-metadata">

**Author:** ![przemko](https://dietpi.com/forum/user_avatar/dietpi.com/przemko/32/2308_2.png) [@przemko](https://dietpi.com/forum/u/przemko)\
**Post date:** [4 November 2022 20:14 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/6 "2022-11-04T20:14:38Z")

</div>

Hello,  
@Joulinar , @Jappe  
what if I don’t use desktop and want to close laptop lid and use it as server and shh from other devices?

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [4 November 2022 20:49 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/7 "2022-11-04T20:49:01Z")

</div>

do you have a headless option inside `dietpi-config` display settings? Or do you mean the poweroff settings?

---

<div class="post-metadata">

**Author:** ![przemko](https://dietpi.com/forum/user_avatar/dietpi.com/przemko/32/2308_2.png) [@przemko](https://dietpi.com/forum/u/przemko)\
**Post date:** [4 November 2022 22:28 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/8 "2022-11-04T22:28:43Z")

</div>

OK, it works out of the box. Thanks.

---

<div class="post-metadata">

**Author:** ![przemko](https://dietpi.com/forum/user_avatar/dietpi.com/przemko/32/2308_2.png) [@przemko](https://dietpi.com/forum/u/przemko)\
**Post date:** [5 November 2022 10:30 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/9 "2022-11-05T10:30:36Z")

</div>

Hi, it works OK all night but today when I connect to ethernet and install openssh laptop go to sleep when close the lid. I can’t find any option in dietpi-config \> display settings to set headless server.

Edit.  
OK, I find that solution:

```auto
sudo nano /etc/systemd/logind.conf
HandleLidSwitch=ignore
sudo systemctl restart systemd-logind

```

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [5 November 2022 10:51 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/10 "2022-11-05T10:51:11Z")

</div>

Thanks for the hint! I never knew that `systemd-logind` handles power/suspend key and lid actions, but it has a whole set of settings for this: [logind.conf(5) — manpages-de — Debian bullseye — Debian Manpages](https://manpages.debian.org/bullseye/manpages-de/logind.conf.5.de.html#OPTIONEN)

On DietPi it is not installed OOTB, and usually not required on headless/console systems, but good to know that it can be used for it, respectively handles it (not always wanted) when installed for specific reasons.

As a general recommendation: Try to avoid editing existing config files, but create own ones for overriding settings instead:

```nohighlight
mkdir /etc/systemd/logind.conf.d
echo 'HandleLidSwitch=ignore' > /etc/systemd/logind.conf.d/99-disable-lid-switch.conf

```

That way it is easier to revert, more transparent what changed and APT remains able to update the default config without interactive confirmation or having diverging `logind.conf` and `logind.conf.dpkg-dist` files.

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [5 November 2022 11:56 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/11 "2022-11-05T11:56:37Z")

</div>

> [@przemko](#):
>
> I can’t find any option in dietpi-config \> display settings to set headless server.

It’s the last entry in the submenu of `1 : Display Resolution `.

---

<div class="post-metadata">

**Author:** ![przemko](https://dietpi.com/forum/user_avatar/dietpi.com/przemko/32/2308_2.png) [@przemko](https://dietpi.com/forum/u/przemko)\
**Post date:** [5 November 2022 14:57 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/12 "2022-11-05T14:57:56Z")

</div>

> [@MichaIng](#):
>
> As a general recommendation: Try to avoid editing existing config files, but create own ones for overriding settings instead:
> 
> ```auto
> mkdir /etc/systemd/logind.conf.d
> echo 'HandleLidSwitch=ignore' > /etc/systemd/logind.conf.d/99-disable-lid-switch.conf
> 
> ```
> 
> That way it is easier to revert, more transparent what changed and APT remains able to update the default config without interactive confirmation or having diverging `logind.conf` and `logind.conf.dpkg-dist` files.

Thanks I will change that.

> [@Jappe](#):
>
> It’s the last entry in the submenu of `1 : Display Resolution `.

I don’t have that option:

 ![Zrzut ekranu z 2022-11-05 15-55-15](https://dietpi.com/forum/uploads/default/original/2X/e/e17e6fe4cbe81ea440597ea6e656832c8a359171.png)  
 ![Zrzut ekranu z 2022-11-05 15-55-05](https://dietpi.com/forum/uploads/default/original/2X/a/aba0b39e0839cc5271a56482f1bd2b939c461f95.png)  
 ![Zrzut ekranu z 2022-11-05 15-54-54](https://dietpi.com/forum/uploads/default/original/2X/d/d0ad919787bacc7c59fa81ba3e409852e9bb0ce5.png)  
 ![Zrzut ekranu z 2022-11-05 15-54-43](https://dietpi.com/forum/uploads/default/original/2X/3/3ae442d1962f310dd88b56d5a5c4e011b91c69a1.png)

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [5 November 2022 15:11 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/13 "2022-11-05T15:11:36Z")

</div>

Headless mode has only a meaning on RPi, where GPU memory allocation, framebuffer and HDMI signal stack can be completely turned off to save RAM and energy. On x86 systems there is no generic way of doing that which has any benefit, at least not to my knowledge.

---

<div class="post-metadata">

**Author:** ![przemko](https://dietpi.com/forum/user_avatar/dietpi.com/przemko/32/2308_2.png) [@przemko](https://dietpi.com/forum/u/przemko)\
**Post date:** [6 November 2022 08:29 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/14 "2022-11-06T08:29:36Z")

</div>

Thanks, do You know any tricks to save energy when I use old laptop as server?

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [6 November 2022 19:14 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/15 "2022-11-06T19:14:39Z")

</div>

you could try to reduce CPU frequency.

---

<div class="post-metadata">

**Author:** ![7kutb](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/7/ee59a6/32.png) [@7kutb](https://dietpi.com/forum/u/7kutb)\
**Post date:** [3 December 2022 03:55 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/16 "2022-12-03T03:55:16Z")

</div>

I signed up to give this answer:

Two options.

1. Always blank out after x seconds after startup:  
[https://www.reddit.com/r/debian/comments/etggjk/comment/ffw66ye](https://www.reddit.com/r/debian/comments/etggjk/comment/ffw66ye)

> I solved the problem on my own by changing the `consoleblank` at boot.
> 
> Verify the value used at the moment with `cat /sys/module/kernel/parameters/consoleblank`. The value is in seconds. The easiest way to add the parameter at boot is using the kernel command-line.
> 
> 1. Open `/etc/default/grub`
> 2. Add `consoleblank=600` to the `GRUB_CMDLINE_LINUX_DEFAULT=` which sets the timeout to 10 minutes (600 seconds).
> 
> - `GRUB_CMDLINE_LINUX_DEFAULT="quiet consoleblank=0"`
> 
> 1. Run `sudo update-grub`, and reboot.

1. Script to blank on lid close:  
[18.04 - How do I configure laptop lid closing event to turn off screen but not put computer to sleep? - Ask Ubuntu](https://askubuntu.com/questions/1162499/how-do-i-configure-laptop-lid-closing-event-to-turn-off-screen-but-not-put-compu)

(didnt paste answer as stack overflow always archives posts)

I picked the first as I will never log in physically and do things. I set a two minute delay just in case.

---

<div class="post-metadata">

**Author:** ![ForenSeil](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/f/7cd45c/32.png) [@ForenSeil](https://dietpi.com/forum/u/ForenSeil)\
**Post date:** [11 May 2025 00:10 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/17 "2025-05-11T00:10:38Z")

</div>

Hi!  
I Like to use my old N3050 Notebook as Raspotify-Client. An maybe later as a wifi-hotspot.

I’ve changed all the systemd configuration lines with “lid” inside to “ignore”, safed it and did a reboot but the notebook does still suspend when lid is closed

 ![IMG_20250511_021220](https://dietpi.com/forum/uploads/default/original/2X/c/cdc5e83eb1e783235d6b998011fce9381b0259f8.jpeg)

The logind.conf is safed correctly, I checked it three times and try to restart the service aswell

I’ve also Change “handlepowerkey=ignore” but it didnt work aswell, the powerkey still shuts down the Laptop.

I also tried xfce4-power-tools using the gui in lxde but that didnt work aswell.

Any ideas?

---

<div class="post-metadata">

**Author:** ![pulpe](https://dietpi.com/forum/user_avatar/dietpi.com/pulpe/32/3074_2.png) [@pulpe](https://dietpi.com/forum/u/pulpe)\
**Post date:** [11 May 2025 05:30 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/18 "2025-05-11T05:30:22Z")

</div>

@ForenSeil hi, you need to remove hashtag to use the parameters.

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [11 May 2025 16:46 UTC](https://dietpi.com/forum/t/dietpi-turn-off-screen-but-not-put-laptop-to-sleep/14569/19 "2025-05-11T16:46:19Z")

</div>


