| 1 |
BRIGHTNESS CONTROL DAEMON |
| 2 |
---------------------------------------------------------------- |
| 3 |
|
| 4 |
CHANGES IN 0.4 |
| 5 |
Brightd 0.4 introduces some major changes, so I'll write some |
| 6 |
information on the new system here. |
| 7 |
|
| 8 |
d-tick <jid:[email protected]> noticed that the old code |
| 9 |
caused a huge number of CPU wakeups per second. While this makes |
| 10 |
the fading and reaction look quite cool, it's something quite# |
| 11 |
underisable for battery live time. |
| 12 |
|
| 13 |
Starting with this version of brightd the program calculates idle |
| 14 |
times based on input on /dev/input/event* using select(2) and |
| 15 |
alarm(2). xscreensaver times are honored furthermore, but not |
| 16 |
pulled every few ms. Also, the brightness setting doesn't get |
| 17 |
pulled anymore, which means you'll have to tell your acpid script |
| 18 |
to notify brightd of any changes to the brightness. To achieve |
| 19 |
this, brightd creates a FIFO into which you may echo the new |
| 20 |
brightness setting. |
| 21 |
|
| 22 |
In my case (Thinkpad R51) the lines I had to put into |
| 23 |
/etc/acpi/default.sh were |
| 24 |
|
| 25 |
if [ "${ACTION}" == "brightness" ]; then |
| 26 |
echo -n "0$[${PARAMETER} / 14]" > /var/tmp/.brightd |
| 27 |
fi |
| 28 |
|
| 29 |
(acpid reported the brightness in a range between 0 and 100 while |
| 30 |
brightd expects to get the levels from sysfs, who are between 0 and |
| 31 |
7) |
| 32 |
|
| 33 |
Also note that you'll have to start brightd as root now, because |
| 34 |
other users don't have read permission on /dev/input/event*. |
| 35 |
Brightd will wait for X11 per default now, but you may deactivate |
| 36 |
the whole X11 interaction using -x now. |
| 37 |
|
| 38 |
"But don't you worry" - it will drop it's privileges as soon as it |
| 39 |
has opened all necessary files. If you drop privileges to a user |
| 40 |
also having read access to /dev/input, brightd will automatically |
| 41 |
open new files in that directory upon creation (pe when you attach |
| 42 |
an USB mouse) |
| 43 |
|
| 44 |
PREREQUISITES |
| 45 |
A recent kernel with an extension providing access to your LCD's |
| 46 |
brightness controls through /sys/class/backlight. |
| 47 |
The kernel must have CONFIG_INPUT_EVDEV enabled (which is default) |
| 48 |
|
| 49 |
For example, IBM thinkpad owners should have CONFIG_IBM_ACPI set. |
| 50 |
|
| 51 |
Additionally, users should have write permissions: |
| 52 |
chmod g+w /sys/class/backlight/*/brightness |
| 53 |
chgrp users /sys/class/backlight/*/brightness |
| 54 |
You might have to put this in your init.d or so |
| 55 |
|
| 56 |
COMPILING |
| 57 |
If compiled with x11 support brightd needs X11 and the |
| 58 |
X11 screensaver extensions (libXss) installed. |
| 59 |
|
| 60 |
Simply change into the source directory and type "make" to |
| 61 |
compile it. The output executable will be called "brightd". |
| 62 |
|
| 63 |
INSTALLATION |
| 64 |
Copy brightd to some directory inside your $PATH (like |
| 65 |
/usr/local/bin). Put it into an init script and enjoy. |
| 66 |
|
| 67 |
USAGE |
| 68 |
See the manpage. |
| 69 |
|
| 70 |
Q&A |
| 71 |
|
| 72 |
BRIGHTD STARTS, BUT DOES NOT WORK |
| 73 |
brightd will not work in three situations. If you intend to test |
| 74 |
it, avoid those: |
| 75 |
- brightd won't do anything when xscreensaver is |
| 76 |
deaktivated. (This prevents the screen to go dark when |
| 77 |
you're watching a movie) |
| 78 |
- It won't do anything when AC is plugged in. |
| 79 |
- It won't do anything either when the highest brightness |
| 80 |
level is chosen. |
| 81 |
Use "-f" to override the latter two. |
| 82 |
|
| 83 |
BRIGHTD STARTS, BUT DOES NOT CONNECT TO X11 |
| 84 |
Make sure your auth settings allow clients started on the same |
| 85 |
machine by root to connect to X11. For gdm users, starting brightd |
| 86 |
with |
| 87 |
XAUTHORITY="/var/gdm/:0.Xauth" brightd ... |
| 88 |
might help. |
| 89 |
|
| 90 |
MY SYNAPTICS TOUCHPAD ISN'T RECOGNIZED |
| 91 |
Sadly, synaptics does not create a device in /dev/input; if you |
| 92 |
want to have events from your touchpad considered, use brightd < 0.3. |
| 93 |
|
| 94 |
LICENSE |
| 95 |
GPL, of course. See gpl.txt |
| 96 |
|
| 97 |
AUTHOR |
| 98 |
Phillip Berndt |
| 99 |
www.pberndt.com |
| 100 |
|
| 101 |
Please excuse any language mistakes. I'm no native english |
| 102 |
speaker ;) |
| 103 |
|
| 104 |
CONTRIBUTORS |
| 105 |
Richard Weinberger <richard at nod dot at> |
| 106 |
Hannes von Haugwitz <hannes at vonhaugwitz dot com> |
| 107 |
|