runboy93
Posts: 352
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: 19483
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

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

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Stretch.

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: 19483
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

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

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Stretch.

klricks
Posts: 6365
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: 19483
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

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

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Stretch.

klricks
Posts: 6365
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: 6365
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: 3
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: 142
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: 6365
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: 26
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.

Been trying to figure this out for over a year, I just cannot understand how to turn it off.

I don't need want to use time learning programming/script language/wodeva.

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

So it hangs on the wall until some bright spark comes along with the knowledge :-)

Edited to add;

Anyone have an update on this?

How to shut off screenblanking on a Rpi?
It ain't where you're from, it's where you're at.

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

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Mon Sep 24, 2018 3:08 pm

hela wrote:
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).
Amazing.

This is the only thing that works.

Thank you so much for sharing your knowledge without dazzling and blinding me with science and unintelligible programming language, thank you.
It ain't where you're from, it's where you're at.

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

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Mon Sep 24, 2018 5:14 pm

Glasshead wrote:
Mon Sep 24, 2018 3:08 pm
hela wrote:
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).
Amazing.

This is the only thing that works.

Thank you so much for sharing your knowledge without dazzling and blinding me with science and unintelligible programming language, thank you.
Although xscreenaver works it installs 40MB of stuff.
This method works and is easy to do:
https://www.raspberrypi.org/forums/view ... 4#p1350768
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

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

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Wed Sep 26, 2018 3:30 pm

klricks wrote:
Mon Sep 24, 2018 5:14 pm
Glasshead wrote:
Mon Sep 24, 2018 3:08 pm
hela wrote:
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).
Amazing.

This is the only thing that works.

Thank you so much for sharing your knowledge without dazzling and blinding me with science and unintelligible programming language, thank you.
Although xscreenaver works it installs 40MB of stuff.
This method works and is easy to do:
https://www.raspberrypi.org/forums/view ... 4#p1350768
Thank you so much for sharing your knowledge, much appreciated.

I don't have the ability to adjust any elaborate coding and to be quite honest I just can't bearsed; I just want the thing to do what I tell it to do otherwise it will be taking flying lessons and having actually explained that to the Rpi in real life, it obviously understands because it is doing as instructed.

However, even with a brain the size of a small planet, I do understand that there's them that's more enlightened than I are, particularly in regard to coding, not mushrooms I mean, and they would definitely benefit from the kindness of your shared knowledge.

I know from lifetime experience it's a painin thearse to figure this technique out so maybe if the mods or some such genius could make it a sticky it would be a great help to them such as I.

Thanks again for your help, may the hair on your toes grow long and curly.
It ain't where you're from, it's where you're at.

KoolDud3
Posts: 38
Joined: Thu Dec 20, 2018 5:07 pm

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Mon Dec 24, 2018 10:53 am

jwzumwalt wrote:
Mon Oct 07, 2013 5:55 am
I became very frustrated in my attempts to disable the screen saver. I finally found that there are two steps to this. The bash (shell) text terminal has its own blanking software, while the Xserver uses independant graphic settings.

To add to the frustration, many recommendations just don't work on the Raspbian version of Debian, or (as I found out) Raspbian used different files.

To view your Xsession screen saver setting, use this command (must be used from xterminal)
xset q

In brief, this is what must be done for Raspbian...
Disable text terminals from blanking
change two settings in /etc/kbd/config
BLANK_TIME=0
POWERDOWN_TIME=0

Disable Xsession from blanking
Additional info https://wiki.archlinux.org/index.php/Di ... _Signaling
Add these lines to /etc/xdg/lxsession/LXDE/autostart
@xset s noblank
@xset s off
@xset -dpms
UpDate: (Jan 27th, 20115) - I just received an email from "Dirk" saying the file location has changed...
The file changed from /etc/xdg/lxsession/LXDE/autostart -to- /etc/xdg/lxsession/LXDE-pi/autostart
If the file location has changed on the version you are using, the script will need to be edited

Here is a script that will permanently disable Xsession blanking
no_blank.sh

Code: Select all

#!/bin/bash

