Disable standby and hibernate

Hi,

I cannot disable hibernate and standby mode on my laptop.
I don’t understand why ?

did you mean your kali getting locked after being idle for a few mins? this is issue is known for some time and comes from upstream. some people have found a working solution for this. you can search the forums/kali discord server.

No. I mean that i often use my laptop like a server. So i would like to disable the sleep mode when closing the lid.

i believe you can disable that in settings of whatever desktop environment you are using

I can disable it with some commands. However, after turning it off, it stops working, requiring me to use the commands again.

Here are the codes:

xset s off # disables the screen saver
xset -dpms # disables screen power management
xset s noblank # prevents the screen from dimming

This should be permanent, but it doesn’t work:

sh -c “xset s off && xset -dpms && xset s noblank”