Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 33

Thread: How do I adjust the screen brightness in Xfce?

  1. #11
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: How do I adjust the screen brightness in Xfce?

    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.

  2. #12
    Join Date
    Jul 2011
    Beans
    17
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How do I adjust the screen brightness in Xfce?

    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.

  3. #13
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: How do I adjust the screen brightness in Xfce?

    Try this (from a command prompt):

    1. Create the script:
    Code:
    gksudo mousepad /usr/local/bin/brightness
    2. Paste in this code:
    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
    3. Save the file.

    4. Make it executable:
    Code:
    sudo chmod +x /usr/local/bin/brightness
    5. Test it. From a command prompt, go nuts with the following two commands to see if it changes the brightness:
    Code:
    brightness up
    brightness down
    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".

    If it doesn't work, post back any error messages that come up.

  4. #14
    Join Date
    Jul 2011
    Beans
    17
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How do I adjust the screen brightness in Xfce?

    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.
    Attached Images Attached Images

  5. #15
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: How do I adjust the screen brightness in Xfce?

    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.

  6. #16
    Join Date
    Jul 2011
    Beans
    17
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How do I adjust the screen brightness in Xfce?

    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.

  7. #17
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: How do I adjust the screen brightness in Xfce?

    I just verified that the script works on my system.

    What happens when you type:
    Code:
    xbacklight -set 50
    followed by:
    Code:
    xbacklight -set 100
    Can you double-check that the script contents are correct?

    EDIT: Also, can you do this:
    1. Open a terminal window.
    2. Run the command:
    Code:
    acpi_listen
    3. Then press your Brightness up FN key (FN+F6?)
    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.

  8. #18
    Join Date
    Aug 2011
    Beans
    1

    Re: How do I adjust the screen brightness in Xfce?

    Learned a lot!

  9. #19
    Join Date
    Jul 2011
    Beans
    17
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How do I adjust the screen brightness in Xfce?

    @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.

  10. #20
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: How do I adjust the screen brightness in Xfce?

    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:
    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
    Then:
    Code:
    brightness down
    .....post back results
    Code:
    brightness up
    .....post back results

Page 2 of 4 FirstFirst 1234 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •