Power management Generic

From The World according to Vissie
Jump to navigation Jump to search

Screen locking

gnome-screensaver

There seem to be no front-end to gnome-screensaver. So here is a couple of command:

to query:

gsettings get org.gnome.desktop.session idle-delay uint32 300
gsettings get org.gnome.desktop.screensaver lock-enabled true
gsettings get org.gnome.desktop.screensaver lock-delay uint32 0

to set:

gsettings set org.gnome.desktop.session idle-delay 300
gsettings set org.gnome.desktop.screensaver lock-enabled true

I get the idea that gnome-session needs to run for gnome-screensaver to work. But not sure.


OK, so this SEEMED to have worked.....

gsettings set org.gnome.desktop.screensaver lock-enabled true
gsettings set org.gnome.desktop.session idle-delay 300
gsettings set org.gnome.desktop.screensaver lock-delay 10

Make sure the gnome-screensaver is running:

gnome-screensaver&

And lock the screen

gnome-screensaver-command -l

xlocker

xautolock

I am now running these lines on startup (my i3 config calls out to a script that calls a script with these lines):

xautolock -time 5 -locker fuzzy_lock -notify 20 -notifier 'xset dpms force off' &
xautolock -time 7 -locker "systemctl suspend" &

So far, I haven't had any issues with this (i3lock fires up correctly after suspend [without xss-lock]).

xss-lock

http://manpages.ubuntu.com/manpages/xenial/man1/xss-lock.1.html

xset 180 120
xss-lock -n dim-screen.sh -- i3lock -n
  1. Win+L locks the screen.
xset s activate
# Start xss-lock (and lock the screen after 15 minutes)
xset s 900
xss-lock -- i3lock -n -i $HOME/example.png
#lock screen with i3lock/xautolock
exec xautolock -locknow

Display

You should configure the DPMS to shutdown the screen when idle (rather than displaying a fancy but power consuming screensaver). ie. to turn off the display after 30 minutes of idling:

xset +dpms
xset dpms 600 1200 1800 

It seems that, if your PC does not want to listen to you, do a

systemctl suspend

system wide suspend. After that, the screen blank work like a charm.

Else, try

sudo apt-get install xautolock
xautolock -time 2 -locker "/usr/bin/dm-tool lock"&

Power Management

Ubuntu 12.04.5 LTS (Linux kernel 3.13.0), Ubuntu 14.04 LTS and later For the most recent ATI/AMD graphic cards supported by the Radeon driver, DPM (Dynamic Power Management) should work automatically without additional steps.

Instead if you notice overheating problems and/or you have an old Radeon HD graphic card, you can enable DPM by adding a boot parameter. This should greatly help power consumption, especially when idle. To do so, edit /etc/default/grub and add the 'radeon.dpm=1' to the GRUB_CMDLINE_LINUX_DEFAULT line, so it would look something like:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash radeon.dpm=1" After you save/quit the text editor, update grub:

sudo update-grub

Suspend on lid close

https://wiki.debian.org/SystemdSuspendSedation

In order to trigger suspend on closing the lid, make sure that there is a line in /etc/systemd/logind.conf that reads HandleLidSwitch=suspend, and that it is not commented out (prefixed with #).

The default values are :

HandleLidSwitch=suspend HandleLidSwitchDocked=ignore

After making the change to logind.conf, run systemctl restart systemd-logind.service. After doing so closing the laptop's lid should cause the laptop to suspend..

Hibernation

I had issues with hibernation returning to a black desktop. Killing X from a tty seems to bring it back, but its not a nice/good/sexy solution. I found on a Antergos site the hint that this could be due to lightdm. I installed GDM and the issue seems to be fixed. Now its the age old struggle to get something to lock my screen and do time outs. This is the reason that I do not use lightdm anymore. Sad.

Hybrid sleep

systemctl hybrid-sleep 

Powertop

Have a look at Powertop. This MAY suggest some nice ways to save power.

https://wiki.archlinux.org/index.php/Powertop

TLP

Maybe also look at TLP

https://wiki.archlinux.org/index.php/TLP