1

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?

SDsolar
  • 2,348
  • 8
  • 25
  • 43

1 Answers1

3

Gain control of locking Raspbian via the command line

Linux xtrlock command - Lock your system on command.

Excerpt:

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

xtrlock

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:

(shebang)/bin/bash
xtrlock -f

chmod +x xl
sudo cp xl /usr/sbin

To lock your computer, type

xl

To prevent screen blanking, do this one time:

Disable screen blanking in X-Windows on Raspbian

Excerpt:

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.


SDsolar
  • 2,348
  • 8
  • 25
  • 43