summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorchristian2015-06-09 21:23:36 +0200
committerchristian2015-06-09 21:23:36 +0200
commitd290d2c4035ff78596ef52f5123e3b3cd6cdff51 (patch)
tree64e8e2dff3ba57d71fab0076844f7b4579d02be8
downloadaur-d290d2c4035ff78596ef52f5123e3b3cd6cdff51.tar.gz
Initial import
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD40
-rw-r--r--brightd.install9
-rw-r--r--brightd.service10
-rw-r--r--proposal.patch55
5 files changed, 133 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..ef0899324b33
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = brightd
+ pkgdesc = Automatically dims screen when there is no user input (like a macbook :-).
+ pkgver = 0.4.1
+ pkgrel = 3
+ url = http://www.pberndt.com/Programme/Linux/brightd/
+ install = brightd.install
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ depends = libxss
+ source = http://www.pberndt.com/raw/Programme/Linux/brightd/_download/brightd-0.4.1.tar.bz2
+ source = brightd.service
+ source = proposal.patch
+ md5sums = 42f1572c51162bf583d6436c3b36cc17
+ md5sums = f5d5c7ed5c48d2dbe408986d5f6249fb
+ md5sums = a4717b49eb0494de57d19a3a574462ec
+
+pkgname = brightd
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..267210587511
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# Contributor: Cheer Xiao <xiaqqaix AT gmail DOT com>
+# Contributor: Leo Scherer <aur AT leo-scherer DOT de>
+# original Contributor: Niklas Schmuecker (IRC: nisc) <nschmuecker (gmail)>
+
+pkgname=brightd
+pkgver=0.4.1
+pkgrel=3
+pkgdesc='Automatically dims screen when there is no user input (like a macbook :-).'
+arch=('i686' 'x86_64')
+license=('GPL2')
+url='http://www.pberndt.com/Programme/Linux/brightd/'
+depends=('libxss')
+install='brightd.install'
+source=("http://www.pberndt.com/raw/Programme/Linux/brightd/_download/$pkgname-$pkgver.tar.bz2" 'brightd.service' 'proposal.patch')
+
+md5sums=('42f1572c51162bf583d6436c3b36cc17'
+ 'f5d5c7ed5c48d2dbe408986d5f6249fb'
+ 'a4717b49eb0494de57d19a3a574462ec')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ # fixes AC-detection by moving to /sys, blocks intel_backlight
+ # and makes fade smoother
+ patch -p1 -i $startdir/proposal.patch
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+ install -Dsm755 "$srcdir/$pkgname-$pkgver/brightd" \
+ "$pkgdir/usr/bin/brightd"
+ install -Dm644 "$srcdir/$pkgname-$pkgver/brightd.1" \
+ "$pkgdir/usr/share/man/man1/brightd.1"
+ install -Dm644 "$srcdir/$pkgname-$pkgver/README" \
+ "$pkgdir/usr/share/doc/brightd/README"
+ install -Dm644 "$srcdir/brightd.service" \
+ "$pkgdir/usr/lib/systemd/system/brightd.service"
+}
diff --git a/brightd.install b/brightd.install
new file mode 100644
index 000000000000..70c25fca5b93
--- /dev/null
+++ b/brightd.install
@@ -0,0 +1,9 @@
+post_install() {
+ cat <<EOF
+
+To change startup paramters, copy /usr/lib/systemd/system/brightd.service to
+/etc/systemd/system/ and modify ExecStart.
+
+See brightd(1) for available parameters.
+EOF
+}
diff --git a/brightd.service b/brightd.service
new file mode 100644
index 000000000000..8f1b847c6061
--- /dev/null
+++ b/brightd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Automatically fade screen when idle
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/brightd -vx
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
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;