You are not logged in.

#1 2011-10-11 21:12:23

tasty_minerals
Member
Registered: 2011-03-30
Posts: 191

[SOLVED] Setting LCD brightness in terminal

I'm trying to set LCD brightness in script. But unfortunately the desired command do not work.
I've grepped my VGA card number

01:05.0 VGA compatible controller: ATI Technologies Inc RS780M/RS780MN [Radeon HD 3200 Graphics]

"setpci -s 01:05.0 F4.B=F0" do not change the brightness whatever value I use.
My pc is a thinkpad laptop. If there is any workaround?

Last edited by tasty_minerals (2011-10-12 20:13:37)


lenovo thinkpad EDGE 13'

Offline

#2 2011-10-11 21:25:07

roygbiv
Member
Registered: 2011-05-18
Posts: 204

Re: [SOLVED] Setting LCD brightness in terminal

try using xbacklight or echo [0-24] > /sys/class/backlight/acpi_video0/brightness as root

Offline

#3 2011-10-11 21:34:21

tasty_minerals
Member
Registered: 2011-03-30
Posts: 191

Re: [SOLVED] Setting LCD brightness in terminal

"echo [0-15] > /sys/class/backlight/acpi_video0/brightness" works.
Thank you


lenovo thinkpad EDGE 13'

Offline

#4 2011-10-11 22:03:39

tasty_minerals
Member
Registered: 2011-03-30
Posts: 191

Re: [SOLVED] Setting LCD brightness in terminal

Now could somebody help me a little bit with the script.
Bumped here
sudo echo 8 > /sys/class/backlight/acpi_video0/brightness :Permission denied
I understand that first time sudo is invoked only for echo command, how can I make it actually run the whole chain?


lenovo thinkpad EDGE 13'

Offline

#5 2011-10-12 14:46:26

roygbiv
Member
Registered: 2011-05-18
Posts: 204

Re: [SOLVED] Setting LCD brightness in terminal

I used this script binded with two keys:

#!/bin/bash

file="/sys/class/backlight/acpi_video0/brightness"
level=$(cat $file)

if [[ "$#" -eq 0 ]]; then
    cat $file
elif [[ "$1" = "-" ]]; then
    echo $(( level - 1 )) > $file
elif [[ "$1" = "+" ]]; then
    echo $(( level + 1 )) > $file
fi

By adding the location of the script to root's $PATH, i.e $HOME/myscripts, it can be run with sudo. It accepts '+' and '-', but it can easily be changed to handle brightness [0-24] values I guess.

Last edited by roygbiv (2011-10-12 14:47:38)

Offline

#6 2011-10-12 20:13:26

tasty_minerals
Member
Registered: 2011-03-30
Posts: 191

Re: [SOLVED] Setting LCD brightness in terminal

roygbiv wrote:

I used this script binded with two keys:

#!/bin/bash

file="/sys/class/backlight/acpi_video0/brightness"
level=$(cat $file)

if [[ "$#" -eq 0 ]]; then
    cat $file
elif [[ "$1" = "-" ]]; then
    echo $(( level - 1 )) > $file
elif [[ "$1" = "+" ]]; then
    echo $(( level + 1 )) > $file
fi

By adding the location of the script to root's $PATH, i.e $HOME/myscripts, it can be run with sudo. It accepts '+' and '-', but it can easily be changed to handle brightness [0-24] values I guess.

thanks again, will try it out


lenovo thinkpad EDGE 13'

Offline

Board footer

Powered by FluxBB