Fixing screen brightness on a Samsung R60 and Ubuntu 10.04

Finally the day came when all the clean installs in the world will not make Vista any faster on my old Samsung R60 (1.5 Ghz Dualcore), so I figured it’s time for a Linux distro. Apart from high power consumption (it’s a known bug [1]) nearly everything worked as expected, left two things: I wasn’t able to use the Fn keys to change the screen brightness.
Three reasons for that:
1. Ubuntu expects the screen brightness device to reside in /proc/acpi/video/VGA/LCD/brightness while for the particular device it will be in /proc/acpi/video/ATIM/LCD/brightness
2. The device is setup by default as read-only
3. The device will not allow the standard brightness parameters

The solution consists in the following steps:

1. copy video_brightnessdown.sh and video_brightnessup.sh to /etc/acpi
2. make those files executable:

sudo chmod a+x /etc/acpi/video_brightnessdown.sh
sudo chmod a+x /etc/acpi/video_brightnessup.sh

3. add key shortcuts to those files (System->Preferences->Keyboard shortcuts)

4. setup a startup script (i.e. in /etc/init.d and link from the appropriate rc.d to it) that makes the device writeable:

#!/bin/bash
BRDEV=/proc/acpi/video/ATIM/LCD/brightness
chmod a+w $BRDEV

video_brightnessdown.sh

#!/bin/bash
BRDEV=/proc/acpi/video/ATIM/LCD/brightness

chmod a+w $BRDEV

CURRENT=$(grep "current:" $BRDEV |awk '{print $2}')

case "$CURRENT" in

100)
echo -n 80 > $BRDEV;
;;
80)
echo -n 70 > $BRDEV;
;;
70)
echo -n 60 > $BRDEV;
;;
60)
echo -n 50 > $BRDEV;
;;
50)
echo -n 40 > $BRDEV;
;;
40)
echo -n 30 > $BRDEV;
;;
30)
echo -n 10 > $BRDEV;
;;
*)
echo -n 10 > $BRDEV ;
;;
esac

video_brightnessup.sh

#!/bin/bash
BRDEV=/proc/acpi/video/ATIM/LCD/brightness
chmod a+w $BRDEV

CURRENT=$(grep "current:" $BRDEV |awk '{print $2}')

case "$CURRENT" in

100)
echo -n 100 > $BRDEV;
;;
80)
echo -n 100 > $BRDEV;
;;
70)
echo -n 80 > $BRDEV;
;;
60)
echo -n 70 > $BRDEV;
;;
50)
echo -n 60 > $BRDEV;
;;
40)
echo -n 50 > $BRDEV;
;;
30)
echo -n 40 > $BRDEV;
;;
10)
echo -n 30 > $BRDEV;
;;
*)
echo -n 100 > $BRDEV ;
;;
esac

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.