runboy93
Posts: 335
Joined: Tue Feb 28, 2017 1:17 pm
Location: Finland
Contact: Website

Re: Howto: Disable Screen Saver In Raspbian

Thu Jun 29, 2017 9:37 pm

bettersweeps wrote:After days of also dealing with this problem i have finally figured it out, so far the commands listed here will only disable it if you remember to use the bash command you design, or just put it into a loop. Here´s a 1 step fix and explanation as to why the first part has failed to work, first the code.

Code: Select all

xserver-command=X -s 0 -dpms
the reason this hasn´t always worked is because the command has 2 parts to it, the first 1 you see in the lightdm.conf file is merely a trigger, moving further down you will find a second part same print smaller description. The first one is located under Seat Defaults, the second is located under [seatdefalts] both xserver-command=X commands need to written exactly as

Code: Select all

xserver-command=X -s 0 -dpms
for it to work. This doesn´t matter what you run your pi as, this will guarentee to disable the screen saver aka blanking aka idle mode, your screen will never blank, blink, pause, its not a loop hole. this is the real deal fix to the screen saver without needing any apps, and or mods.
Thanks!

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

Re: Howto: Disable Screen Saver In Raspbian

Thu Jun 29, 2017 9:40 pm

adeel88 wrote:
klricks wrote:
adeel88 wrote:...Thanks for your prompt reply. Yes. It worked. Can I add my custom screensaver using 'xscreensaver'?
Yes but you have to install some more addons to xscreenaver.
See this thread: viewtopic.php?f=63&t=185313

Thanks. Sorry, one last thing can I add a simple black screen when user don't use the raspberry-pi or after specific idle time and when user tap on that it will show the last/original state of raspberry-pi?
I was under the impression that one of the screensaver modes is "blank screen only" ??
Adieu

adeel88
Posts: 7
Joined: Fri Mar 17, 2017 11:03 am

Re: Howto: Disable Screen Saver In Raspbian

Fri Jun 30, 2017 10:26 am

After 2 hours of idle time my raspberry-pi turned off. I don't want to turn-off raspberry-pi even its idle for many hours. I just want a BLACK screen and whenever I tap it shows me Raspberry-pi original state. Can someone help me regarding this?

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

Re: Howto: Disable Screen Saver In Raspbian

Fri Jun 30, 2017 11:27 am

adeel88 wrote:After 2 hours of idle time my raspberry-pi turned off. I don't want to turn-off raspberry-pi even its idle for many hours. I just want a BLACK screen and whenever I tap it shows me Raspberry-pi original state. Can someone help me regarding this?
xscreensaver has many options including power management, you appear to not have understood the configuration parameters:

https://www.jwz.org/xscreensaver/faq.html
Adieu

klricks
Posts: 5774
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Howto: Disable Screen Saver In Raspbian

Fri Jun 30, 2017 1:13 pm

adeel88 wrote:After 2 hours of idle time my raspberry-pi turned off. I don't want to turn-off raspberry-pi even its idle for many hours.
The screensaver program cannot do that. The RPi was turned off by some other reason / person.
adeel88 wrote: I just want a BLACK screen and whenever I tap it shows me Raspberry-pi original state. Can someone help me regarding this?
From the default screen [Display Modes] tab..... Click the pull down menu next to [Mode:] and choose [Blank Screen Only].

Choose how many minutes to blank......

When the mouse is moved or a key is pressed the original live screen is restored as with all screen savers.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

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

Re: Howto: Disable Screen Saver In Raspbian

Fri Jun 30, 2017 3:33 pm

klricks wrote:
adeel88 wrote:After 2 hours of idle time my raspberry-pi turned off. I don't want to turn-off raspberry-pi even its idle for many hours.
The screensaver program cannot do that. The RPi was turned off by some other reason / person.
xscreensaver has a power management option under "Advanced"
Adieu

klricks
Posts: 5774
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Howto: Disable Screen Saver In Raspbian

Fri Jun 30, 2017 5:05 pm

fruitoftheloom wrote:
klricks wrote:
adeel88 wrote:After 2 hours of idle time my raspberry-pi turned off. I don't want to turn-off raspberry-pi even its idle for many hours.
The screensaver program cannot do that. The RPi was turned off by some other reason / person.
xscreensaver has a power management option under "Advanced"
Yes but settings there do not work on a RPi. The RPi has no powersave or hibernate functions.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

adeel88
Posts: 7
Joined: Fri Mar 17, 2017 11:03 am

Re: Howto: Disable Screen Saver In Raspbian

