User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Configure, disable screensaver, blankscreen, and lockscreen

Sat May 07, 2016 1:49 pm

LXDE in Debian/Raspbian has its own ability to setup lockscreen, turn off the monitor, and put it into a true "power save" mode (not screen blanking), etc. You just have to enable it is all (or simply disable it all if that is your preference).

Click here to setup lockscreen, put monitor into a true powersave mode, and configure settings

Here is how to turn it all OFF:

DISABLE IT ALL. NO SCREEN BLANKING, NO POWERSAVE MODE, NO SCREENLOCK. MONITOR STAYS ON ALL THE TIME

open:

Code: Select all

sudo nano ~/.config/lxsession/LXDE-pi/autostart
add:

Code: Select all

@xset s 0 0
@xset s noblank
@xset s noexpose
@xset dpms 0 0 0
'select all', then right click 'copy', then scroll to bottom with down arrow key, then 'paste'

so it looks like this:
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@xset s 0 0
@xset s noblank
@xset s noexpose
@xset dpms 0 0 0

save with 'Ctrl' + 'x' key, then 'y', then 'enter'

then:

Code: Select all

sudo reboot

You will reboot and you are done. ;) No screensaver, no screen blanking, no monitor power saving mode.

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Last edited by Rive on Sat May 07, 2016 2:17 pm, edited 3 times in total.
DNPNWO

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: Configure, disable screensaver, blankscreen, and lockscr

Sat May 07, 2016 2:12 pm

Configure the built in lxde screensaver, lock screen, and monitor (actually turn offs, not screen blanking) power save features via lightlocker which uses the Jessie login screen. This also allows you to use the keyboard shortcut to screenlock:

Instructional youtube video:
https://youtu.be/aTrp83lgq_s

Code: Select all

xset q
note- "xset q" is useful for checking screen and dpms settings, and changing them for testing (e.g., Monitor "off" is set for 1200 sec, or 20 min, and you want to test it, so you set dpms to 10 sec (xset dpms 0 0 10)). Changes here are temporary, and will not survive a reboot.

Run:

Code: Select all

sudo apt-get install light-locker
Open:

Code: Select all

sudo nano /boot/config.txt
Add:

Code: Select all

# uncomment to put the monitor into power saving mode (DPMS)
hdmi_blanking=1
Open:

Code: Select all

sudo nano ~/.config/lxsession/LXDE-pi/autostart
Add:

Code: Select all

@xset s 0 0
@xset s noblank
@xset s noexpose
@xset dpms 0 0 1200
Save with 'Ctrl + x', then 'y', then 'enter'

open:
(note- if you do an "apt-get dist-upgrade" instead of an "apt-get upgrade", you will need to re-add this keybind)

Code: Select all

nano ~/.config/openbox/lxde-pi-rc.xml
find:

Code: Select all

 <!--keybindings for LXPanel →
add:

Code: Select all

      <keybind key="C-A-L">
    <action name="Execute"><command>lxlock</command></action>
  </keybind>
The above dpms '1200', means turn off monitor after 20min, and lock screen with light-locker (lxlock). Change to whatever time you want (in seconds).

If you do not want screen to autolock
If you prefer screen to just turn off/go into power save mode, and resume if you move mouse, or hit a key WITHOUT requiring login, and wish to manually do screenlock, then;

open

Code: Select all

sudo nano /etc/xdg/autostart/light-locker.desktop
find "Exec=light-locker", change to

Code: Select all

Exec=light-locker --lock-after-screensaver=0 --no-lock-on-suspend --no-late-locking

Code: Select all

sudo reboot

Shortcuts:
1. add "ScreenLock" Menu shortcut (via Menu/Preferences/Main Menu Editor/Other/)
2. use keyboard 'Ctrl ' + 'Alt' + 'L' to turn off monitor and lock screen
DNPNWO

Reini1000
Posts: 35
Joined: Wed Apr 20, 2016 8:30 am
Location: Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Thu Jun 09, 2016 6:22 am

Hi, i followed this Discription:
LXDE in Debian/Raspbian has its own ability to setup lockscreen, turn off the monitor, and put it into a true "power save" mode (not screen blanking), etc. You just have to enable it is all (or simply disable it all if that is your preference).

