Package: brightd

Something like this is needed:

@@ -184,15 +184,14 @@
 int isOnAC() /*{{{*/
 {
        char line[255];
-       FILE *ac = fopen("/proc/acpi/ac_adapter/AC/state", "r");
+       FILE *ac = fopen("/sys/class/power_supply/AC/online", "r");
        if(!ac) {
                /* Ignore this */
                return 0;
        }
        fgets(line, 255, ac);
        fclose(ac);
-
-       return strstr(line, "on-line") != NULL;
+       return atoi(line);
 } /*}}}*/

 /*


-- 
Cheers,
  Andrew


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to