You are not logged in.

#1 2010-03-22 07:03:15

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Script to set brightness depending on battery

Hello guys,

I'd like to set the brightness on my machine depending on the usage of battery.

If the battery is available it should be set to 100%, if not then to the minimum to save battery life.

I thought about something like that but as I currently have no battery available I can't test it.

In /etc/rc.local

if acpi -a | grep off-line 2> /dev/null; then
    xbacklight -set 0
else
    xbacklight -set 100
fi

What do you think?

Last edited by orschiro (2010-03-22 07:03:47)

Offline

#2 2010-03-22 07:11:16

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: Script to set brightness depending on battery

You probably want laptop-mode.  It can do this and much more.

Offline

#3 2010-03-22 08:25:51

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: Script to set brightness depending on battery

Hello chpln,

I know laptop-mode can do this but as I simply want just this feature it's too bloated for my usage.

Regards

Offline

Board footer

Powered by FluxBB