1 --- a/brightd.c 2008-10-19 23:10:21.000000000 +0200
2 +++ b/brightd.c 2011-11-09 22:01:24.394594536 +0100
6 /* We had to disable signal handler and alarm because of this: */
10 signal(SIGALRM, signalHandlerAlarm);
16 - FILE *ac = fopen("/proc/acpi/ac_adapter/AC/state", "r");
17 + FILE *ac = fopen("/sys/class/power_supply/AC/online", "r");
25 - return strstr(line, "on-line") != NULL;
31 * Load default brightness class into b_class
33 void loadDefaultClass() /*{{{*/
36 struct dirent *dirEntry;
37 DIR *backlightDir = opendir("/sys/class/backlight");
42 - if(dirEntry->d_name[0] == '.') {
43 + if(dirEntry->d_name[0] == '.' || !strcmp(dirEntry->d_name,"intel_backlight")) {
46 strcpy(b_class, dirEntry->d_name);
50 /* Check if fading is okay */
51 - if(isOnAC() && force < 2) {
52 + if(isOnAC() == 1 && force < 2) {
53 info("Would fade, but on AC");