Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Brightness issues

  1. #1
    Join Date
    Oct 2012
    Location
    USA
    Beans
    102
    Distro
    Ubuntu 16.04 Xenial Xerus

    Post Brightness issues

    Whenever I wake up my laptop from sleep or start it up, brightness is set to max.
    Is there any way I can set it lower by default?

  2. #2
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    5,169
    Distro
    Kubuntu

    Re: Brightness issues

    if we can find a command that will affect the backlight yes
    Code:
    xbacklight -set 50
    does that work on your system?
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

  3. #3
    Join Date
    Oct 2012
    Location
    USA
    Beans
    102
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Brightness issues

    It does not work...

  4. #4
    Join Date
    Feb 2012
    Location
    Athens/Greece
    Beans
    Hidden!
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Brightness issues

    Give the results of this command

    Code:
    ls /sys/class/backlight/*/
    Thanks

  5. #5
    Join Date
    Oct 2012
    Location
    USA
    Beans
    102
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Brightness issues

    Here you go:
    Code:
    /sys/class/backlight/acpi_video0/:
    actual_brightness  brightness  max_brightness  subsystem  uevent
    bl_power           device      power           type
    
    /sys/class/backlight/apple_backlight/:
    actual_brightness  brightness      power      type
    bl_power           max_brightness  subsystem  uevent
    
    /sys/class/backlight/intel_backlight/:
    actual_brightness  brightness  max_brightness  subsystem  uevent
    bl_power           device      power           type

  6. #6
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    5,169
    Distro
    Kubuntu

    Re: Brightness issues

    you may need to edit the BOLD parts of this post for this to work for you based on the output of ls /sys/class/backlight/
    I just made a script
    this is meant as a replacement for xbacklight
    Code:
    sudo apt-get remove xbacklight
    gksu gedit /usr/local/bin/xbacklight
    sudo chmod +x /usr/local/bin/xbacklight
    sudo chmod 777 /sys/class/backlight/acpi_video0/brightness
    script:
    Code:
    #!/bin/bash
    where="/sys/class/backlight/acpi_video0"
    max=`cat $where/max_brightness`
    current=`cat $where/actual_brightness`
    if [ "$1" == "--set" ];then
        if [ ! "`echo $2 | sed 's/[a-Z]//g'`" == "$2" ];then
            `dirname $0`/`basename $0`
            exit
        elif [ 0`echo "$2" | sed 's/.//' | grep "^[0-9]*$"` -gt 0 ] && [ ! "`echo \"$2\" | grep \"^[0-9]*$\"`" == "$2" ];then
            if [ "`echo ${2:0:1}`" == "+" ];then
                X=$(($current+`echo ${2:1}`))
            elif [ "`echo ${2:0:1}`" == "-" ];then
                X=$(($current-`echo ${2:1}`))
            else
                echo "${2:0:1} is not a +/-"
                exit
            fi
            if [ $X -gt $max ];then
                echo $max > $where/brightness
            elif [ $X -lt 0 ];then
                echo 0 > $where/brightness
            else
                echo $X > $where/brightness
            fi
            exit
        fi
        if [ ! "`echo \"$2\" | grep \"^[0-9]*$\"`" == "$2" ];then
            echo "$2 is not a Intiger"
        elif [ "$2" -lt $(($max+1)) ] && [ "$2" -gt -1 ];then
            echo $2 > $where/brightness
        elif [ "$2" -lt 0 ];then
            echo 0 > $where/brightness
        else
            echo $max > $where/brightness
        fi
    elif [ "$1" == "--get" ];then
        if [ "$2" == "current" ];then
            echo $current
        elif [ "$2" == "max" ];then
            echo $max
        else
            echo -e "Current: $current\nMaximum: $max"
        fi
    else
        echo -e "Usage:\n\t`basename $0` --set Int | +Int | -Int"
        echo -e "\t`basename $0` --get current | max | NULL"
    fi
    exit
    This makes the script not need sudo every time you reboot:
    Code:
    sudo sed '/^[^#]*exit 0/i chmod 777 /sys/class/backlight/acpi_video0/brightness \&' -i /etc/rc.local
    Attached Files Attached Files
    Last edited by pqwoerituytrueiwoq; October 9th, 2012 at 05:34 AM. Reason: Attached copy of script with installer
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

  7. #7
    Join Date
    Feb 2012
    Location
    Athens/Greece
    Beans
    Hidden!
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Brightness issues

    Hi ,
    is this script really needed ?
    I mean
    I would ask for the results of

    Code:
    sudo cat /sys/class/backlight/acpi_video0/brightness
    sudo cat /sys/class/backlight/apple_backlight/brightness
    sudo cat /sys/class/backlight/intel_backlight/brightness
    Then we can see what value affects the brightness
    with
    Code:
    echo "VALUE" | sudo tee /sys/class/backlight/acpi_video0/brightness
    bolds may change..

    and after we found what is the correct command , we could just add the command to /etc/rc.local .

    By the way , I don't know coding - scripting , I admire "scripters" and I wish will work.

    Thanks

  8. #8
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    5,169
    Distro
    Kubuntu

    Re: Brightness issues

    the script i made would pre-process the command you gave
    as long as VALUE is a valid value your command is the same as my script (except mine cat tell you your brightness and max brightness)
    with the script i made you could put xbacklight --set VALUE in the /etc/rc.local script
    could also make custom keyboard shortcuts for it to increase/decrease brightness

    there was one person who was not able to set the brightness in /etc/rc.local but it worked from a lightdm startupscript
    but that was using xbacklight whch may act like numlockx and require lightdm to be running to work
    Last edited by pqwoerituytrueiwoq; October 8th, 2012 at 10:31 PM.
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

  9. #9
    Join Date
    Feb 2012
    Location
    Athens/Greece
    Beans
    Hidden!
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Brightness issues

    Quote Originally Posted by pqwoerituytrueiwoq View Post
    could also make custom keyboard shortcuts for it to increase/decrease brightness
    OK!

    This is the advantage of your script .

    Cuz all other things seems to me the same.. But shortcuts , OK, this is an advantage.

  10. #10
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    5,169
    Distro
    Kubuntu

    Re: Brightness issues

    These are good for calling it from a script (i assume the min is 0 for everyone)
    xbacklight --get max
    xbacklight --get current

    This is good for humans
    xbacklight --get
    This is to increase the brightness
    xbacklight --set +2
    This is to decrease the brightness
    xbacklight --set -2
    This is to set the brightness
    xbacklight --set 5
    This is for the help output
    xbacklight
    xbacklight --help
    xbacklight -h
    xbacklight "I dont know what I am doing"
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

Page 1 of 2 12 LastLast

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
  •