1

I am using Trusty but not unity desktop. I lock my screen by gnome-screensaver-command -l. Seems like in default configuration, gnome-screensaver won't save my power. I found this which did not work.

What should I do?


When trying gsettings, I got:

$ gsettings set org.gnome.desktop.session idle-delay 60
The key is not writable

And for the vbetool issue, xset could be used instead without sudo. But I still want something persistent, instead execute everytime I start desktop, or even everytime I lock screen.

Eric Carvalho
  • 54,385
Magicloud
  • 458

2 Answers2

1

I know it's an old question but I had same issue in 18.04. No matter what command I ran with gsettings I got The key is not writable error message. Tried setting files to writable in /.config/dconf as suggested in other thread but it didn't help. somehow my user file in /etc/dconf/profile got misplaced. what I did was

mkdir -p /etc/dconf/profile

and edit /etc/dconf/profile/user, then add:

user-db:user

then

sudo dconf update

source: dconf Settings

hope this helps someone save some time figuring this out

Mkkabi
  • 111
0

A workaround way is as following. Run both these command:

gnome-screensaver-command -l && gsettings set org.gnome.desktop.session idle-delay 1

This gsettings set org.gnome.desktop.session idle-delay 1 command sets your screen time if it's inactive(1 second) but you need to create a Custom Shortcut and one shortcut key for that with gsettings set org.gnome.desktop.session idle-delay 60(inactive for 1 minute) value to disable that feature because it turns off your screen if you have inactive for 1 second ;)

enter image description here

Useful link:
Turn off monitor using command line
Also if you used this solution, you can define a shortcut key for that to turning on again. But sudo needs to enter password then you can remove password for that command HOW To?

You can configure your system that sudo someCommand does not require a password(in our case for sudo). To do that, run sudo visudo and add the following line at the END in the file that opens:

Your_USERNAME  ALL=NOPASSWD: /usr/sbin/vbetool

Then exit the editor and save it (CTRL+x).

Now you can use gnome-screensaver-command -l && sudo vbetool dpms off command from the command line or in your script without password. And define a shortcut key like sudo vbetool dpms on to turning on it.

αғsнιη
  • 35,660