How to disable screen blanking
Hi,
I have tried to stop the terminal from blanking out.
sudo nano /etc/rc.local and added
setterm -blank 0
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
Nothing seems to work - Even after reboot.
Any suggestions would be appreciated - its starting to drive me crazy.
Best wishes.
James.
I have tried to stop the terminal from blanking out.
sudo nano /etc/rc.local and added
setterm -blank 0
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
Nothing seems to work - Even after reboot.
Any suggestions would be appreciated - its starting to drive me crazy.
Best wishes.
James.
Re: How to disable screen blanking
Hi,
I think I have figured it out.
However I'm a newbie so you may want to double check - But it works for me.
sudo nano /etc/kbd/config
Change these two lines.
# screen blanking timeout. monitor remains on, but the screen is cleared to
# range: 0-60 min (0==never) kernels I've looked at default to 10 minutes.
# (see linux/drivers/char/console.c)
BLANK_TIME=0 (Was 30)
# Powerdown time. The console will go to DPMS Off mode POWERDOWN_TIME
# minutes _after_ blanking. (POWERDOWN_TIME + BLANK_TIME after the last input)
POWERDOWN_TIME=0 (I think it was 15)
Re start the file or just reboot
sudo /etc/init.d/kbd restart
Monitor has now been on for over 2 hrs - so looking good.
Hope it helps some one.
Best wishes.
James.
I think I have figured it out.
However I'm a newbie so you may want to double check - But it works for me.
sudo nano /etc/kbd/config
Change these two lines.
# screen blanking timeout. monitor remains on, but the screen is cleared to
# range: 0-60 min (0==never) kernels I've looked at default to 10 minutes.
# (see linux/drivers/char/console.c)
BLANK_TIME=0 (Was 30)
# Powerdown time. The console will go to DPMS Off mode POWERDOWN_TIME
# minutes _after_ blanking. (POWERDOWN_TIME + BLANK_TIME after the last input)
POWERDOWN_TIME=0 (I think it was 15)
Re start the file or just reboot
sudo /etc/init.d/kbd restart
Monitor has now been on for over 2 hrs - so looking good.
Hope it helps some one.
Best wishes.
James.
Re: How to disable screen blanking
Tried Foggy's way, and it did not work for me.
I found another solution elsewhere in these forums and it works for me:
sudo nano /etc/lightdm/lightdm.conf
In that file, look for:
[SeatDefault]
and insert this line:
xserver-command=X -s 0 dpms
My test monitor has been on for a couple of days now
I found another solution elsewhere in these forums and it works for me:
sudo nano /etc/lightdm/lightdm.conf
In that file, look for:
[SeatDefault]
and insert this line:
xserver-command=X -s 0 dpms
My test monitor has been on for a couple of days now

Re: How to disable screen blanking
This is a great solution for me, thanks. The app I'm running outputs log messages to the console, so I often just plug in a HDMI screen to see the status of the application on the RPi, but I don't connect a keyboard to it.
I just set those two lines to 0 (BLANK_TIME and POWERDOWN_TIME) and this worked great.
I am running Debian Wheezy (soft-float).
I just set those two lines to 0 (BLANK_TIME and POWERDOWN_TIME) and this worked great.
I am running Debian Wheezy (soft-float).
-
- Posts: 3
- Joined: Wed Nov 14, 2012 3:59 pm
Re: How to disable screen blanking
Neither fix is working for me, Pi still blanks after 15 mins. Need a system that is always on screen wise.
Frosty
Frosty
Re: How to disable screen blanking
the kbd version will stop all console screen blanksSmokyFrosty wrote:Neither fix is working for me, Pi still blanks after 15 mins. Need a system that is always on screen wise.
Frosty
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe
WARNING - some parts of this post may be erroneous YMMV
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe
Re: How to disable screen blanking
Putting it another way, kbd will only stop the kernel from blanking the screen when X is not running.RaTTuS wrote:the kbd version will stop all console screen blanks
And lightdm.conf is only effective if you boot straight into X using that particular display manager.
And .xinitrc only works after you log in and run "startx" (or use a display manager that defaults to a user session, and allows .xinitrc instead of .xsession).
So you might need all three. And if you run full-screen non-X programs like XBMC you may need to configure them not to blank as well.
Re: How to disable screen blanking
So it is not possible at all with the default display manager? (There is no .xinitrc file in the home directory.)
Re: How to disable screen blanking
Is there no way to fix this? I'm sorry I'm not a linux programmer, but it seems ridiculous that there isn't a fix to keep the frikin screen from turning off.
Re: How to disable screen blanking
Only way I've been able to fix this issue is install xscreensaver. To install you need "sudo apt-get install xscreensaver" . In the gui you will now have the "screensaver" option under preferences. Here you can disable the blank screen. Let me know if this makes sense and helps!
Re: How to disable screen blanking
Installing xscreensaver worked on me too ...Thanks
Re: How to disable screen blanking
Found this thread as I was having the same blank screening issues ever since I enabled the PI to boot automatically, xscreensaver did the trick ! Many thanks for sharing your post tleland 

