Guest User

screen brightness auto ajustment according to lighting

a guest
Nov 11th, 2016
183
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. TMPFILE=`mktemp /tmp/tmp.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.jpg`
  3. fswebcam --jpeg 95 $TMPFILE
  4. AVG=`convert $TMPFILE -format "%[mean]" info:`
  5. BRIGHT=`echo $AVG | awk '{print int($1/65535*100+30)}'`
  6. xbacklight -set $BRIGHT -time 2000
  7. rm -rf $TMPFILE
RAW Paste Data