11

I would like to turn off the screen saver from command line, which used to work with

gconftool-2 -s /apps/gnome-screensaver/idle_activation_enabled --type=bool false

in natty & oneiric for precise this does not work.

Any ideas?

I know where I can do that in the gui, I'd need the setting for an automatic installation script, that also changes some default settings.

tom
  • 231

7 Answers7

12

these settings will help

gsettings set org.gnome.desktop.screensaver lock-delay 3600
gsettings set org.gnome.desktop.screensaver lock-enabled false
gsettings set org.gnome.desktop.screensaver idle-activation-enabled false

recheck with dconf-editor

when using the gui, these properties will also change in dconf-editor.

tom
  • 231
  • Interesting fact: If you do a gsettings list-recursively > old.settings, disable the screensaver via GUI and do a gsettings list-recursively > new.settings, the diff between both setting files is empty. – stackprotector Sep 09 '21 at 09:33
  • This still works for Ubuntu 22.04.1 LTS. I'm somewhat surprised. – Sridhar Sarnobat Nov 30 '22 at 22:01
2
killall gnome-screensaver ; xset dpms force on
jokerdino
  • 41,320
  • 3
    this does not solve my problem, because the setting is not stored and the screenserver is back after a reboot. – tom Mar 02 '12 at 08:17
  • +1 - This worked for me. all the rest in the planet mentioned did not worked except this –  Oct 18 '13 at 14:23
1

According to gsettings, this should do the trick:

gsettings set org.gnome.desktop.session idle-delay 0
0

The command gsettings set org.gnome.desktop.screensaver lock-delay 3600 (delay in seconds) does seem to work for me when reset to 4000. Helps when watching an hours telly on iplayer.

The dconf setting is buried under org/desktop/applications/screensaver.

I think the GUI could be more helpful.

BuZZ-dEE
  • 14,223
john
  • 1
0

You will have to employ this command for all users, but after that it will be run and set upon each login. I can't put it in a code box because there are quoted returns in the command that the code box sees as an end. But will be read quite differently by BASH. Copy and paste the following in a terminal and press enter. Do this for each user. It could be incorporates into an install script as well but you will need someone more experienced with making a script run for each user. Copy and paste the whole thing, from echo to the last autostart blank lines and all, one big copy and paste.

echo '#!/bin/bash 

sleep 15 

xset s 0 0 

xset s off 

exit 0' > screensave_off.sh ; chmod +x screensave_off.sh ; echo '[Desktop Entry]

Type=Application

Exec= sh ~/screensave_off.sh

Hidden=false

NoDisplay=false

X-GNOME-Autostart-enabled=true

Name=Screen-Saver-Off

Comment=to turn off the Xserver power save' > Screen-Saver-Off.desktop ; chmod +x Screen-Saver-Off.desktop ; mv Screen-Saver-Off.desktop ~/.config/autostart
Wtower
  • 467
  • 9
  • 16
dginsd
  • 601
  • 7
  • 9
0

This is what did it for me:

gsettings set org.gnome.desktop.screensaver idle-activation-enabled 0
Eric Carvalho
  • 54,385
0

For me this worked:

killall gnome-screensaver

And when I want enable it again

gnome-screensaver &

This is only a temporary solution but if you're looking for it then that's fine.

Aku506
  • 103
  • 1
  • 9