Results 1 to 10 of 16

Thread: Macbook Pro Adjust Backlight and Brightness Defaults

Hybrid View

  1. #1
    Join Date
    Jul 2012
    Beans
    7

    Macbook Pro Adjust Backlight and Brightness Defaults

    I installed 12.04 on my Macbook Pro 8,2 and am having trouble finding a way to adjust the keyboard backlight and screen brightness defaults. On boot the welcome screen always shows both at full brightness and doesn't allow me to change either with keyboard shortcuts. After I log in I am able to change the settings to a more comfortable level using the keyboard shortcuts but these settings are promptly erased when I reboot, defaulting back to the annoying full brightness/backlight when I log in again. How can I adjust these defaults? Is there a way to make Ubuntu remember my last setting for the next time I log in?

  2. #2
    Join Date
    Mar 2012
    Beans
    776
    Distro
    Ubuntu Development Release

    Re: Macbook Pro Adjust Backlight and Brightness Defaults

    I am not familiar with Macbooks so I can't tell you for sure. Macbooks does have BIOS or not? If they have check that in Bios. At least on the regular computer I solve my problem with Bios.

    I DON'T EVEN KNOW WHAT A QUANTAL QUETZAL IS...BUT IT SOUNDS LIKE PRETZEL AND I LIKE PRETZEL

  3. #3
    Join Date
    Jul 2012
    Beans
    7

    Re: Macbook Pro Adjust Backlight and Brightness Defaults

    I believe MacBooks use EFI (or at least new ones do, and I have a new one) because EFI is used with the new Intel technology Apple started using in 2006. However, according to Wiki (http://en.wikipedia.org/wiki/Unified...ing_EFI.2FUEFI), Macs still have BIOS compatibility because of a firmware update. Does that help? I'm pretty new to all this EFI/BIOS stuff so I'm just writing stuff I learned about five minutes ago.

  4. #4
    Join Date
    Mar 2012
    Beans
    776
    Distro
    Ubuntu Development Release

    Re: Macbook Pro Adjust Backlight and Brightness Defaults

    I don't know what Macbook has, definitely some kind of Bios. On normal computer if you hold delete (some laptops f2) during the boot up you are prompted to Bios screen, where you can adjust default brightnes. Try different keys and you will see.

    I DON'T EVEN KNOW WHAT A QUANTAL QUETZAL IS...BUT IT SOUNDS LIKE PRETZEL AND I LIKE PRETZEL

  5. #5
    Join Date
    Jul 2012
    Beans
    7

    Re: Macbook Pro Adjust Backlight and Brightness Defaults

    Will that work for the keyboard backlight too? And isn't there a way to control it with the GUI? Mac OS had no problem keeping my old settings when I logged in...

  6. #6
    Join Date
    Mar 2012
    Location
    Near one of my computers
    Beans
    307
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Macbook Pro Adjust Backlight and Brightness Defaults

    If you edit your /etc/rc.local file you can add a couple lines to set screen and keyboard brightness which is run shortly after boot.

    Code:
    echo '5' > /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness
    ## this adjusts the screen backlight, the values range from 1 to 15.
    
    echo '25' > /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
    ## this adjusts the keyboard brightness and ranges from 1 to 255.
    Those are the two lines I use. I have a macbook 8,1.

    Source: http://ubuntuforums.org/archive/inde...t-1010532.html

    You can adjust screen brightness with the gui.

    System settings > brightness and lock.

    I'm not sure if you can change the keyboard backlight with the gui.

    I don't think Ubuntu remembers the brightness setting on macbooks. Remember that they are different operating systems. Just because OS X behaves one way doesn't mean that Ubuntu has to.

    Kopkins
    Last edited by Kopkins; July 9th, 2012 at 05:17 PM.

  7. #7
    Join Date
    Oct 2011
    Location
    Canada
    Beans
    914
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Macbook Pro Adjust Backlight and Brightness Defaults

    Interesting....I have a 2012 13" Macbook Pro (non retina) and this seems to only work 50%. I can disable the keyboard backlight on boot but lowering screen brightness does NOT work. It still boots into 100% power even with the following rc.local:


    Code:
    #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing.  echo '3' > /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness echo '1' > /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness  exit 0

    I wondered why and when I ran just the below command in terminal, I got the below;

    Code:
    sudo echo '5' > /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness
    (with and without the '#')

    Code:
    sudo echo '5' > /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness: Permission denied
    Permission denied even with sudo?!
    Last edited by d4m1r; April 23rd, 2013 at 08:39 PM.
    613websites.com Budget Canadian Web Design and Hosting

  8. #8
    Join Date
    Oct 2011
    Location
    Canada
    Beans
    914
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Macbook Pro Adjust Backlight and Brightness Defaults

    Fix my own problem by just installing xbacklight...not sure why the above didn't work but it probably a bug. You can find xbacklight in the Ubuntu repo's (sudo apt-get install xbacklight) and you can find more info on it below;

    http://linux.die.net/man/1/xbacklight
    613websites.com Budget Canadian Web Design and Hosting

  9. #9
    Join Date
    Mar 2012
    Location
    Near one of my computers
    Beans
    307
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Macbook Pro Adjust Backlight and Brightness Defaults

    That's what I've ended up using. I created a simple script and modified the sudoers file. The echo thing won't work with sudo, because it needs root for the second half but not the first. So it would technically need to be
    Code:
    echo TEXT > sudo tee /path/to/file
    I modified the sudoers file and .bashrc to allow executing of the file backlight as root without a password. Then created an alias in ~/.bashrc
    Code:
    alias backlight='sudo backlight'
    Then the file script itself.
    Code:
    #!/bin/bash
    
    case $1 in
         low)
            xbacklight =20
            echo "$[((90 * 255) / 100) % 256]" > /sys/class/leds/smc\:\:kbd_backlight/brightness
            ;;
        med)
            xbacklight =50
            echo "$[((50 * 255) / 100) % 256]" > /sys/class/leds/smc\:\:kbd_backlight/brightness
            ;;
        high)
            xbacklight =70
            echo "$[((0 * 255) / 100) % 256]" > /sys/class/leds/smc\:\:kbd_backlight/brightness
            ;;
        max)
            xbacklight =100
            echo "$[((0 * 255) / 100) % 256]" > /sys/class/leds/smc\:\:kbd_backlight/brightness
            ;;
        *)
            echo $"Usage $0 {low|med|high|max}"
            exit 1
        
    esac
    
    exit
    Then have this file automatically run when you login. Don't forget to chmod +x
    Last edited by Kopkins; April 24th, 2013 at 03:33 AM.

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
  •