I am using ...
Laptop: Acer Aspire 4736z
Graphics: Intel GMA 4500M
OS: Ubuntu Maverick Meerkat (10.10)
Kernel: 2.6.35-23-generic
And I managed to solve this problem for myself using some modified scripts/advice from other forum posts.
First, create a folder on your desktop called "brightness", go into the directory, create two files: brup and brdn, and set their permissions to execute.
Code:
mkdir /home/<YOUR_USERNAME>/Desktop/brightness
cd /home/<YOUR_USERNAME>/Desktop/brightness
touch brup brdn
chmod 0755 br*
Next, we'll edit "brup"
Adding the following text to "brup"
Code:
#!/bin/bash
# these are the possible values:
# 00 19 32 4b 64 7d 96 af c8 e1 ff
# 100 90 80 70 60 50 40 30 20 10 00
Current=`sudo setpci -s 00:02.0 F4.B`
case $Current in
e1)
sudo setpci -s 00:02.0 F4.B=c8
;;
c8)
sudo setpci -s 00:02.0 F4.B=af
;;
af)
sudo setpci -s 00:02.0 F4.B=96
;;
96)
sudo setpci -s 00:02.0 F4.B=7d
;;
7d)
sudo setpci -s 00:02.0 F4.B=64
;;
64)
sudo setpci -s 00:02.0 F4.B=4b
;;
4b)
sudo setpci -s 00:02.0 F4.B=32
;;
32)
sudo setpci -s 00:02.0 F4.B=19
;;
19)
sudo setpci -s 00:02.0 F4.B=00
;;
*)
sudo setpci -s 00:02.0 F4.B=00
;;
esac
Now we "Save" the file and "Close" gedit.
Next, we'll edit "brdn"
Adding the following text to "brdn"
Code:
#!/bin/bash
# these are the possible values:
# 00 19 32 4b 64 7d 96 af c8 e1 ff
# 100 90 80 70 60 50 40 30 20 10 00
Current=`sudo setpci -s 00:02.0 F4.B`
case $Current in
00)
sudo setpci -s 00:02.0 F4.B=19
;;
19)
sudo setpci -s 00:02.0 F4.B=32
;;
32)
sudo setpci -s 00:02.0 F4.B=4b
;;
4b)
sudo setpci -s 00:02.0 F4.B=64
;;
64)
sudo setpci -s 00:02.0 F4.B=7d
;;
7d)
sudo setpci -s 00:02.0 F4.B=96
;;
96)
sudo setpci -s 00:02.0 F4.B=af
;;
af)
sudo setpci -s 00:02.0 F4.B=c8
;;
c8)
sudo setpci -s 00:02.0 F4.B=e1
;;
*)
sudo setpci -s 00:02.0 F4.B=e1
;;
esac
Now we "Save" the file and "Close" gedit.
Next, we would like to put those files somewhere in the System. I chose to create a directory called "brightness" in the "/usr/bin" path. After that, we copy the scripts we just wrote (brup & brdn) to that path.
Code:
sudo mkdir /usr/bin/brightness
sudo cp * /usr/bin/brightness
Now we want to change the "sudoers" file so that we can execute these scripts without having to enter a password each time.
Code:
sudo gedit /etc/sudoers
After the line "#Cmnd alias specification", we want to add a line aliasing our brightness commands.
Code:
# Cmnd alias specification
Cmnd_Alias BRIGHT_CMDS = /usr/bin/brightness/brup, /usr/bin/brightness/brdn
And at the very bottom of the file (AFTER the line "%admin ALL=(ALL) ALL"), we want to add a line permitting all users to execute those scripts without having to enter a password.
Code:
ALL ALL=(ALL) NOPASSWD: BRIGHT_CMDS
Now we "Save" the file and "Close" gedit.
Painful terminal crap is over ... So close it!
Now we go to the menu-bar selecting from the cascading options: System -> Preferences -> Keyboard Shortcuts
In the box that opens, click the "Add" button and enter the following:
Code:
Name: Brightness Up
Command: gksudo /usr/bin/brightness/brup
And click "Apply".
Next we click the "Add" button again and enter the following:
Code:
Name: Brightness Down
Command: gksudo /usr/bin/brightness/brdn
And click "Apply".
Now, if you look at the bottom of the list of Keyboard Shortcuts, you should see two "Custom Shortcuts" (the ones you just entered).
If you click on the right side of the listings (in the "Shortcut" column), you will be able to enter a keystroke (or combination) that will activate your "Brightness Up" and "Brightness Down" actions.
For me, I chose CTRL+WIN+RIGHT_ARROW for "Brightness Up" and CTRL+WIN+LEFT_ARROW for "Brightness Down. But you can use any keystrokes you like as long as they don't conflict with other existing shortcuts.
Now click "Close" in the "Keyboard Shortcuts" box.
THAT'S IT! You should be good to go now. Give it a try with your selected keystrokes and see if it works for you. I sure hope this helps someone.
Bookmarks