Skip to main content

Preventing the Raspberry Pi from Sleeping

Background

Lightdm is a cross-desktop display manager that is used in debian based distributions. It is the default display manager for Ubuntu, Linux Mint, and Raspbian/RaspberryPi OS. It is used to manage the login screen, and to start the desktop environment. It is also used to start the X server, which is the graphical user interface that is used to interact with the Raspberry Pi.

While there are several methods of achieving a similar result, this guide will focus on using the xserver-command option in the lightdm.conf file to disable screen blanking and power management for the X server.

Setup

  1. In Raspberry Pi terminal, run the following command to open the lightdm.conf file
sudo nano /etc/lightdm/lightdm.conf
  1. Insert the following at the bottom of the lightdm.conf file to disable screen blanking and power management for the X server
lightdm.conf
...
xserver-command=X -s 0 dpms
  1. To save and exist the file, press ctrl + x then type y and press enter

  2. Reboot the Raspberry Pi to apply the changes using

sudo reboot now

Additional Information

- https://wiki.debian.org/LightDM