NOBLANK="
@xset s noblank
@xset s off
@xset -dpms
"

  # Pretty ANSI text colors
  OFF="\033[0m"
  BOLD="\033[1m"
  DIM="\033[2m"
  RED="\033[1;31m"
  GREEN="\033[1;32m"
  YELLOW="\033[1;33m"
  BLUE="\033[1;34m"

  clear
  printf "\n\n\t $YELLOW           "; date ; printf "$OFF"
  printf "\n $GREEN"
  printf "\t +------------------------------------------------+\n"
  printf "\t |                  no_blank.sh                   |\n"
  printf "\t |                rev Oct 1, 2013                 |\n"
  printf "\t |                                                |\n"
  printf "\t |  by: Jan Zumwalt - net-wrench.com              |\n"
  printf "\t |                                                |\n"
  printf "\t |  This script permanently disables the xsession |\n"
  printf "\t |  screen saver for RASPBIAN PI OS. It allows    |\n"
  printf "\t |  the user to abort before any change is made.  |\n"
  printf "\t +------------------------------------------------+$OFF\n\n"

  printf "\t This program will disable your xsession\n"
  printf "\t screen saver permanently, is this what \n"
  printf "\t you really want to do? $YELLOW<y/n>$OFF"; read -n 1 KEYIN

  if [[ $KEYIN == "N"  ||  $KEYIN == "n" ]]; then
    printf "\n\n\t OK, I quit and did not do anything.\n\n"
    exit 0
  fi

  printf "\n\n\t I intend to modify your current \n"
  printf "\t /etc/xdg/lxsession/LXDE/autostart \n"
  printf "\t I will add the$GREEN GREEN$OFF lines to the file...\n\n"

  printf "$DIM\n"
  pr -t -o 9 /etc/xdg/lxsession/LXDE/autostart
  printf "$OFF$GREEN$NOBLANK" | pr -t -o 9
  printf "$OFF\n\n" 

  printf "\t Is this really what you want to do? $YELLOW<y/n>$OFF"; read -n 1 KEYIN

  if [[ $KEYIN == "N"  ||  $KEYIN == "n" ]]; then
    printf "\n\n\t OK, I quit and did not do anything.\n\n"
    exit 0
  fi

  cat /etc/xdg/lxsession/LXDE/autostart > /etc/xdg/lxsession/LXDE/autostart.`date +%m-%d-%Y_%I:%M:%S`
  printf "\n\t Created backup copy of the autostart file...\n"
  printf "$NOBLANK" >> /etc/xdg/lxsession/LXDE/autostart

  printf "\t Your new file looks like this\n"
  printf "$DIM\n"
  pr -t -o 9 /etc/xdg/lxsession/LXDE/autostart
  printf "$OFF\n\n"

  printf "\t$RED Modified file. Screensaver is now disabled.$OFF\n"

  # required so xterm will not close
  printf "\n\t press any key to exit: "; read -n 1 KEYIN
  printf "\t$GREEN Program ended normaly $OFF\n\n"

For completeness here are the other methods that reportedly worked for other OS.

+-------------------------------------+
Stop Screen Blanking
1 & 2 work for the Raspbian
+------------------------------------+

1) Stop text terminals from blanking
change in /etc/kbd/config these two:
BLANK_TIME=0
POWERDOWN_TIME=0

2) Stop Xsession from blanking
Additional info https://wiki.archlinux.org/index.php/Di ... _Signaling
Add these lines to /etc/xdg/lxsession/LXDE/autostart
@xset s noblank
@xset s off
@xset -dpms
------------------------------------
A) Change your ~/.xinitrc or /etc/X11/xinit/xinitrc or /etc/xdg/lxsession/LXDE/autostart
NOTE: attempting to create a ~/.xinitrc and use in Raspbian crashed my Xserver
@xset s noblank
@xset s off
@xset -dpms

B) Change the /etc/lightdm/lightdm.conf and paste under the [SeatDefault]
xserver-command=X -s 0 dpms
"only effective if you boot straight into X using that particular display manager."

C) Use the xdotool to send a benign keyboard input to midori every ten minutes e.g. over crontab
...not a real solution, but it could work for my purpose.

D) Use a Display-Manager such as LXDE and run your browser there. User coolblue2000
had the same issue and finally went the way over a window manager, disabling the panel
(menu bar at the bottom) and setting the background picture to black - so you can't
see the whole LXDE. Here's a description:
http://pikiosk.tumblr.com/post/38721623 ... -static-ip
-- This will use more CPU - if anybody tries this, please leave a comment how much.
I'm really short of CPU, so I don't want to run an unnecessary windowmanager just to
prevent a screensaver... :(

E) Create a shell script disableblank.sh that runs the xset commands and add an entry
in .config/autostart/ calling that script. That way, everything is started with the
same method and either both work or neither works.
Just out of interest, can you change your screen saver?
I exist

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

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Mon Dec 24, 2018 2:05 pm

KoolDud3 wrote:
Mon Dec 24, 2018 10:53 am
.
...
Just out of interest, can you change your screen saver?
The default screen blanking cannot be changed only turned on or off or set to a different timeout duration.
Note that there are 2 screen blankers running. The commands below will turn them both off

Code: Select all

xset s off
xset -dpms
Example to set the blanking to 15 min. (default is 10 min.).

Code: Select all

xset s 900 
xset -dpms 
On boot the default settings will be restored....

So to make the settings permanent you must include the commands in autostart

Code: Select all

/home/pi/.config/lxsession/LXDE-pi/autostart
Note if autostart does not exist in the above location then use the one below:

Code: Select all

/etc/xdg/lxsession/LXDE-pi/autostart
If you want a graphic screensaver then you must install a package such as xscreensaver:
(40 MB)

Code: Select all

sudo apt update
sudo apt install xscreensaver
You cannot use the xset commands shown above if xscreensaver is installed.
xscreenaver has its own screen blanking function which can be used instead.
There are several addons in the repository which can be installed to add more screensaver graphics.
At least one of them allows you to use your own static images.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

Diana-emma
Posts: 1
Joined: Wed Dec 26, 2018 5:26 am
Contact: Website

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Wed Dec 26, 2018 6:03 am

thanks for the post. and the comments too somehow it helps me alot :)
My blogs:
https://surveyforcustomers.com/
https://krogerfeedbackreview.us/

HoboHaxor
Posts: 8
Joined: Fri May 25, 2018 5:58 pm

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Fri Feb 01, 2019 1:29 pm

And this thread is a perfect example to prove my theory:
The only reason linux hasn't won the desktop IS linux.

Why does linux break the one single reason to have a computer: to make life *easier*??

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22064
Joined: Sat Jul 30, 2011 7:41 pm

Re: STICKY: Howto: Disable Screen Saver In Raspbian

Tue Feb 26, 2019 3:26 pm

There is some official documentation here.

https://www.raspberrypi.org/documentati ... ensaver.md

If anyone finds that doesn't work, please indicate the problem by posting in this thread.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “Beginners”