Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running the Debian wheezy beta and using my Pi to display my geckoboard dashboards using midori, as a result I want to prevent the screen from going blank, which it does after 10 minutes (though it doesn't seem to turn off the backlight). I have searched through the menu options and can not find how to prevent this. I came across a post on raspberrypi.org suggesting that the following:

sudo sh -c "TERM=linux setterm -blank 0 >/dev/tty0"

would solve the problem, but it does not work. I have also tried changing BLANK_TIME to zero in /etc/kbd/config without success.

share|improve this question
up vote 57 down vote accepted

This is an X power-saving thing.

Firstly, you may need to install xset, a lightweight application that controls some X settings.

apt-get install x11-xserver-utils

Now open up your ~/.xinitrc file (if you don't have one then create it) and enter this:

xset s off         # don't activate screensaver
xset -dpms         # disable DPMS (Energy Star) features.
xset s noblank     # don't blank the video device

exec /etc/alternatives/x-session-manager      # start lxde

This file runs once every time X starts and should solve the problem. I copy and pasted it from my own .xinitrc and can confirm that my screen does not blank.

share|improve this answer
@SteveRobillard apt-get install x11-xserver-utils – Flexo Jun 26 '12 at 19:54
Which account should the .xinitrc be created for? The pi account (which auto-logs in) or the root account (which owns the x-server)? – Salim Fadhley Oct 1 '12 at 14:27
what does exec /etc/alternatives/x-session-manager do? When I take it out the bar at the bottom is gone. I'm curious about how it all fits together. A brief explanation would be appreciated. – Scoop Dec 21 '12 at 21:52
@Scoop It just starts lxde with session management. This allows you to boot up with applications from your previous session still running. If you remove it lxde will start from a blank slate, which is why there is no toolbar (it's not been started). – Jivings Dec 22 '12 at 10:16
Modifying: /etc/xdg/lxsession/LXDE/autostart as described here and modifying ~/.xinitrc + /etc/kbd/config as described from cwd did not get me any further. My screen still gets black with backlight. – Andi Giga Apr 14 at 12:21

I think @Jivings answer may be better, but I have it in my notes to do this:

  • Install apt-get install x11-xserver-utils

  • Edit /etc/xdg/lxsession/LXDE/autostart

Append these lines:

@xset s noblank
@xset s off
@xset -dpms

Possibly also comment out the line that says @xscreensaver -no-splash, so the complete file should look something like this:

@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
# @xscreensaver -no-splash

@xset s noblank
@xset s off
@xset -dpms

Also edit /etc/kbd/config and make sure these values are set as follows (however I believe this is only for when the lightweight desktop (LXDE) is not running (i.e. the pi is still in text / terminal mode):


I believe that the /etc/xdg/lxsession/LXDE/autostart may be the sort of system-wide version of ~/.xinitrc but someone else probably knows the nuances better.

share|improve this answer
Edits to /etc/kbd/config solved the problem for me. – Steve Dec 12 '14 at 16:47

protected by Jivings Oct 3 '12 at 22:56

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.