Saving Power With sleepd and pm-suspend-hybrid

7 risposte [Ultimo contenuto]
EricxDu
Offline
Iscritto: 02/02/2013

One of the things I missed when I ditched That-Other-OS for Trisquel was an advanced power management option that suspended and hibernated my netbook automatically.

Some desktop environments come with power management components that handle some of this, but I was dissatisfied with those and wanted a more system-wide solution anyway. I prefer the system daemon sleepd, which runs at startup and puts the computer to sleep after 10 minutes of inactivity. The package provides sleepctl which lets you pause/resume the automatic suspend, and there are other options to set: see man sleepd and edit /etc/default/sleepd to change the options of sleepd. This didn't go far enough for me, though, because I wanted my netbook to switch from suspend to full hibernation after longer periods of inactivity.

On my netbook (an HP-Mini), the package pm-utils handles suspend and hibernate perfectly with the commands pm-suspend, pm-hibernate, and pm-suspend-hybrid. In the manpages under man pm-actions, I found my answer: pm-suspend-hybrid has a default setting that wakes the computer up from sleep and puts it into hibernation after 15 more minutes. To activate this automatically, you just have to change the settings of sleepd in /etc/default/sleepd with the option "--sleep-command pm-suspend-hybrid". Now my netbook saves power optimally if I leave it alone for long by sleeping after 10 minutes, or hibernating after 25 minutes.

I'm very happy I found a solution to my little preference. Now, I hope I can solve out my Synaptic touchpad, and I'll have taken care of my most niggling little problems since I chose freedom over convenience.

I haven't tried any yet, but here are some more tips about saving power in the Trisquel wiki: http://trisquel.info/en/wiki/optimizing-battery-time

lembas
Offline
Iscritto: 05/13/2010

Glad to hear that. Tinkering is fun and profitable!

Is there a thread about your touchpad issues?

EricxDu
Offline
Iscritto: 02/02/2013

No, I haven't tried to hard to figure out my touchpad yet. It works fine, but I wish it were easier to right-click and click-drag.

lembas
Offline
Iscritto: 05/13/2010

You can use synclient probably. Use -l to see current settings and read man synclient and man synaptics to find out what the parameters mean.

You can enlarge the corner area if you wish by moving the edges. You might also want to try locked drags.

EricxDu
Offline
Iscritto: 02/02/2013

Thanks. I use synclient currently in my .xsessionrc to set some parameters that make things a little easier for me, for instance RTCornerButton=3, LockedDrags, and even AreaBottomEdge=4000. I would rather be able to press alt-click to send a right-click, for one thing.

lembas
Offline
Iscritto: 05/13/2010

I think instead of modifying AreaBottomEdge you might want to change BottomEdge and RightEdge.

I also set a high EdgeMotionMinSpeed.

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

If you are using the "normal" Trisquel edition, you can specify in the "Energy System Settings" that the laptop must suspend after X minutes of inactivity (X being chosen in a drop-down menu).

EricxDu
Offline
Iscritto: 02/02/2013

I have tried a few of the power management settings included in the desktop environments, including Gnome. The thing is, I needed a solution that was independent of the DE so I could use different DEs and keep my power management the same.

In addition, this is the only solution I've found that will automatically sleep AND hibernate my netbook, one after the other. It's pretty handy for me.

But if anyone's just looking for automatic sleep, it's definitely not hard to find in Trisquel.