Click here to setup lockscreen, put monitor into a true powersave mode, and configure settings

Here is how to turn it all OFF:

DISABLE IT ALL. NO SCREEN BLANKING, NO POWERSAVE MODE, NO SCREENLOCK. MONITOR STAYS ON ALL THE TIME

open:

sudo nano ~/.config/lxsession/LXDE-pi/autostart

add:

@xset s 0 0
@xset s noblank
@xset s noexpose
@xset dpms 0 0 0

'select all', then right click 'copy', then scroll to bottom with down arrow key, then 'paste'

so it looks like this:

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@xset s 0 0
@xset s noblank
@xset s noexpose
@xset dpms 0 0 0

save with 'Ctrl' + 'x' key, then 'y', then 'enter'

then:
sudo reboot

You will reboot and you are done. ;) No screensaver, no screen blanking, no monitor power saving mode.
But my screen still goes idle after a certain time of inactivity.
I have to mention that i'm using the 7" Raspberry Pi Touchscreen and i'm not booting to the desktop, but to the text console. I'm using a script which automaticly boots into Kweb Browser if you choose the Console Autologin in the raspi-config.

so how can i force the Display to stay on all the time ?

Thanks for helping me in advance.

User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Thu Jun 09, 2016 8:06 am

Can't tell you why it's not working, but these work for me:

Code: Select all

@xset -dpms
@xset s noblank
@xset s off
Maybe worth a try?

Reini1000
Posts: 35
Joined: Wed Apr 20, 2016 8:30 am
Location: Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 6:53 am

Thanks, but that wasn't succesful either.

What should i do, I have no idea how to force the Display to stay on ?

User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 9:23 am

