summaryrefslogtreecommitdiff
path: root/README.md
blob: 05a4985cbddd87b6f7df82b60365d729e3a6acf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# write-intel-brightness

This is a script to control screen brightness on Lenovo ThinkPad X220 and similar after you changed PWM frequency by writing a custom value to 0xC8254 register. I use it with acpid.

The script reads current PWM frequency from the register, calculates correct new brightness level for `/sys/class/backlight/intel_backlight/brightness` and writes it.

### Usage

To increase brightness:
```
write-intel-brightness +
```

To decrease:
```
write-intel-brightness -
```

### acpid example

From `/etc/acpi/default.sh` on my Gentoo box:

```
case "$group" in
    video)
        case "$action" in
            brightnessup)
                /usr/local/bin/write-intel-brightness +
                ;;

            brightnessdown)
                /usr/local/bin/write-intel-brightness -
                ;;
        esac
        ;;
esac
```

### License

MIT