Site Tools


backlightcontrol

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
backlightcontrol [2011/09/16 16:11] – created svenbacklightcontrol [2011/11/05 13:33] (current) – fixed toggle script excogitation
Line 10: Line 10:
 current=$(cat $backlight) current=$(cat $backlight)
 new=$((current +25)) new=$((current +25))
-if ((new 255 )); then+if [ $new -gt 255 ]; then
    new=255    new=255
 fi fi
 +
 echo $new > $backlight echo $new > $backlight
 </code> </code>
Line 25: Line 26:
 current=$(cat $backlight) current=$(cat $backlight)
 new=$((current - 25)) new=$((current - 25))
-if ((new )); then+if [ $new -lt ]; then
    new=0    new=0
 fi fi
 echo $new > $backlight echo $new > $backlight
 </code> </code>
 +use new=3 if you don't want your screen to go black on the lowest setting
  
 /usr/local/bin/backlight_toggle /usr/local/bin/backlight_toggle
Line 41: Line 43:
 current=$(cat $backlight) current=$(cat $backlight)
  
-if ((current == 0)); then+if [ $current -eq ]; then
    cat $old_file > $backlight    cat $old_file > $backlight
 else else
Line 53: Line 55:
 <code> <code>
 KERNEL=="pwm-backlight" SUBSYSTEM=="backlight" RUN+="/bin/chmod 664 /sys/class/backlight/pwm-backlight/brightness" KERNEL=="pwm-backlight" SUBSYSTEM=="backlight" RUN+="/bin/chmod 664 /sys/class/backlight/pwm-backlight/brightness"
-KERNEL=="pwm-backlight" SUBSYSTEM=="backlight" RUN+="/bin/chgrp admin /sys/class/backlight/pwm-backlight/brightness+KERNEL=="pwm-backlight" SUBSYSTEM=="backlight" RUN+="/bin/chgrp admin /sys/class/backlight/pwm-backlight/brightness"
 </code> </code>
  
backlightcontrol.1316182312.txt.gz · Last modified: 2011/09/16 16:11 by sven