Wed Jul 05, 2017 10:03 pm

Hi,

I am using xscreensaver that shows a screensaver after certain idle time period which is fine. What I want another thing is to always remain the raspberry-pi TURN-ON, like what happened now is after 10 minutes screensaver shows which is good but after 4-5 hrs(approx) elapsed my raspberry-pi turn-off/shutdown then I again plug-in the cable and start pi again.

What I want is even when I come next day the screensaver shows (random/black) whatever BUT the raspberry-pi wouldn't turn off. When I tap on that it showed the last state. Can someone guide me?

paulsimmons
Posts: 1
Joined: Tue Aug 29, 2017 10:14 am
Location: Austin, Texas, USA
Contact: Website

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Tue Aug 29, 2017 10:26 am

I have followed the steps but still having issue to disable the screen saver in Raspbian. Any help would be appreciated.

klricks
Posts: 5774
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Tue Aug 29, 2017 5:15 pm

paulsimmons wrote:
Tue Aug 29, 2017 10:26 am
I have followed the steps but still having issue to disable the screen saver in Raspbian. Any help would be appreciated.
What steps? What issues?

Try adding the following 3 lines to autostart:

Code: Select all

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

Code: Select all

nano /home/pi/.config/lxsession/LXDE-pi/autostart
OR
Install xscreensaver and set mode to [no blanking]

Code: Select all

sudo apt-get update
sudo apt-get install xscreensaver
Last edited by klricks on Sat Jun 09, 2018 3:28 am, edited 1 time in total.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

BlackPian0
Posts: 1
Joined: Sat Sep 23, 2017 4:04 pm

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Sat Sep 23, 2017 4:07 pm

# Raspbian Jessie
Add the following line to /etc/rc.local (on the line before the final exit 0)
$ sudo sh -c "TERM=linux setterm -blank 0 >/dev/tty0"


# Raspbian Wheezy
You can disable this by editing /etc/kbd/config and looking for
BLANK_TIME=30

and setting the blank time to 0 (which turns it off)
BLANK_TIME=0

RaspberryPiGuy1971
Posts: 5
Joined: Sat Sep 30, 2017 7:06 pm

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Sat Sep 30, 2017 7:48 pm

paulsimmons wrote:
Tue Aug 29, 2017 10:26 am
I have followed the steps but still having issue to disable the screen saver in Raspbian. Any help would be appreciated.
Have you installed xscreensaver?

george4896
Posts: 1
Joined: Mon Jan 01, 2018 4:52 pm
Contact: Website

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Mon Jan 01, 2018 4:55 pm

Thanks for the guide that was helpful.

hela
Posts: 2
Joined: Fri Mar 09, 2018 10:24 am

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Fri Mar 09, 2018 10:57 am

After a while of trial and error - lots of trial ... even more error ;-) - I found the solution to install XScreenSaver with

Code: Select all

sudo apt-get install xscreensaver
an deactivate it afterwards in preferences most convenient.

However, I skipped

Code: Select all

sudo apt-get update
as my system seemed to be quite actual (official Raspberry Pi Kit).

Originally my autostart had a line #@xscreensaver -no-splash.
But obviously you have to start XScreensaver first so it can deactivate the screen blanking :P

Not other settings in the autostart regarding screen blanking seem to be neccesary (... so far).

User avatar
billybangleballs
Posts: 125
Joined: Fri May 18, 2012 11:28 pm

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Wed Mar 21, 2018 4:54 pm

In 2018-03-13-raspbian-stretch the only thing that worked was to install xscreensaver and loads of other rubbish and then turn it off.

Other rubbish.

Code: Select all

The following additional packages will be installed:
  gnome-mime-data libart-2.0-2 libauthen-sasl-perl libbonobo2-0 libbonobo2-common libbonoboui2-0 
  libbonoboui2-common libencode-locale-perl libfile-listing-perl libfont-afm-perl libgail-common 
  libgail18 libglade2-0 libgnome-2-0 libgnome2-common libgnomecanvas2-0 libgnomecanvas2-common 
  libgnomeui-0 libgnomeui-common libgnomevfs2-0 libgnomevfs2-common libgnomevfs2-extra 
  libhtml-form-perl libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl 
  libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl 
  libio-html-perl libio-socket-ssl-perl libjpeg-turbo-progs liblwp-mediatypes-perl liblwp-protocol-https-perl 
  libmailtools-perl libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl liborbit-2-0 libtimedate-perl 
  libturbojpeg0 liburi-perl libwww-perl libwww-robotrules-perl miscfiles perl-openssl-defaults xscreensaver-data
