Glad to hear. You can also map your FN brightness keys to adjust the brightness using xbacklight. Let me know if you'd like a script that would do that for you.
Glad to hear. You can also map your FN brightness keys to adjust the brightness using xbacklight. Let me know if you'd like a script that would do that for you.
Hi Toz,
Absolutely. If I could dim the screen by pressing FN+F5 and brighten it by pressing FN+F6 that would match the keys on my keyboard.
Try this (from a command prompt):
1. Create the script:
2. Paste in this code:Code:gksudo mousepad /usr/local/bin/brightness
3. Save the file.Code:#!/bin/bash # constants - edit as required UPPER=100 LOWER=0 INCREMENT=10 DECREMENT=10 # current xbacklight value CURRENT=`xbacklight -get | sed -e 's/\..*//g'` NEW=$CURRENT case $1 in up) if [ $(($CURRENT+$INCREMENT)) -le $UPPER ]; then NEW=$(($CURRENT+$INCREMENT)) fi ;; down) if [ $(($CURRENT-$DECREMENT)) -ge $LOWER ]; then NEW=$(($CURRENT-$DECREMENT)) fi ;; *) ;; esac # set the new backlight xbacklight -set $NEW exit 0
4. Make it executable:
5. Test it. From a command prompt, go nuts with the following two commands to see if it changes the brightness:Code:sudo chmod +x /usr/local/bin/brightness
If it works without any problems, go to Settings Manager, Keyboard, Application Shortcuts tab and create shortcuts for your FN+F5 and FN+F6 keys for the commands "brightness up" and "brightness down".Code:brightness up brightness down
If it doesn't work, post back any error messages that come up.
Hi Toz,
There are no error messages, but nothing happens when I enter the command, "brightness up". However, "brightness down" does work.
I tried to create the keyboard shortcut FN+F5 for the command "brightness down" but the "Shortcut Command" window that pops up when I press the "+Add" button only allows me to enter the command and not the shortcut. Am I missing something? Shouldn't there be a prompt beside "Shortcut:" where I enter the keys? I attached a screenshot, so you can see the window.
The brightness up command will only work if the brightness isn't at the maximum setting. Try brightness down a few times then brightness up. Does it work now?
To set the shortcuts, try the following:
1. Go to the Keyboard Shortcuts
2. Click the Add button and type in brightness up and press OK.
3. On the next screen, press Fn+F5 (or FN+F6) depending on which is the brightness up function key.
4. Repeat for brightness down.
Hi Toz,
I used "brightness down" before using the "up" command. I even set the backlight to 50% and the "up" command still doesn't work.
As for the shortcuts, I discovered that the "Fn" key is not being recognized for some reason. When I set the shortcut to "Ctrl+d" the "brightness down" command works.
I just verified that the script works on my system.
What happens when you type:
followed by:Code:xbacklight -set 50
Can you double-check that the script contents are correct?Code:xbacklight -set 100
EDIT: Also, can you do this:
1. Open a terminal window.
2. Run the command:3. Then press your Brightness up FN key (FN+F6?)Code:acpi_listen
4. Post back what is displayed in the terminal window
5. Then press your Brightness down FN key (FN+F5?)
6. Post back what is displayed in the terminal window
(source: http://code.google.com/p/vaio-f11-li...ogrammableKeys)
Last edited by Toz; August 5th, 2011 at 03:54 AM.
Learned a lot!
@123662981: You and me both!
@Toz: The "50" command dims the screen to 50% and the "100" command brings it back up to full brightness.
The script contents are exactly like you typed them. I copied and pasted them into mousepad.
When I type "acpi_listen", nothing happens when I press Fn+F5 or F6. When I press my shorcut, Ctrl+d, the green cursor blanks out and then returns to normal as the screen dims.
Looks like your system doesn't hear the function keys. Something else that needs to be investigated.
I've updated the script to include debugging info. Can you replace the current brightness script with this:
Then:Code:#!/bin/bash # constants - edit as required UPPER=100 LOWER=0 INCREMENT=10 DECREMENT=10 # current xbacklight value CURRENT=`xbacklight -get | sed -e 's/\..*//g'` NEW=$CURRENT case $1 in up) echo "DEBUG: up selected" echo "DEBUG: up->CURRENT="$CURRENT if [ $(($CURRENT+$INCREMENT)) -le $UPPER ]; then NEW=$(($CURRENT+$INCREMENT)) fi echo "DEBUG: up->NEW="$NEW ;; down) echo "DEBUG: down selected" echo "DEBUG: down->CURRENT="$CURRENT if [ $(($CURRENT-$DECREMENT)) -ge $LOWER ]; then NEW=$(($CURRENT-$DECREMENT)) fi echo "DEBUG: down->NEW="$NEW ;; *) ;; esac # set the new backlight echo "DEBUG: beforeset->current_xbacklight="`xbacklight -get | sed -e 's/\..*//g'` xbacklight -set $NEW echo "DEBUG: afterset->current_xbacklight="`xbacklight -get | sed -e 's/\..*//g'` exit 0
.....post back resultsCode:brightness down
.....post back resultsCode:brightness up
Bookmarks