How-to: Wepad Brightness control under Ubuntu

Having installed Ubuntu on my WePad 32gb, I found the brightness control applet unusable.

Here are 2 scripts you can then add to the panel:

First, try this command:

more /proc/acpi/video/GFX0/DD02/brightness

If it gives this, then you can continue:

levels:  0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
current: 12

The current tag can differ. If this command gives you nothing, try to find the right brightness file, GFX0 and DD02 can differ. Sometimes, you find it under /proc/acpi/video/VGA/brightness

We will now create 2 scripts that simply change the current tag which is the new brightness value.

sudo gedit /etc/acpi/video_brightnessdown.sh

Paste this into the file:

 

#!/bin/bash

CURRENT=$(grep “current:” /proc/acpi/video/GFX0/DD02/brightness |awk ‘{print $2}’)


case “$CURRENT” in

15)
echo -n 12 > /proc/acpi/video/GFX0/DD02/brightness;
;;
12)
echo -n 9 > /proc/acpi/video/GFX0/DD02/brightness;
;;
9)
echo -n 6 > /proc/acpi/video/GFX0/DD02/brightness;
;;
6)
echo -n 3 > /proc/acpi/video/GFX0/DD02/brightness;
;;
3)
echo -n 1 > /proc/acpi/video/GFX0/DD02/brightness;
;;
1)
echo -n 1 > /proc/acpi/video/GFX0/DD02/brightness;
;;
*)
echo -n 9 > /proc/acpi/video/GFX0/DD02/brightness ;
;;
esac

Save the file and go back to the command window:

sudo gedit /etc/acpi/video_brightnessup.sh

Paste this into the file:

 

#!/bin/bash

CURRENT=$(grep “current:” /proc/acpi/video/GFX0/DD02/brightness |awk ‘{print $2}’)


case “$CURRENT” in

15)
echo -n 15 > /proc/acpi/video/GFX0/DD02/brightness;
;;
12)
echo -n 15 > /proc/acpi/video/GFX0/DD02/brightness;
;;
9)
echo -n 12 > /proc/acpi/video/GFX0/DD02/brightness;
;;
6)
echo -n 9 > /proc/acpi/video/GFX0/DD02/brightness;
;;
3)
echo -n 6 > /proc/acpi/video/GFX0/DD02/brightness;
;;
1)
echo -n 3 > /proc/acpi/video/GFX0/DD02/brightness;
;;
*)
echo -n 15 > /proc/acpi/video/GFX0/DD02/brightness ;
;;
esac

Save both files and go back to the command promtp:

enter sudo nautilus and navigate to your 2 new files.

Right click on them, go to properties and select Permissions. Make sure you put under Others the permission Read and Write and select the execute file as program box.

You are now ready to insert the scripts in the panel.

Right click on the panel, then Add to panel. Select the Custom Application Launcher. Click

browse and search your files. You have to repeat the step for the up and down command each.

If you like, look for a decent Icon, or create your own. Here is what my panel looks like. I moved it to the left so I have more pixels for scrolling.

More information:

http://ubuntuforums.org/showthread.php?t=767374

http://forum.ubuntuusers.de/topic/ubuntu-8.04-laptop-brightness-helligkeit/?highlight=samsung+r70

Advertisements

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: