Im personally using Vaio VPCCW21FX (Nvidia Graphic) and Ubuntu Studio 11.10 ..
I tried many solutions and nothing could resolve my problem with LCD brightness!
Finally wrote these two perl files to manually set brightness/Contrast and Gamma functions inside Nvidia driver config file.
This will be helpfull only if you are able to change brightness within Nvidia X Server Settings
Step 1: create this file and name it "Brightness-Up.pl"
(you can use any text editing tool like : gedit,nano,vi,etc.. copy & paste)
### Code by forgottenrip@yahoo.com ###
my $find1 = "0/RedBrightness=";my $find2 = "0/RedGamma=";
open FILE, "<Nvidia-Settings.cfg";
my @lines = <FILE>;
for (@lines) {
if ($_ =~ /$find1/) { chomp $_;$value= substr($_,16,5); }
if ($_ =~ /$find2/) { chomp $_;$value2= substr($_,11,5);}
}
my @Lines;
if ( $value > 0.0) { $value = $value - 0.30 };
if ( $value2 > 1.1) { $value2 = $value2 - 0.08 };
$last_value = $value + 0.30;
$Lines[0] ="0/RedBrightness=".$last_value;
$Lines[1] ="0/GreenBrightness=".$last_value;;
$Lines[2] ="0/BlueBrightness=".$last_value;;
$last_value = $value + 0.30;
$Lines[3] ="0/RedContrast=".$last_value;;
$Lines[4] ="0/GreenContrast=".$last_value;;
$Lines[5] ="0/BlueContrast=".$last_value;;
$last_value = $value2 + 0.08;
$Lines[6] ="0/RedGamma=".$last_value;;
$Lines[7] ="0/GreenGamma=".$last_value;;
$Lines[8] ="0/BlueGamma=".$last_value;;
$filename = "Nvidia-Settings.cfg";
open fh2,'>',$filename or die ("can't open '$filename': $! \n");
foreach ( @Lines )
{ chomp;print "$_\n";print fh2 "$_\n"; };
close fh2;
`nvidia-settings -l --config=Nvidia-Settings.cfg`;
Step 2: then make another file, name it "Brightness-Down.pl" and fill with this code:
### Code by forgottenrip@yahoo.com ###
my $find1 = "0/RedBrightness=";my $find2 = "0/RedGamma=";
open FILE, "<Nvidia-Settings.cfg";
my @lines = <FILE>;
for (@lines) {
if ($_ =~ /$find1/) {chomp $_;$value= substr($_,16,5);}
if ($_ =~ /$find2/) {chomp $_;$value2= substr($_,11,5);}
}
my @Lines;
if ( $value < -0.80) { $value = $value + 0.30 };
if ( $value2 < 0.8) { $value2 = $value2 + 0.08 };
$last_value = $value - 0.30;
$Lines[0] ="0/RedBrightness=".$last_value;
$Lines[1] ="0/GreenBrightness=".$last_value;;
$Lines[2] ="0/BlueBrightness=".$last_value;;
$last_value = $value - 0.30;
$Lines[3] ="0/RedContrast=".$last_value;;
$Lines[4] ="0/GreenContrast=".$last_value;;
$Lines[5] ="0/BlueContrast=".$last_value;;
$last_value = $value2 - 0.08;
$Lines[6] ="0/RedGamma=".$last_value;;
$Lines[7] ="0/GreenGamma=".$last_value;;
$Lines[8] ="0/BlueGamma=".$last_value;;
$filename = "Nvidia-Settings.cfg";
open fh2,'>',$filename or die ("can't open '$filename': $! \n");
foreach ( @Lines )
{ chomp;print "$_\n";print fh2 "$_\n"; };
close fh2;
`nvidia-settings -l --config=Nvidia-Settings.cfg`;
Step 3: You need to create another file which contains Nvidia Settings..
name it "Nvidia-Settings.cfg" its important that you write name exactly same.
fill with:
0/RedBrightness=0.1
0/GreenBrightness=0.1
0/BlueBrightness=0.1
0/RedContrast=0.1
0/GreenContrast=0.1
0/BlueContrast=0.1
0/RedGamma=1.14
0/GreenGamma=1.14
0/BlueGamma=1.14
Thats it! now place these files in unique folder.. you have to bind your Function Keys to these two perl file.you can use Compiz>commands to do that.
Run below command to install the compizconfig-settings-manager
sudo apt-get install compizconfig-settings-manager
or even you can run seperately with these two commands in shell (terminal):
user$ perl Brightness/Brightness-Up.pl
user$ perl Brightness/Brightness-Down.pl
where Brightness is folder I put those files in it.
LCD Brightness Control
Once you have installed the proprietary Nvidia drivers as suggested above, you may notice that your brightness control keys do not work properly. This is fixable by editing one's xorg.conf file. Open a terminal window and type the following:
sudo nano /etc/X11/xorg.conf
This will open your X server configuration (after prompting for your password). You should see a section titled "Device" that looks as follows:
Section "Device"
Identifier "Default Device"
Driver "nvidia"
Option "NoLogo" "True"
EndSection
Append a line so it appears like this:
Section "Device"
Identifier "Default Device"
Driver "nvidia"
Option "NoLogo" "True"
Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection
You will need to restart your graphical server (or reboot) for this change to take effect.
Best Answer
it happened to me
my system info ubuntu 14.04
nvidia gt330m
HOW I SOLVED IT
note: if you havent installed nvidia driver. Install it before you continue this.
in terminal
this creates /etc/X11/xorg.conf . edit it.
find Section "device" in text. and add this
it shold look like it on the rightside
save changes (ctrl+S).
log out. log in.
we are done!! now Fn + Up,Down is adjusting the brightness.