x

Programs, configuration and documentation that don't fit anywhere else
Log | Files | Refs | README | LICENSE

backlight (266B)


      1 #!/bin/sh
      2 
      3 dir=/sys/class/backlight/intel_backlight
      4 if ! test -e $dir
      5 then
      6 	echo $dir does not exist 1>&2
      7 	exit 1
      8 fi
      9 
     10 pct="0.$1"
     11 if test $1 -eq 100
     12 then
     13 	pct=1
     14 fi
     15 
     16 max=`cat $dir/max_brightness`
     17 echo $pct $max | awk '{
     18 	x = $1 * $2
     19 	print int(x)
     20 }' > $dir/brightness