Raspbian Screensaver

10 posts
by Ann3x » Sun Sep 23, 2012 9:43 am
Hi Everyone,

I'm building a digital photoframe based on an RPi to pull from a flickr account (build log will come once I have it working) but having some issues with settin up my Pi (mainly due to my lack of linux skills I think).

Hoping I can get some advice :), it seems such a basic issue that I expect I'm missing something fundamental. This is where I'm at:

  • Hardware built and running
  • Pi running at correct resolution and screen mode
  • Raspbian installed and update and configured to boot to desktop
  • Wirelss networking configured with putty and VNC remote access
and this is what I have left to do:

The annoying thing I'm stuck at is the seemingly simple task of disabling the screensaver!! I've read countless items on how to do this and have a script (named screensaveroff) working which looks like:
Code: Select all
#! /bin/bash

# /etc/init.d/screensaveroff

xset s off
xset -dpms
xset s noblank

This script is owned by root and is executable. When I run it manually from terminal xset -q shows that the script has executed sucessfully and options are set. The issue is that try as I might I cannot get it to execute at boot/login. Ive tried the following (from various guides):

  • Calling my script from /etc/rc.local using the line:
    Code: Select all
    su -c "/etc/init.d/screensaveroff"
  • Running the code from my screensaveroff script directly from /etc/rc.local
  • Running screensaveroff using cron every one second (a messy way but just a test).
  • Running screensaveroff using cron @reboot command
  • Running screensaveroff via a call from .xinitrc (created in my home dir) as:
    Code: Select all
    xset s off
    xset -dpms
    xset s noblank

    exec /etc/alternatives/x-session-manager

None of these has any effect. Unless I run my script manually, screensaver options are still at default. To be honest, I'm getting really frustrated now, really how hard should it be to turn a screensaver off? Can anyone help? What's going wrong?


Posts: 5
Joined: Sun Sep 23, 2012 9:20 am
by Ann3x » Sun Sep 23, 2012 4:40 pm
I forgot, also tried adding the script to startup using:

Code: Select all
sudo update-rc.d screensaveroff defaults
Posts: 5
Joined: Sun Sep 23, 2012 9:20 am
by Foggy » Sun Sep 23, 2012 6:25 pm

Please look at


Best wishes.

Posts: 18
Joined: Mon Aug 20, 2012 12:26 pm
Location: Reading UK
by Ann3x » Sun Sep 23, 2012 8:00 pm
Hi James,

Thanks for the tip but, this doesn't seem to do anything on my install. Isnt it just changing the console screen options (ie not the desktop)?

Unfortunately my screen blanks as per normal :(.

Posts: 5
Joined: Sun Sep 23, 2012 9:20 am
by Ann3x » Mon Sep 24, 2012 2:13 pm
Really, noone else has had issues with running scripts automatically?

Ive checked the cron output and the echo is there, so the script *may* be running. Perhaps its permissions? Ive set owner to root and I though startup scripts (from /etc/rc.local) always got executed as root anyway.

Please people, any advice would be really appreciated. I can't believe it is this painful to just turn a screensaver off.
Posts: 5
Joined: Sun Sep 23, 2012 9:20 am
by Ann3x » Wed Sep 26, 2012 10:01 pm
Disappointing that noone on this forum can tell me how to run a script at login :(.

Seems ridiculous that a project is stopped due to the inability to turn a simple screensaver off but tbh, for a photo frame its actually a critical thing.

Really noone at all has any suggestions?
Posts: 5
Joined: Sun Sep 23, 2012 9:20 am
by RandomGuy92 » Tue Oct 02, 2012 3:33 pm
try adding it to the file /etc/xdg/lxsession/LXDE/autostart
ensure the it is on a new line, and the line starts with @
Posts: 1
Joined: Tue Oct 02, 2012 3:31 pm
by series8217 » Tue Oct 16, 2012 3:16 pm
Ann3x, did you look at the LXDE documentation? You can use the autostart feature to have programs start after the X session loads.

https://wiki.archlinux.org/index.php/LX ... t_Programs

You need to make a .desktop file for the program/script you want to run, or find the location of the .desktop file if the program already has one.

The format of a basic .desktop file is:
Code: Select all
[Desktop Entry]
Name=My Script

Once you have found or created the .desktop file, place it (or create a symlink to it) in ~/.config/autostart.

By default it should be enabled on startup once you have placed the .desktop file there. You can turn it on and off with the lxsession-edit utility.
Posts: 3
Joined: Tue Oct 16, 2012 12:00 am
by alexbain » Tue Jan 08, 2013 1:26 am
To disable the screensaver (and the screen from blanking) I had to make the following change:

Edit /etc/lightdm/lightdm.conf and add this line under the '[SeatDefaults]' section:

xserver-command=X -s 0 dpms

Hope that helps!
Posts: 6
Joined: Sun Jul 08, 2012 6:47 pm
by forkd » Tue Jan 22, 2013 4:37 am
Hi, for the xset commands to work you neecd to install x11 server utilities....

I believe the command is

sudo apt-get install x11-server-utils

I am also using a raspberry pi as a digital picture frame :)
Posts: 1
Joined: Sun Jan 13, 2013 5:45 am