You are not logged in.

#1 2012-12-01 18:05:29

eruditorum
Member
Registered: 2012-11-12
Posts: 130

powerconf: Udev-driven user-configurable power management system

Edit scripts (located in /etc/powerconf) and Udev rules (/etc/udev/rules.d/powerconf.rules) to fit your needs!

Scripts are launched on udev events defined in udev rules.

  1. During runtime, switching between power states is performed (/etc/powerconf/online, /etc/powerconf/offline).

  2. On resume, if power state was not changed (still on battery or ac) /etc/powerconf/resume is executed to fix devices that are reset (gpu, disk in my example).

  3. If on battery and charge is low (1% in my example) /etc/powerconf/battery is run (in my example hibernates the system).

Package in AUR: https://aur.archlinux.org/packages/powerconf big_smile
enj0y

Last edited by eruditorum (2013-02-18 14:34:20)

Offline

#2 2012-12-02 09:37:08

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 807

Re: powerconf: Udev-driven user-configurable power management system

I guess this is a good idea, but there's already a similar project (well not equal) : https://bbs.archlinux.org/viewtopic.php?id=134109 .
I guess it would be better to extend that package, already tested by lots of users, instead of putting inside another one.
Tell me if i'm wrong, please. smile
By the way, thanks for sharing your project!

Offline

#3 2012-12-02 10:19:23

eruditorum
Member
Registered: 2012-11-12
Posts: 130

Re: powerconf: Udev-driven user-configurable power management system

Post marked for deletion...

Last edited by eruditorum (2013-03-27 20:03:57)

Offline

#4 2012-12-02 11:18:57

webspider
Member
Registered: 2012-07-19
Posts: 27

Re: powerconf: Udev-driven user-configurable power management system

The thing is that with most of the powersaving options it doesn't make any sense to disable them, which is why you'd only need some udev rules that permanently enable them + a script that handles lid events and brightness. If you suspend and hibernate via hotkeys and only use the lowest level of brightness, you wouldn't even need said scripts.

Last edited by webspider (2012-12-02 11:20:15)

Offline

#5 2012-12-03 03:24:57

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: powerconf: Udev-driven user-configurable power management system

@webspider, I have to agree with that.  I used to do this stuff, making things change whether plugged in or not, until I realized that there really was no noticeable performance degredation when on battery power.  From what I have read from some of the intel docs, setting the link power management to min_power potentially increases latency, but I cannot tell at all.  So I just leave everything on power saving settings all the time.  I guess it might be different if I had a less powerful computer, but as it is now, it is great.  Also, I use the second to lowest screen brightness nearly always.  The only time I turn it up is when I compute outside.

Offline

#6 2013-01-12 16:55:17

eruditorum
Member
Registered: 2012-11-12
Posts: 130

Re: powerconf: Udev-driven user-configurable power management system

Post marked for deletion...

Last edited by eruditorum (2013-02-15 15:37:12)

Offline

#7 2013-02-03 17:50:00

eruditorum
Member
Registered: 2012-11-12
Posts: 130

Re: powerconf: Udev-driven user-configurable power management system

Post marked for deletion...

Last edited by eruditorum (2013-02-15 15:37:28)

Offline

#8 2013-02-10 15:53:36

eruditorum
Member
Registered: 2012-11-12
Posts: 130

Re: powerconf: Udev-driven user-configurable power management system

Post marked for deletion...

Last edited by eruditorum (2013-02-18 14:35:19)

Offline

#9 2013-02-15 15:34:45

eruditorum
Member
Registered: 2012-11-12
Posts: 130

Re: powerconf: Udev-driven user-configurable power management system

Post marked for deletion...

Last edited by eruditorum (2013-02-18 14:35:38)

Offline

#10 2013-02-15 18:57:17

el mariachi
Member
Registered: 2007-11-30
Posts: 587

Re: powerconf: Udev-driven user-configurable power management system

How would you enable all powersave by default? just udev rule? I've never done it before.

Offline

#11 2013-02-15 19:05:50

eruditorum
Member
Registered: 2012-11-12
Posts: 130

Re: powerconf: Udev-driven user-configurable power management system

Yep, It works.
To set everything to powersave always:

SUBSYSTEM=="power_supply", RUN+="/etc/powerconf/offline"

I guess, you need to inspect properties of devices you want to save power with, then write the rule.

udevadm info /sys/class/* --attribute-walk

Last edited by eruditorum (2013-02-15 19:08:56)

Offline

#12 2013-02-17 00:11:46

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: powerconf: Udev-driven user-configurable power management system

Very nice, I'm using this from now on, really clean and simple.

Offline

#13 2013-02-18 14:15:46

eruditorum
Member
Registered: 2012-11-12
Posts: 130

Re: powerconf: Udev-driven user-configurable power management system

UPDATE: Uploaded to AUR

Offline

#14 2013-02-18 15:31:17

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: powerconf: Udev-driven user-configurable power management system

I think it would be better to let the laptop suspend earlier, because 1% is a very low value, which is already unhealthy for the battery. 7% is a better value, or, if you insist, 4%.

edit: And using the cpu governor "powersave" doesn't really save power, in fact with it the cpu consumes MORE power, because it takes longer until it can sleep again.

Last edited by Army (2013-02-18 15:39:11)

Offline

#15 2013-02-18 16:18:39

eruditorum
Member
Registered: 2012-11-12
Posts: 130

Re: powerconf: Udev-driven user-configurable power management system

Army wrote:

I think it would be better to let the laptop suspend earlier, because 1% is a very low value, which is already unhealthy for the battery. 7% is a better value, or, if you insist, 4%.

Well, udev rule and scripts are configurable by definition, so you decide. On my system I want it to be 1%.

Army wrote:

And using the cpu governor "powersave" doesn't really save power, in fact with it the cpu consumes MORE power, because it takes longer until it can sleep again.

Again, user decides what is better for him. I tried "ondemand" on battery, but in my case "powersave" is better (temperatures are lower).

Last edited by eruditorum (2013-02-18 16:20:54)

Offline

#16 2013-04-04 18:20:44

grine
Member
Registered: 2010-02-09
Posts: 38

Re: powerconf: Udev-driven user-configurable power management system

I really like this script, much easier to configure than powerdown!

I'm missing a few of the things from powertops warning list though, and my wifi doesn't seem to go into the correct power saving. Any tips would be great.

I'm on a Thinkpad X220 with Intel wifi.

Offline

Board footer

Powered by FluxBB