backmailingbox
Posts: 76
Joined: Tue Jan 19, 2016 2:30 pm

disable screensaver

Thu Jan 21, 2016 7:58 pm

How to disable screensaver on official 7'' display and standard raspbian?

I am totally crazy about it

I did:

sudo nano /etc/kbd/config
BLANK_TIME=0 (Was 30)
POWERDOWN_TIME=0 (I think it was 15)

sudo nano /etc/xdg/lxsession/LXDE/autostart
@xset s noblank
@xset s off
@xset -dpms

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
@xset s noblank
@xset s off
@xset -dpms

sudo nano /etc/lightdm/lightdm.conf
xserver-command=X -s 0 -dpms


But no result. Is this really so complicated to do such stupid thing
like disable screen saver?

texy
Forum Moderator
Forum Moderator
Posts: 5174
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: disable screensaver

Fri Jan 22, 2016 1:37 pm

Try adding the following to the /boot/cmdline.txt file :
consoleblank=0

(make sure it is added to the existing line of text - do not add a new line)
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

jwatte
Posts: 203
Joined: Sat Aug 13, 2011 7:28 pm

Re: disable screensaver

Sun Feb 21, 2016 6:44 am

I applied this change and rebooted, but the display backlight still turns off after a few minutes.
(I'm booting into a logged-in X session.)

For what it's worth, when the display has gone to sleep, putting 0 or 1 into the bl_power control file does NOT turn it on.
I have to physically touch it to get backlight on again.

How can I control this auto-sleep behavior, and either turn it off entirely, or make it take a lot longer before it kicks in?

fruitoftheloom
Posts: 27225
Joined: Tue Mar 25, 2014 12:40 pm

Re: disable screensaver

Sun Feb 21, 2016 9:30 am

jwatte wrote:I applied this change and rebooted, but the display backlight still turns off after a few minutes.
(I'm booting into a logged-in X session.)

For what it's worth, when the display has gone to sleep, putting 0 or 1 into the bl_power control file does NOT turn it on.
I have to physically touch it to get backlight on again.

How can I control this auto-sleep behavior, and either turn it off entirely, or make it take a lot longer before it kicks in?
xscreensaver which has various options is in the repository ;)

https://www.jwz.org/xscreensaver
Take what I advise as advice not the utopian holy grail, and it is gratis !!

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: disable screensaver

Sun Feb 21, 2016 10:29 am

sudo nano /etc/kbd/config
BLANK_TIME=0 (Was 30)
POWERDOWN_TIME=0 (I think it was 15)
That method only works for the console, it won't stop desktop blanking
sudo nano /etc/xdg/lxsession/LXDE/autostart
@xset s noblank
@xset s off
@xset -dpms
That method is outdated, it hasn't used the /LXDE/ directory in quite a while.
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
@xset s noblank
@xset s off
@xset -dpms
That's the global autostart, that won't work with Jessie since Jessie now provides a user autostart at "~/,config/lxsession/LXDE-pi/autostart", which takes precedence over the global autostart. So make changes in the user autostart instead.
sudo nano /etc/lightdm/lightdm.conf
xserver-command=X -s 0 -dpms
That one works and is the method I use. But you have to add the line under the section "[SeatDefaults]" for it to work.
Is this really so complicated to do such stupid thing
The first method is console only, the next two methods didn't work because they're outdated, but obviously still out there on the internet. When looking for info on the web, for how to do something, always check to see how current it is. If it's a year or a few old and it doesn't work then it's probably outdated info.

The last method works, and you hit the target, but didn't quite hit the bullseye. :D

jwatte
Posts: 203
Joined: Sat Aug 13, 2011 7:28 pm

Re: disable screensaver

Mon Feb 22, 2016 6:38 am

"Jessie now provides a user autostart at "~/,config/lxsession/LXDE-pi/autostart", which takes precedence over the global autostart."

That's what I read in documentation, too, but I couldn't get it to work.
Editing the global file did work. (This also let me remove pcmanfm and lxpanel)

BTW, when using the /LXDE-pi/ directory, why does raspbian also ship /LXDE/? That's quite confusing.

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: disable screensaver

Mon Feb 22, 2016 3:49 pm

Probably to provide some backward compatibility if a package requires it. Looking into this version of Raspbian Jessie which was a fresh install, not an upgrade, using a Raspian image (no NOOBS).

Code: Select all

uname -a
Linux rpi3 4.1.17+ #838 Tue Feb 9 12:57:10 GMT 2016 armv6l GNU/Linux
In "/etc/xdg/lxsession" I have both "/LXDE/" and "/LXDE-pi/" directories. However, the /LXDE/ directory is dated 9-24-2015, and the autostart file inside is even older with a date of 10-25-2014. But since Jessie creates a users autostart it's not using either of those anyway, so it doesn't matter.

If you have a user autostart at "~/.config/lxsession/LXDE-pi/autostart" that should take precedence over the global. If the global you edited was using "/LXDE-pi/" that would seem to indicate there is something wrong with the user autostart, permissions, etc, and it can't use it, so it defaults back to the global configuration.

deanbayley
Posts: 3
Joined: Sat Mar 05, 2016 11:27 pm

Re: disable screensaver

Sat Mar 05, 2016 11:34 pm

I have followed these steps and the screen blanks exactly 10 mins after startup.

I am loading a java application using

/etc/rc.local

Code: Select all

su -s /bin/bash -c startx pi&
/home/pi/.xinitrc

Code: Select all

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

python /home/pi/soft_shutdown.py

/home/pi/startts.sh

Guessing something is overriding the default settings due to the way i'm starting it?

Spent 5-6 hours tearing my hair out over this.

Dean.

User avatar
GTR2Fan
Posts: 1968
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: disable screensaver

Sat Mar 05, 2016 11:59 pm

This is the only method out of the umpty-billion listed above that has ever worked for me in Raspbian Jessie...

viewtopic.php?p=910245#p910245
Pi4B 2GB Rev1.4 Mini-PC/Media Centre: ARM=2.25GHz @1.1v, Core=600MHz, GPU=850MHz. Raspberry Pi OS with KODI on 128GB Sandisk Extreme Pro A2 microSD card in Integral card reader in USB3.0 port (138MB/s read). Geekworm P173 case with copper shim on SOC.

deanbayley
Posts: 3
Joined: Sat Mar 05, 2016 11:27 pm

Re: disable screensaver

Sun Mar 06, 2016 12:07 am

Just after posting this i tried something else as i noticed an error message saying xset couldn't be found, i changed the:

/etc/.xinitrc

Code: Select all

sudo /usr/bin/xset s off
sudo /usr/bin/xset -dpms
sudo /usr/bin/xset s noblank

and the display has been on ever since!!

Going to power down and back on and leave overnight..

deanbayley
Posts: 3
Joined: Sat Mar 05, 2016 11:27 pm

Re: disable screensaver

Sun Mar 06, 2016 10:38 am

Woke up this morning and its still on!

Return to “Official Display”