Have you tried entering these 3 commands manually (without the @'s)? Maybe that can give you some clue on what goes wrong.

What does "xdg-screensaver status" give you before and after that?

Reini1000
Posts: 35
Joined: Wed Apr 20, 2016 8:30 am
Location: Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 9:35 am

hi no matter if I add @ or not, always the same message
[email protected]:~ $ xdg-screensaver status
xset: unable to open display ""
/usr/bin/xdg-screensaver: 829: [: Illegal number:
/usr/bin/xdg-screensaver: 831: [: Illegal number:
ERROR: xset q did not report the screensaver timeout

User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 10:22 am

This looks like you're logged in remotely to your Pi. Try issuing

Code: Select all

export DISPLAY=:0
first and then repeat the commands.

Reini1000
Posts: 35
Joined: Wed Apr 20, 2016 8:30 am
Location: Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 10:33 am

Yes i'm logged in via SSH.
i have done:

Code: Select all

[email protected]:~ $ export DISPLAY=:0
[email protected]:~ $ xdg-screensaver status
enabled

User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 10:44 am

Okay, this clearly shows the screensaver is still active. What happens if, directly afterwards, you type

Code: Select all

xset -dpms
xset s noblank
xset s off
xdg-screensaver status
Does the screen still go blank/screensaver still come on after that?

Reini1000
Posts: 35
Joined: Wed Apr 20, 2016 8:30 am
Location: Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 10:49 am

Code: Select all


[email protected]:~ $ xset -dpms
[email protected]:~ $ xset s noblank
[email protected]:~ $ xset s off
[email protected]:~ $ xdg-screensaver status
disabled

Its seems now that the Display stays on. I would be so glad if this was the Trick. Thank you very much !!!

User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 11:57 am

Glad I could help. What remains, of course, is to find out why the same commands do not work automatically. I'm afraid I can't be of much help there since I don't interactively login to the GUI on any of my PIs. Still, you could post the complete content of your ~/.config/lxsession/LXDE-pi/autostart - maybe someone will spot what's wrong there so you don't have to type these commands every time you log in.

Reini1000
Posts: 35
Joined: Wed Apr 20, 2016 8:30 am
Location: Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 12:45 pm

Yeah you are right. Because now if restart I have to typ in again the same command

Code: Select all

 [email protected]:~ $ export DISPLAY=:0
[email protected]:~ $ xset -dpms
[email protected]:~ $ xset s noblank
[email protected]:~ $ xset s off
[email protected]:~ $ xdg-screensaver status
disabled
do Disable the screensaver

my /etc/xdg/lxsession/LXDE-pi/autostart file is containing

Code: Select all

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@xset -dpms
@xset s noblank
@xset s off


User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 12:57 pm

Reini1000 wrote: my /etc/xdg/lxsession/LXDE-pi/autostart file is containing
And your ~/.config/lxsession/LXDE-pi/autostart? I believe this overrides the system-wide default file you posted.

If that's identical, I would also try to remove the "xscreensaver" line.

Reini1000
Posts: 35
Joined: Wed Apr 20, 2016 8:30 am
Location: Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 1:18 pm

My ~/.config/lxsession/LXDE-pi/autostart file contains

Code: Select all

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@xset -dpms
@xset s noblank
@xset s off

User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 1:32 pm

So have you tried removing the line containing xscreensaver from that file? Of course, you'll have to log out and in again.

Speakng of which: We're talking about disabling the screensaver when you log in at the Pi itself, are we? If not, how exactly do you log in?

Reini1000
Posts: 35
Joined: Wed Apr 20, 2016 8:30 am
Location: Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 1:57 pm

dasmanul wrote:So have you tried removing the line containing xscreensaver from that file? Of course, you'll have to log out and in again.

Speakng of which: We're talking about disabling the screensaver when you log in at the Pi itself, are we? If not, how exactly do you log in?
i have tried to remove the xscreensaver line with a #. But nothing changes the screensaver is still on.
Yes i want to disable the screensaver for the pi user.
My setup is: booting with auto-login as pi user to the text console and then autostart the kweb browser.

User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 2:07 pm

So how do you autostart the kweb browser?

Reini1000
Posts: 35
Joined: Wed Apr 20, 2016 8:30 am
Location: Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 2:17 pm

dasmanul wrote:So how do you autostart the kweb browser?
I use a script which is called "Kiosk" ( located in /home/pi/kiosk) containing

Code: Select all

#!/bin/sh
matchbox-window-manager &
kweb3 –KAJ  http://127.0.0.1:8080/webvisu.htm
and then i edit the .bashrc file
and add at the end of the file:

Code: Select all

    if [ $(tty) == /dev/tty1 ]; then
    xinit ./kiosk
    fi
This auto start's the kweb browser if I'm booting in the text console.

User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 2:35 pm

Well in that case you're not using LXDE at all, so no wonder putting the commands in its startup scripts doesn't work. Try putting the three "xset" commands in your kiosk script - either before or after the "matchbox-window-manager" line, shouldn't matter.

Reini1000
Posts: 35
Joined: Wed Apr 20, 2016 8:30 am
Location: Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 2:57 pm

Nope

i edit my kiosk file to:

Code: Select all

#!/bin/sh
matchbox-window-manager &
kweb3 -KAJ http://127.0.0.1:8080/webvisu.htm
@xset -dpms
@xset s noblank
@xset s off
but the screens went black again .

do i need the @ ?

User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 3:00 pm

I don't think you need the @'s but I would put the xset's before the kweb line. Try adding the three commands (without the @'s) directly after the first line.

Reini1000
Posts: 35
Joined: Wed Apr 20, 2016 8:30 am
Location: Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 3:11 pm

now i have change the Kiosk File to this:

Code: Select all

#!/bin/sh
xset -dpms
xset s noblank
xset s off
matchbox-window-manager &
kweb3 -KAJ http://127.0.0.1:8080/webvisu.htm
and i get :

Code: Select all

[email protected]:export DISPLAY=:0
[email protected]:~ $ xdg-screensaver status
disabled
seems that it worked now. I will wait whether the display stays on or not.

Reini1000
Posts: 35
Joined: Wed Apr 20, 2016 8:30 am
Location: Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 3:31 pm

Finally this has done the Trick, the Display is on all the time after I change the
Kiosk to:

Code: Select all

#!/bin/sh
xset -dpms
xset s noblank
xset s off
matchbox-window-manager &
kweb3 -KAJ http://127.0.0.1:8080/webvisu.htm
Thank you so much !

User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: Configure, disable screensaver, blankscreen, and lockscr

Fri Jun 10, 2016 3:36 pm

Gern geschehen. :)

Return to “Beginners”