Results 1 to 6 of 6

Thread: monitor brightness not saved on shutdown

  1. #1
    Join Date
    Nov 2015
    Beans
    3

    monitor brightness not saved on shutdown

    Hello all,

    I recently installed ubuntu 14.04 LTS on my Vaio laptop and am really happy with it. I do have two issues of which I will list one here.

    The brightness level in system preferences is not saved on shutdown. So each time I startup the screen is at full brightness. Anyone any ideas on how to troubleshoot this?

  2. #2
    Join Date
    Apr 2014
    Beans
    25
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: monitor brightness not saved on shutdown

    There's already been a topic on this, but I had to modify it some to make it work. Based on sophie5's post at http://ubuntuforums.org/showthread.p...556&p=13217954:

    Step 1

    Create two scripts in your home directory.

    Put the following in ~/brightness-save.sh:
    Code:
    #!/bin/bash
    
    
    SAVEFILE="/var/brightness/last_brightness"
    
    
    mkdir -p $(dirname $SAVEFILE)
    
    
    cat /sys/class/backlight/acpi_video0/brightness > $SAVEFILE
    #echo "Current screen brightness saved as "$(cat $SAVEFILE)"."
    
    
    exit 0
    And put this in ~/brightness-reset.sh:
    Code:
    #!/bin/bash
    
    
    DEFAULT_BRIGHTNESS=7
    SAVEFILE="/var/brightness/last_brightness"
    
    
    if [ -f $SAVEFILE ];
    then
       echo $(cat $SAVEFILE) > /sys/class/backlight/acpi_video0/brightness
        #echo "Screen brightness reset to "$(cat $SAVEFILE)"."
    else
       echo $DEFAULT_BRIGHTNESS > /sys/class/backlight/acpi_video0/brightness
        #echo "Screen brightness set to default ("$DEFAULT_BRIGHTNESS")."
    fi
    
    
    exit 0
    Step 2
    Open a terminal, go to your home directory (cd ~/) and run the following commands, one after another:

    Code:
    sudo bash
    cp ./brightness-reset.sh /etc/init.d
    cp ./brightness-save.sh /etc/init.d
    chmod +x /etc/init.d/brightness-reset.sh
    chmod +x /etc/init.d/brightness-save.sh
    ln -s /etc/init.d/brightness-save.sh /etc/rc0.d/S10brightness-save
    ln -s /etc/init.d/brightness-save.sh /etc/rc6.d/S10brightness-save
    exit
    Step 3
    Open the file /etc/rc.local as root:
    Code:
    gksudo gedit /etc/rc.local
    If gksudo isn't installed, install it:
    Code:
    sudo apt-get install gksu
    Insert the following code just before line with exit 0. (be sure to save it afterwards)
    Code:
    etc/init.d/brightness-reset.sh
    Step 4
    You can delete brightness-save.sh and brightness-reset.sh from your home directory.

    Tested and working on my Acer Aspire E11 with 14.04.

  3. #3
    Join Date
    Nov 2015
    Beans
    3

    Re: monitor brightness not saved on shutdown

    OK I tried this, unfortunately it didn't work. I am however not used to using terminal so at first I have executed the commands in brightness-save.sh in terminal. That went until the last line
    cat /sys/class/backlight/acpi_video0/brightness > $SAVEFILE

    Not sure if that messed things up but unfortunately no fix just yet. Anything I can check or try?


    Thanks for your help!

  4. #4
    Join Date
    Apr 2014
    Beans
    25
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: monitor brightness not saved on shutdown

    Make sure you've rebooted at least once since you set the brightness scripts up (to make sure there is (or at least should be) a brightness save file) then execute these commands and post the output (in code tags please):
    Code:
    cat /var/brightness/last_brightness
    cat /sys/class/backlight/acpi_video0/brightness
    cat /etc/init.d/brightness-save.sh
    cat /etc/init.d/brightness-reset.sh
    ls -l /etc/rc0.d/S10brightness-save /etc/rc6.d/S10brightness-save
    cat /etc/rc.local
    This will help us debug what is going on.

    Also, what do you mean by "that went until the last line"? Did the last line give an error? If it did, please post the error, again in code tags please.

    EDIT: Just looked at some posts about controlling brightness levels on Vaios; I'm going to wait for you to post the output of those commands but if I'm right I think I know what's going on and how to fix it.
    Last edited by Melnik_Hoogland; November 26th, 2015 at 12:46 AM.

  5. #5
    Join Date
    Nov 2015
    Beans
    3

    Re: monitor brightness not saved on shutdown

    Hi Melnik,

    Last night it din't work out but this morning it did! Don't know why but it does so I'm a happy camper now!

    Thanks a lot!

    Daobra

  6. #6
    Join Date
    Apr 2014
    Beans
    25
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: monitor brightness not saved on shutdown

    No problem. Please mark the thread as solved from the "Thread Tools" menu right above the first post in 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
  •