Re: How to disable screen blanking
Glad i was able to help.
Re: How to disable screen blanking
For me it worked by editing /etc/X11/xinit/xserverrc and changing
by
I'm using Raspbian “wheezy” and I start my X session with startx.
Code: Select all
exec /usr/bin/X -nolisten tcp "$@"
Code: Select all
exec /usr/bin/X -s 0 dpms -nolisten tcp "$@"
- DetlevSchm
- Posts: 76
- Joined: Tue Mar 12, 2013 8:43 am
- Location: 3rd planet
Re: How to disable screen blanking
And another one:
I have a non-pygame Python script running in the background, that displays every five minutes some stuff on the desktop.
That alone is not sufficient, but after I put
in the loop, the screen refrains from blanking.
Needs initial
I have a non-pygame Python script running in the background, that displays every five minutes some stuff on the desktop.
That alone is not sufficient, but after I put
Code: Select all
pygame.event.get()
Needs initial
Code: Select all
import pygame
pygame.init()
-
- Posts: 2
- Joined: Sat May 25, 2013 10:54 am
Re: How to disable screen blanking
I got fed up with all the different options and just wrote a script to kill the screen saver process should it be running;
1 create a file /home/pi/killScreenSaver.sh
#/bin/bash
PID=`ps -ef | grep 'xscreensaver -no-splash' | grep -v "grep" | cut -c 3-14 | sed 's| ||g'`
kill $PID
exit 0
2 Set the file to executable (chmod +x /home/pi/killScreenSaver.sh)
3 Make the file run automatically every minute in cron by executing crontab -e and entering
* * * * * /home/pi/killOffScreensaver.sh > /dev/null
Very hacky and might not be safe but was quick and simple for me. For an explanation;
It prints the process tree (ps -ef), takes only lines with the phrase 'xscreensaver -no-splash' in (grep 'xscreensaver -no-splash'), then removes lines with the word grep in (as the grep process itself will appear), then takes characters 3-14 that contain the ID of the process (cut -c 3-14), then removes all white space using sed, then issues the kill command on the process ID).
1 create a file /home/pi/killScreenSaver.sh
#/bin/bash
PID=`ps -ef | grep 'xscreensaver -no-splash' | grep -v "grep" | cut -c 3-14 | sed 's| ||g'`
kill $PID
exit 0
2 Set the file to executable (chmod +x /home/pi/killScreenSaver.sh)
3 Make the file run automatically every minute in cron by executing crontab -e and entering
* * * * * /home/pi/killOffScreensaver.sh > /dev/null
Very hacky and might not be safe but was quick and simple for me. For an explanation;
It prints the process tree (ps -ef), takes only lines with the phrase 'xscreensaver -no-splash' in (grep 'xscreensaver -no-splash'), then removes lines with the word grep in (as the grep process itself will appear), then takes characters 3-14 that contain the ID of the process (cut -c 3-14), then removes all white space using sed, then issues the kill command on the process ID).
Re: How to disable screen blanking
that's not going to work because xscreensaver is not installed by default.
Antikythera
Re: How to disable screen blanking
I finally had success disabling blanking with the default Raspbian installation. The xset program is not installed by default, so I did the "sudo apt-get install x11-xserver-utils". I tested using the "xset q" command. To disable the screen blanking with the default LXDE, edit the file:
/etc/xdg/lxsession/LXDE/autostart
comment out a xscreensaver command, and add these xset lines
More info at: http://www.raspberrypi.org/phpBB3/viewt ... 91&t=57552
/etc/xdg/lxsession/LXDE/autostart
comment out a xscreensaver command, and add these xset lines
Code: Select all
#@xscreensaver -no-splash
@xset s off
@xset -dpms
@xset s noblank
Re: How to disable screen blanking
by Rasadmin worked for me 
sudo nano /etc/lightdm/lightdm.conf
In that file, look for:
[SeatDefault]
and insert this line:
xserver-command=X -s 0 dpms
My test monitor has been on for a couple of days now

