Last active
February 20, 2020 10:26
-
-
Save pfcoperez/5473a21ffd6360d0ddabcd875d3b660d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BLIGHT_PATH=$(sudo find /sys -type d -name intel_backlight) | |
MAX_BRIGHTNESS=$(cat $BLIGHT_PATH/max_brightness) | |
while [ 1 ]; do | |
echo "$MAX_BRIGHTNESS*$(fswebcam --png -1 - | convert - -colorspace gray -format "%[fx:mean]" info:)" | \ | |
bc -l | cut -d '.' -f 1 | \ | |
sudo tee $BLIGHT_PATH/brightness; | |
sleep 10; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment