Brand-new Rpi3B+ with a brand-new download of Stretch.

Made sure everything is up to date:

sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get autoremove -y
sudo apt-get dist-upgrade -y

I don't mind the automatic screen blanking but would prefer that it ask for a login password when it wakes up. In Jessie that is easy.

So I went through the normal Jessie-style installation of screensaver controls:

sudo apt-get update
sudo apt-get install xscreensaver xscreensaver-gl-extra xscreensaver-data-extra -y

And then, in Preferences, there is new a Screensaver option.

HOWEVER, when I click on it, it blinks as it starts up, then simply goes away.

So, to properly remove it, I used:

sudo apt-get purge xscreensaver xscreensaver-gl-extra xscreensaver-data-extra -y
sudo apt-get autoremove -y

QUESTION: How to control screensaver in Raspbian Stretch?

  • xscreensaver works for me in rapbian stretch. Are you using the official distribution??? May 22, 2018 at 18:10
  • Yep, just downloaded it and went through the update/upgrade/dist-upgrade thing to make extra sure.
    – SDsolar
    May 22, 2018 at 18:56
  • What happens if you type xscreensaver in the terminal? Maybe it's something to do with the 3b+. I don't have one of those yet, just a 3b. May 22, 2018 at 21:26

1 Answer 1


Gain control of locking Raspbian via the command line

Linux xtrlock command - Lock your system on command.


sudo apt-get update
sudo apt-get install xtrlock 

The program is blocking to the called process, then returns status 0 after successful unlock.

To lock your computer, type


Command-line arguments:

-b    Blank Screen  (only Debian/Raspbian, not Ubuntu)
-f    Fork, then immediately return status 0 to calling process

It changes your mouse pointer into a padlock icon - then waits for you to enter your password and press Enter

The best part is that active screens continue updating (such as Task Manager or htop or wcron), until it blanks.

  • Lock prevents switching to alternate terminals via the Alt-Fx keys.

  • Only the Console is locked.

  • Network connections are still enabled.

To make it easier, create the xl command script:

xtrlock -f

chmod +x xl
sudo cp xl /usr/sbin

To lock your computer, type


To prevent screen blanking, do this one time:

Disable screen blanking in X-Windows on Raspbian


Edit /etc/xdg/lxsession/LXDE-pi/autostart and add these three lines:

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

Save it then Reboot or log out.

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.