In my Ubuntu 14.0 (Dell Inspiron), brightness controls were not working at all. So I started searching for other alternatives to sets the brightness.
finally I found this xrandr.
it is great tool to set the brightness and even to rotate the screen.
--brightness flag can be used to set the brightness (best values: 0 - 1)
--brightness flag cab be used to rotate the screen (possible options : normal, left, right)
Usage:
./brightness_control.sh + # Increase the brightness by 0.05
./brightness_control.sh - # Decrease the brightness by 0.05
./brightness_control.sh 1 # Set brightness to 1
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 | |
# brightness_control.sh | |
_help() | |
{ | |
echo | |
echo "Usage:" | |
echo "$0 [No args] Sets/resets brightness to default (1.0)." | |
echo "$0 + Increments brightness by 0.5." | |
echo "$0 - Decrements brightness by 0.5." | |
echo "$0 Number Sets brightness to N (useful range .7 - 1.2)." | |
} | |
bright=$(xrandr --verbose | grep rightness | awk '{ print $2 }') | |
DISP_NAME=$(xrandr | grep LV | awk '{print $1}') | |
INCR=0.05 | |
case $1 in | |
+)bright=$(echo "scale=2; $bright + $INCR" | bc);; | |
-)bright=$(echo "scale=2; $bright - $INCR" | bc);; | |
*)_help && exit ;; | |
esac | |
xrandr --output "$DISP_NAME" --brightness "$bright" # See xrandr manpage. | |
echo "Current brightness = $bright" | |
exit |