How do I prevent the screen from going blank?
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_TIMEto zero in
This is an
Firstly, you may need to install
xset, a lightweight application that controls some
apt-get install x11-xserver-utils
Now open up your
~/.xinitrcfile (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
Xstarts and should solve the problem. I copy and pasted it from my own
.xinitrcand can confirm that my screen does not blank.
Which account should the .xinitrc be created for? The pi account (which auto-logs in) or the root account (which owns the x-server)?
I created it for the pi account and it works OK! Thank you all.
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 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).
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.
This doesn't work in the Debian Jessie (8) that I run with parallels VM in a MacBook Pro.
Just wanted to say that this worked for me on Pi 3 with the Lite image of Raspbian and `nodm` as the display manager. Only difference is that in my case the commands had to be put in the `~/.xsession`. I think the reason this solution doesn't appear to work for most people is related to `lightdm` specifically which is what most use.
The other solutions here did not work for me (fresh Raspbian, boot to GUI). Instead, this worked:
- Open up
/etc/lightdm/lightdm.confusing your favorite text editor (I prefer
- Look for the line
#xserver-command=X. Change it to
xserver-command=X -s 0 dpms
- It should be at line 87 if things don't change.
- Save and reboot.
I'm trying to understand these options. `-s 0` sets the screen timeout to 0 minutes, which I assume makes it 'never'. (Is this different from `-s off`?) Why `dpms`, though, not `-dpms`? Don't I want to _disable_ display power management services?
@TheGuywithTheHat Have you tried this solution with `-dpms`? Please report back and maybe we can infer what's going on.
@pandalion98 Testing it right now with `dpms`, `-dpms`, and neither. Will report back soon.
I realized I'm not on a Pi here, so I don't know how general this is. That being said, `-s 0` appears to be all that's necessary on my system. Neither `dpms` nor `-dpms` appeared to have any effect.
This also worked for me on my Raspberry Pi 3. Line number to change though was 91 now.
Using `-dpms` disables DPMS, while `+dpms` enables it. Using just `dpms` also enables it, in practice, though "man xset" says it can be followed by up to three numbers (to set standby/suspend/off timeouts), or other options such as "force on" or "suspend". See "man xset" for details. FYI, with a Pi 3 and a Raspbian lite (Stretch/9.4) install to which I then added the GUI stuff, this answer worked for me, when using `-dpms`.
- Open up
I think @Jivings answer may be better, but I have it in my notes to do this:
apt-get install x11-xserver-utils
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
/etc/kbd/configand 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
piis still in text / terminal mode):
BLANK_TIME=0 BLANK_DPMS=off POWERDOWN_TIME=0
I believe that the
/etc/xdg/lxsession/LXDE/autostartmay be the sort of system-wide version of
~/.xinitrcbut someone else probably knows the nuances better.
I applied all the changes mentioned in this answer. This certainly didn't work on my Raspberry PI 2 Model B running Raspbian Jessie.
I think there has been some change with profiles by default, the autostart you need to edit might be `~/.config/lxprofile/LXDE-pi/autostart`.
To prevent the screen from going blank try adding
consoleblank=0to the end of the first line of
It was a very difficult answer to find and figured it applied. Why not vote for this to be a duplicate question instead of commenting?
I voted for the original question to be marked as duplicate of this one. Keeping either of the answers sounds fine, but I suppose you prefer to have the one that got upvoted.
I wouldn't want my answer to only be on the duplicate, I would want it on the master of the two - even if I found the other question first. Which is why i suggested you vote instead of comment
What worked for me was editing
~/.config/lxsession/LXDE-pi/autostartand commenting out the screensaver, all the other
xsetcommands didn't seem to affect it when it is started here:
@lxpanel --profile LXDE-pi @pcmanfm --desktop --profile LXDE-pi #@xscreensaver -no-splash
You might also need to add one or both of these lines to disable the power management:
@xset dpms 0 0 0 @xset -dpms
On the version of Raspbian Jessie I got the utils were already installed.