summarylogtreecommitdiffstats
path: root/proposal.patch
diff options
context:
space:
mode:
authorchristian2015-06-09 21:23:36 +0200
committerchristian2015-06-09 21:23:36 +0200
commitd290d2c4035ff78596ef52f5123e3b3cd6cdff51 (patch)
tree64e8e2dff3ba57d71fab0076844f7b4579d02be8 /proposal.patch
downloadaur-d290d2c4035ff78596ef52f5123e3b3cd6cdff51.tar.gz
Initial import
Diffstat (limited to 'proposal.patch')
-rw-r--r--proposal.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/proposal.patch b/proposal.patch
new file mode 100644
index 000000000000..31797a99ae3a
--- /dev/null
+++ b/proposal.patch
@@ -0,0 +1,55 @@
+--- a/brightd.c 2008-10-19 23:10:21.000000000 +0200
++++ b/brightd.c 2011-11-09 22:01:24.394594536 +0100
+@@ -172,7 +172,7 @@
+ }
+
+ /* We had to disable signal handler and alarm because of this: */
+- usleep(200);
++ usleep(10000);
+ }
+ signal(SIGALRM, signalHandlerAlarm);
+ alarm(saved);
+@@ -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);
+ } /*}}}*/
+
+ /*
+@@ -280,6 +279,7 @@
+ * Load default brightness class into b_class
+ */
+ void loadDefaultClass() /*{{{*/
++
+ {
+ struct dirent *dirEntry;
+ DIR *backlightDir = opendir("/sys/class/backlight");
+@@ -289,7 +289,7 @@
+ if(!dirEntry) {
+ break;
+ }
+- if(dirEntry->d_name[0] == '.') {
++ if(dirEntry->d_name[0] == '.' || !strcmp(dirEntry->d_name,"intel_backlight")) {
+ continue;
+ }
+ strcpy(b_class, dirEntry->d_name);
+@@ -325,7 +325,7 @@
+
+ if(isDark == 0) {
+ /* Check if fading is okay */
+- if(isOnAC() && force < 2) {
++ if(isOnAC() == 1 && force < 2) {
+ info("Would fade, but on AC");
+ alarm(waitSeconds);
+ return;