I should start off by saying I am fairly new to Linux. I want my pi to scroll through pictures in Image Viewer and never sleep. I've followed these instructions from another question to try to fix the sleeping problem.

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

I didn't have the .xinitrc file in my home directory so I created one. It hasn't seemed to make a difference. I also have a .Xauthority file in /home/pi and have tried renaming it but it creates a new .Xauthority file.

  • Sure the file is located at ~/.xinitrc and you have xset installed?
    – Jivings
    Commented Oct 17, 2012 at 15:40
  • x11-xserver-utils is already the newest version. and .xinitrc is in the /home/pi directory
    – morrisbw
    Commented Oct 17, 2012 at 15:49
  • I am having the same problem. Did you find what directory the .xinitrc file should be created in to stop the screen saver from activating?
    – TfromNYC
    Commented Oct 18, 2012 at 15:50
  • How are you starting X? .Xauthority is autogenerated and not relevant here, I think. You could also try calling your session script ~/.xsession. I believe xinit is a relic and so is its .xinitrc. It is used by startx, though. Login managers might or might not ignore it. I think I've also seen .xclients and don't ask me about CDE. Either way, .xsession and .xsession-errors are my preference. You can grep -r for mention of those files in scripts in /etc/X11. Also, startx is probably a script that you can read to see exactly what it does.
    – XTL
    Commented Oct 19, 2012 at 11:52
  • Have you tested the xset commands in an already running X and do they make a difference? It's not altogether impossible that bare X blanking is broken in your server version.
    – XTL
    Commented Oct 19, 2012 at 11:55

1 Answer 1


Edit /etc/lightdm/lightdm.conf and use the following xserver-command:

xserver-command=X -s 0 -dpms

This worked for me at least.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.