aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore9
-rw-r--r--[-rwxr-xr-x]Adjbacklight.java2
-rwxr-xr-xadjbacklight5
3 files changed, 14 insertions, 2 deletions
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
index 888beb6..7580208 100755..100644
--- 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