If I wanted a screensaver, I'm sure I wouldn't mind the 40Mb of extra space, but it seems a bit excessive just to be able to not have one.

Why is the screen blanking enabled by default in the first place?

klricks
Posts: 5774
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Sat Jun 09, 2018 4:07 am

I made the bash script below which you can use to change the blanking timeout -OR- disable blanking altogether.
Note: Only works if booted to desktop (GUI).

Code: Select all

#!/bin/bash
# Script name: blankit
# Uses xset s command to disable OR enable and set timeout seconds
# Also turns DPMS on or off but does not change DPMS timeouts.
# This program will add commands to autostart if make permanent is chosen.
# Valid blanking seconds 1-32767 (0 is same as off)
# For Raspbian Desktop GUI user pi. Does not do anything for CLI
# Use xset q to verify settings.

AUTO=/home/pi/.config/lxsession/LXDE-pi/autostart

echo -e "\e[1m"    # bold text on

read -p "Enable Screen Blanking (Y/N): Y " A1

if [ "$A1" == "" ]  # If Enter only is pressed then assume Y
then
  A1="y"
fi

if [ $A1 == 'y' ] || [ $A1 == 'Y' ]
then

   read -p "Enter blanking time in seconds (1-32767): " blank_time
       if ! [ "$blank_time" -eq "$blank_time" ] 2> /dev/null
       then
       echo -e "Invalid entry\n"  # entry was NAN
       blank_time=0   # force 0 if NAN or only [Enter]
       fi
   if [ $blank_time -ge 32768 ]
   then
       blank_time=32767 #force max if > max
       echo -e "Max time to blank is 32767 seconds...\n"
   fi
   xset s on      # This also sets timeouts back to default (600) so must be before other commands.
   xset s $blank_time
   xset s blank
   xset +dpms    # Also sets expose to Yes

   min=$(expr $blank_time / 60)
   sec=$(expr $blank_time % 60)
   echo -e "Screen blanking set to "$blank_time" sec. ("$min" min. "$sec" sec.)...\n"
else
 
   xset s noblank
   xset s noexpose
   xset -dpms
   echo -e "Screen blanking is off...\n"

fi

read -p "Make Permanent? Y/N: N " A2  # y = write commands to autostart

if [ "$A2" == "" ]  # If Enter only is pressed then assume N
then
   A2='n'
fi

if [ $A2 == 'y' ] || [ $A2 == 'Y' ]
then
    sed -i -e  '/@xset/d' $AUTO  # Delete any old @xset commands from autostart
    sed -i -e '$a\' $AUTO        # Make sure last line has \n
    echo -e "\nThe commands below have been added to:\n\n"$AUTO"\n"

    printf "#########  @xset commands added by 'blankit' script #########\n" | tee -a $AUTO

       if [ $A1 == 'y' ] || [ $A1 == 'Y' ]
       then
          # Use tee to Write each command to file and screen at same time.
          printf "@xset s on\n"  | tee -a $AUTO
          printf "@xset s blank\n" | tee -a $AUTO
          printf "@xset +dpms\n"  | tee -a $AUTO
          printf "@xset s "$blank_time"\n" | tee -a $AUTO
       else

          printf "@xset s noblank\n"  | tee -a $AUTO
          printf "@xset s noexpose\n" | tee -a $AUTO
          printf "@xset s off\n"  | tee -a $AUTO
          printf "@xset s -dpms\n"  | tee -a $AUTO
       fi
fi
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

Glasshead
Posts: 23
Joined: Thu Jan 19, 2017 2:56 am
Location: Belize

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Wed Jun 20, 2018 4:41 pm

<r><QUOTE author="billybangleballs" post_id="1289919" time="1521651283" user_id="17967"><s>
billybangleballs wrote:
Wed Mar 21, 2018 4:54 pm
</s>
Why is the screen blanking enabled by default in the first place?
<e>
</e></QUOTE>

My sentiments entirely.<br/>
<br/>
Been trying to figure this out for over a year, I just cannot understand how to turn it off.<br/>
<br/>
I don't need want to use time learning programming/script language/wodeva.<br/>
<br/>
I just want to leave the blooming screen on to use use it as a slideshow. That's the reason I got the Rpi in the first place; just to view a slideshow of our pictures, not be stuck in front of a screen for hours! lol<br/>
<br/>
So it hangs on the wall until some bright spark comes along with the knowledge because really and truly, I just can't bearsed.</r>
It ain't where you're from, it's where you're at.

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 62 guests