Stop the screen from blanking in Ubuntu

Hi all,

like the title says, if you don't like screen blanks; you can disable screensaver etc by doing the following:

Open Control Center > Personal > Startup Applications > Add and give it a name and then add the command (copy and paste) to the command line, then save it and restart your PC at your leisure or straight away if you want to test it. (You can add a comment if you wish but I didn't!).

Name: Stop the screen from blanking
Command: xset -dpms s off s noblank s 0 0 s noexpose
Comment: Type something or leave it blank

Now open Control Center > Personal > Screensaver and make sure that there are no ticks in the boxes, I also slid the slider all the way over to the right which sets it to 2 hours, once done, click on the "Power Management" button and make sure that both tabs are set to never!.

While you are still in the Control Center, click on "Startup Applications" and take the tick out of "Screensaver" just for good measure:

Also, you might want to open Dconf Editor and take out the tick if it is indeed active!. (I think it is not active by default in Ubuntu Mate 15.04!.)

Dconf Editor > Org > Mate > Desktop > Screensaver > idle-activation-enabled

I hope it is of use to you!. :smiley:

6 Likes

Fyi, “Open Control Center” is in the “System” menu top left of the screen on a fresh install of Ubuntu-Mate (15.04) on the Raspberry Pi2.
System -> Control Center.
under the “Personal” section in the “Control Center” window, select “Startup Applications”. Then click “Add” in the window that comes up…

Now I’m stuck near the end, where is “Dconf Editor”? I’m not seeing it in the “Control Center”? I’m not seeing it under any of the menus on the desktop (Applications, Places, or System)?
(EDIT)
I’m blind, lol.
Applications -> System Tools -> “dconf Editor” (the icon looks like a Volume control thing)
(EDIT2)
‘Screensaver’ apparently has been moved in “dconf Editor”.
org -> mate -> screensaver
(EDIT3)
And to top it off. This Dose Not Work. The screen still goes blank after about a minut or two.

I also tried “setterm -blank 0” in the “rc.local” file, and that did not work???
Suggestions?
(EDIT4)
Ominously, in the “Screensaver Preferences” window, there is a setting for “Regard this computer as idle after” setting slider-thing. It only goes from 1 minute to 2 hours. I’m not sure if that has anything to do with it, as I had it set to 2 hours, and the display was blanking out after a few minutes of watching a vid or NOAA radar. This is not cool. Clearly Ubuntu-mate had not been considered for use as a ‘Status display’ for anything, you know the kind of thing that you NEVER want the screen to just shut off by it’s self, lol.

Apparently, the only way to keep the screen from going blank in the middle of watching a vid, is to have the screensaver program load on boot, and set the settings in the “Screensaver Preferences” window to not turn off the display (uncheck the “Activate screensaver when computer is idle”, plus setting the “PowerManagement” boxes to “never” as well).

The Raspberry Pi2 dose have rather ‘Limited’ resources. Having a program load and run in the background (the screensaver), just to keep the screen from going blank, is not beneficial at all for me. It’s bad enough that it has performance issues that is for another topic, without this.

Hi,

I cannot really give an answer about Rasp PI, did you add the command to “Startup Applications” as described above?. :smiley:

In order to get rid of the problem, I also added a Startup Application entry. However, I used
Command: xset s off
which works for me. Could be worth a try for those in search of an alternative to wolfman’s approach.

Yes wolfman, and my display looked exactly like your screen-caps. It did not work.

As mentioned, I found a few other posts regarding lines in config files, same results.

The only workaround was to keep the screensaver-thing in the startup, and disable it in the config for it (Activate screensaver when computer idle…).

There has been at least three updates to the ‘base’ since then, so I guess I should give it another try. Tho I suspect it may be a ‘sudo’ (super user privileges) thing preventing it from working. Some stupid things don’t work without ‘sudo’, like getting the Pi2 CPU temp. For example.

/opt/vc/bin/vcgencmd measure_temp
doesn’t work at all.

sudo /opt/vc/bin/vcgencmd measure_temp
Dose work.

Tho I didn’t try the ‘measure_temp’ in the startup list, for silly reasons, I do suspect it may have similar results, lol.

1 Like

I can’t really respond to your problem as you are using Rasp PI and I only have a normal PC, the above works for me no problem!. :smiley:

I am sure people could configure files until they are blue in the face, the guide is a simple method for people new to Linux (Ubuntu based systems). :smiley:

Would you please tell me what ubuntu/debian package contains allxset?

$ allxset gives “command not found” error
$ sudo apt-get install gives “Unable to locate package allxset”

even a google search for allxset turns up nada.

Hi @Domain_Administrator,

its not a package as far as I am aware?, it is a part of the command I used above!. :smiley:

You shouldn’t need to install anything, just paste the command as described above. :smiley:

allxset gives “command not found” error

Hi,

use this command as something went wrong and somehow the command was changed, I changed it back to the original!. :smiley:

Hey;

Just to share a way to switch screensaver off using a terminal :

gsettings set org.mate.screensaver idle-activation-enabled false

Sebastien

1 Like

For enable it again :

> gsettings set org.mate.screensaver idle-activation-enabled true
> killall mate-screensaver
> mate-screensaver &

I did a script that temporarly disable it and at the end put it enable again … with optimization :slight_smile:
(I use it when watching a moovie on my raspberry pi)

 #!/bin/bash

#Durée durant laquelle l'économiseur d'écran est désactivé
COMPTE_REBOURS_MINUTES=120

#Desactivation de l'économiseur d'écran
mate-screensaver-command -i &

#Ancienne methode non utilisee car nécessite ensuite de tuer le processus mate-screensaver
#gsettings set org.mate.screensaver idle-activation-enabled false

#On récupère le pid de la commande
pid_bloqueur_screensaver=$!

#Calcul de COMPTE_REBOURS_MINUTES en secondes
WAIT=$[$COMPTE_REBOURS_MINUTES*60]

i=0
    (
        while [ "$i" -lt "$WAIT" ]; do
            sleep 1
            i=$(expr $i + 1)
            PERC=$(expr $i \* 100 / $WAIT )
            echo "$PERC"
        
echo "#Le verrouillage session est actuellement désactivé\n Réactivation
 du verrouillage dans $[($WAIT-$i)/3600] heure(s) $[($WAIT-$i)/60] 
minute(s) $[$WAIT-(($WAIT-$i)/60)*60-$i] seconde(s)"
        done
    ) |
    zenity --progress --percentage=0 --title="Attention" --cancel-label="Réactiver maintenant" --auto-close

#Réactivation de l'économiseur d'écran an tuant le processus bloqueur
kill $pid_bloqueur_screensaver
#Ancienne methode mais la dernière commande posait probleme depuis un script
#gsettings set org.mate.screensaver idle-activation-enabled true
#killall mate-screensaver
#mate-screensaver-command --exit
#mate-screensaver --display=:0 &

#Une fois le bloqueur désactivé on simule un deplacement de souris sinon l'ecran de veille ne se reactive jamais
xdotool mousemove 0 0

exit 0

Seb

1 Like

What I found was that no matter what I did using the above the screen would still blank after 10 minutes.
So I trawled DCONF and found that its the screensaver time between changing the background image.
I changed the 10 minutes to 240 minutes and now I don’t see the screen blanking anymore.

Try this it might help.
gsettings set org.mate.screensaver cycle-delay 240

1 Like

Thank’s Mate This Work For Me!!!

1 Like

Hi friends! In my case i use Ubuntu Mate 16.04 with COMPIZ like “Window Manager”.
The easy solution for me was disabled"Unredirect Fullscreen Windows" and now everything works like a charm.

The solution:
compiz -> Composite -> General -> Unredirect Fullscreen Windows -> disable

I prefer a more straightforward approach.

Add the the following options at the end of your ServerLayout section in /etc/X11/xorg.conf

    Option "BlankTime" "0"
    Option "StandbyTime" "0"
    Option "SuspendTime" "0"
    Option "OffTime" "0"

Like so:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
    Option         "BlankTime" "0"
    Option         "StandbyTime" "0"
    Option         "SuspendTime" "0"
    Option         "OffTime" "0"
EndSection

@ Wolfman

Ubuntu 20.04.01LTS, MATE 1.24.0

I implemented the two lines (Name & Command) in Startup Applications and it worked a treat - screen now stays active - v. glad for your post some years ago.
mark

1 Like

Hi Mark,

welcome to the forum and I'm glad it helped you. :smiley:

Thanks wolfman! This helped me!

1 Like