From 5f7571b1f5ff1beccee4ce6a61f5641b42010a04 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 16 Nov 2012 20:09:23 +0100 Subject: misc + probe all backlights MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- .gitignore | 9 +++++++++ Adjbacklight.java | 2 +- adjbacklight | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .gitignore mode change 100755 => 100644 Adjbacklight.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b94d634 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +/_/ + +*.class + +*~ +\#.\# +.\#* +*.swp +*.bak diff --git a/Adjbacklight.java b/Adjbacklight.java old mode 100755 new mode 100644 index 888beb6..7580208 --- a/Adjbacklight.java +++ b/Adjbacklight.java @@ -27,7 +27,7 @@ public class Adjbacklight { public static void main(final String... args) throws IOException { - String dir = "/sys/class/backlight/intel_backlight/"; + String dir = "/sys/class/backlight/" + args[2] + "/"; int width = Integer.parseInt(args[1]); int max = 0, min = 0, cur = 0; diff --git a/adjbacklight b/adjbacklight index ccbea3e..fa35b09 100755 --- a/adjbacklight +++ b/adjbacklight @@ -35,7 +35,10 @@ on the terminal, the following commands should reset it: stty -icanon -echo if [[ $? = 0 ]]; then echo -en '\033[?25l' - sudo java -cp ${BASH_SOURCE%/*} Adjbacklight `stty size` + ls -1 --color=no "/sys/class/backlight/" | + while read dir; do + sudo java -cp ${BASH_SOURCE%/*} Adjbacklight `stty size` "$dir" + done echo -en '\033[?25h' stty icanon echo else -- cgit v1.2.3-70-g09d2