You are not logged in.

#1 2011-07-14 06:36:04

Jankosevic
Member
Registered: 2008-07-06
Posts: 82

ASUS UL30VT - Brightness Control

Hello,

my Asus UL30VT is running Arch pretty nice and cool while the graphics card is turned off (nvidia_g210m_acpi).
I read a couple of article here on this message board that it is possible to bind the brightness control to some keys. However, since I am quite a Noob I don't know how I apply this on my machine.
Maybe you can help me? wink

For example here: https://bbs.archlinux.org/viewtopic.php … 86#p818186 it is describes how to do it. But I am not able to follow it.
I am using XFCE4 and the brightness control keys of my laptop just result in this little popup-window showing the increase and decrease of brightness. But this has no actual effect on the brightness. How do I manage to make it really work?

Thank you very much for your brief explanation so I can do it!

Offline

#2 2011-07-14 08:54:41

Sphaerophoria
Member
Registered: 2011-07-14
Posts: 41

Re: ASUS UL30VT - Brightness Control

What you need to do is install the acpid daemon.

sudo pacman -S acpid

Then make sure that your brightness keys are the same as mine

sudo rc.d start acpid

acpi_listen

*press the brightness keys*

hotkey ATKD 00000026 0000000a

hotkey ATKD 00000017 0000000b

Then you need to make some acpi scripts

sudo nano /etc/acpi/events/brnup

event=hotkey ATKD 0000002[0123456789abcdef]
action=/usr/bin/brightness up

sudo nano /etc/acpi/events/brndown
event=hotkey ATKD 0000001[0123456789abcdef]
action=/usr/bin/brightness down

Now all that's left is to make the brightness script in /usr/bin/brightness

sudo nano /usr/bin/brightness


#!/bin/bash
export SEED=2
if [ ! -f ~/.brightness ]; then
       echo 99 > ~/.brightness;
fi
export BRIGHTNESS=`cat ~/.brightness`
case "$1" in
       "up")
               export BRIGHTNESS=$[$BRIGHTNESS+$SEED];
       ;;
       "down")
               export BRIGHTNESS=$[$BRIGHTNESS-$SEED];
       ;;
       *)
               export BRIGHTNESS=1;
       ;;
esac
if [ "$BRIGHTNESS" -gt "99" ]; then
       export BRIGHTNESS=99;
fi
if [ "$BRIGHTNESS" -gt "0" ]; then
       echo $BRIGHTNESS > ~/.brightness
       setpci -s 00:02.0 F4.B=$BRIGHTNESS
fi
if [ "$BRIGHTNESS" -lt "0" ]; then
       echo "This makes your screen off";
fi

chmod +x /usr/bin/brightness

reload the acpid daemon

sudo rc.d restart acpid

you should be good to go

as a side note if the brightness dialogue is coming up your nvidia card is probably stilll on

Offline

#3 2011-07-14 09:12:22

Jankosevic
Member
Registered: 2008-07-06
Posts: 82

Re: ASUS UL30VT - Brightness Control

Thank you so much! Works perfectly!

However, I had to switch event=hotkey ATKD 0000002[0123456789abcdef] and event=hotkey ATKD 0000002[0123456789abcdef] because in my case the keys were the opposite.

Offline

#4 2011-07-14 10:55:53

Jankosevic
Member
Registered: 2008-07-06
Posts: 82

Re: ASUS UL30VT - Brightness Control

I just realized that it appears that after using those keys the brightness is not going to be as bright as at the beginning anymore.
In fact the screen looks a bit darker even after being at 100% brightness using the key bindings...

What can I try to fix this?

Offline

#5 2011-07-14 17:53:22

Sphaerophoria
Member
Registered: 2011-07-14
Posts: 41

Re: ASUS UL30VT - Brightness Control

The brightness keys was my bad... I get the backwards every new install wink. Also I haven't gotten around the screen being darker issue... I rarely notice it so it's not a big deal for me. I think it's something to do with the setpci method? I'm also a noob so i can't help out that much there tongue

Offline

#6 2011-11-11 08:23:53

Slart
Member
From: Lund, Sweden
Registered: 2011-11-11
Posts: 1

Re: ASUS UL30VT - Brightness Control

Jankosevic wrote:

I just realized that it appears that after using those keys the brightness is not going to be as bright as at the beginning anymore.
In fact the screen looks a bit darker even after being at 100% brightness using the key bindings...

What can I try to fix this?

The brightness value isn't a decimal value but a hexadecimal value. If you run

setpci -s 00:02.0 F4.B=ff

it should be at full brightness, at least that's what it does on my laptop. A brightness value of 99 would be barely 60% of max in comparison.

you can change the line where you set the brightness from

setpci -s 00:02.0 F4.B=$BRIGHTNESS

to

setpci -s 00:02.0 F4.B=`printf '%x' $BRIGHTNESS`

and change 99 to 255 in the script and it should work

Offline

Board footer

Powered by FluxBB