sudo nano /etc/lightdm/lightdm.conf
In that file, look for:
[SeatDefault]
and insert this line:
xserver-command=X -s 0 dpms
My test monitor has been on for a couple of days now

-
- Posts: 17
- Joined: Thu Jul 31, 2014 11:27 pm
Re: How to disable screen blanking
About 2 years ago Rasadmin may well have posted THE answer for your system. However, I vote for carlhage, because that solution worked for my late model Raspbian system (uname -r says '3.12.22+' with LXDE display manager). Don't put magic xset commands in /etc/rc.local as advised elsewhere. Use the magic @xset commands where carlhage says.
You know you got it licked when your first terminal command after start up:
xset q
says:
prefer blanking: no allow exposures: yes
timeout: 0 cycle: nnn (600 in my case)
and:
DPMS is Disabled
You know you got it licked when your first terminal command after start up:
xset q
says:
prefer blanking: no allow exposures: yes
timeout: 0 cycle: nnn (600 in my case)
and:
DPMS is Disabled
Re: How to disable screen blanking
Re tleland's post from 2013 about installing xscreensaver in order to be able to disable screen blanking from the GUI rather than from the command line:
- I installed xscreensaver and rebooted my Pi.
- When I restart the GUI, I still don't have a screensaver option in the GUI under Preferences.
Is there more to using xscreensaver than simply installing it by typing sudo apt-get install xscreensaver and rebooting?
Thanks,
Neil
- I installed xscreensaver and rebooted my Pi.
- When I restart the GUI, I still don't have a screensaver option in the GUI under Preferences.
Is there more to using xscreensaver than simply installing it by typing sudo apt-get install xscreensaver and rebooting?
Thanks,
Neil
Re: How to disable screen blanking
I am curious as to where all these obscure commands come from? Linux seems just so over whelming surely there must be documentation somewhere that explains these issues. I have tried the lightdm.conf , kdb and none of them have worked, The TV display blanks out after 10 mins. I start the GUI display which I assume is the X server via startx. It looks like the chap from France might have the fix for this.
Cheers Alan
Cheers Alan
Re: How to disable screen blanking
Worked for mine...well I had all the other all ready in.sudo nano /etc/lightdm/lightdm.conf
In that file, look for:
[SeatDefault]
and insert this line:
xserver-command=X -s 0 dpms
Re: How to disable screen blanking
NeilEric wrote:Re tleland's post from 2013 about installing xscreensaver in order to be able to disable screen blanking from the GUI rather than from the command line:
- I installed xscreensaver and rebooted my Pi.
- When I restart the GUI, I still don't have a screensaver option in the GUI under Preferences.
Is there more to using xscreensaver than simply installing it by typing sudo apt-get install xscreensaver and rebooting?
Thanks,
Neil
I installed xscreensaver and it shows up in preferences as Screensaver. (Assuming the latest version of Raspbian installed)
If you can't find that then go to xterminal and run:
Code: Select all
xscreensaver-demo
In the [Display Mode] tab, set like this - Mode: [Disable Screen Saver]
3B+ & 4B4G Running RPi OS Bookworm w/ Desktop