Difference between revisions of "Automatically reduce brightness"
(Updated to a new revision) |
|||
Line 11: | Line 11: | ||
# Move the {{path|brightd}} executable into a directory like {{path|/usr/local/bin}} | # Move the {{path|brightd}} executable into a directory like {{path|/usr/local/bin}} | ||
# Put {{cmduser|brightd -d}} into your {{path|~/.Xsession}} (or another distro-specific startup script) | # Put {{cmduser|brightd -d}} into your {{path|~/.Xsession}} (or another distro-specific startup script) | ||
− | # Change the permissions of {{path|/ | + | # Change the permissions of {{path|/sys/class/backlight/ibm/brightness}} so that your user can write to that file |
See the README for more detailled instructions and command line parameters. | See the README for more detailled instructions and command line parameters. | ||
== Example installation for Gentoo linux and XFCE4 == | == Example installation for Gentoo linux and XFCE4 == | ||
− | $ wget -o /dev/null -O brightd.tar.bz2 "http://pberndt.com/Programme/Linux/brightd/_download/brightd.tar.bz2?ct=raw&sub=att" | + | $ wget -o /dev/null -O brightd.tar.bz2 "http://www.pberndt.com/Programme/Linux/brightd/_download/brightd-0.1.tar.bz2?ct=raw&sub=att" |
− | $ tar xjf brightd.tar.bz2 | + | $ tar xjf brightd-0.1.tar.bz2 |
− | $ cd brightd/ | + | $ cd brightd-0.1/ |
$ make | $ make | ||
gcc -lX11 -lXss -o brightd brightd.c | gcc -lX11 -lXss -o brightd brightd.c | ||
Line 32: | Line 32: | ||
ebegin "Setting permissions on /proc" | ebegin "Setting permissions on /proc" | ||
− | chmod g+w / | + | chmod g+w /sys/class/backlight/ibm/brightness |
− | chgrp wheel / | + | chgrp wheel /sys/class/backlight/ibm/brightness |
eend $? | eend $? |
Revision as of 19:44, 15 April 2007
Contents
The idea
When watching someone working with an iBook I noticed that the brightness automatically faded to the lowest level after a few seconds of inactivity. I think that this is a simple way to save power. I wrote a c-daemon which uses the XScreenSaver extension to check whether the user is active. If he is not, it lowers the brightness to a specific level. When he is active again, the brightness is reset to the previous level.
Prerequisites
A recent kernel with IBM ACPI extensions. (You should have a file called /proc/acpi/ibm/brightness)
Installation
- Download the brightness control daemon
- Unpack it and chdir into the brightd directory
- Call
$ make
- Move the brightd executable into a directory like /usr/local/bin
- Put
$ brightd -d
into your ~/.Xsession (or another distro-specific startup script) - Change the permissions of /sys/class/backlight/ibm/brightness so that your user can write to that file
See the README for more detailled instructions and command line parameters.
Example installation for Gentoo linux and XFCE4
$ wget -o /dev/null -O brightd.tar.bz2 "http://www.pberndt.com/Programme/Linux/brightd/_download/brightd-0.1.tar.bz2?ct=raw&sub=att" $ tar xjf brightd-0.1.tar.bz2 $ cd brightd-0.1/ $ make gcc -lX11 -lXss -o brightd brightd.c $ cp brightd /usr/local/bin/ $ cd /etc/xdg/xfce4 $ vi xinitrc 73Gi /usr/local/bin/brightd -s 5 -w 2 -d <escape>:x $ cd /etc/init.d/ $ cat > permissions start() { ebegin "Setting permissions on /proc" chmod g+w /sys/class/backlight/ibm/brightness chgrp wheel /sys/class/backlight/ibm/brightness eend $? } $ chmod a+x permissions $ rc-update add permissions boot $ ./permissions start
Done. Restart X to see it working.
Example installation for Debian Sid
brightd isn't yet in the official Debian archives (an ITP was filled), but you can get precompiled binaries for unstable from Zhenech's page.
$ wget http://debian.die-welt.net/pool/main/brightd/brightd_0.0.20070226-1_i386.deb
# dpkg -i brightd_0.0.20070226-1_i386.deb
Done. Relogin into your X session and brightd will be started. You can change this and other settings by editing /etc/default/brightd.