Using brightness hotkeys on Meego [Samsung NC10]

This entry applies specifically to Meego 1.0; there is already an updated version (1.1)
since the 28th October 2010 which should make this entry obsolete

On my netbook, Samsung NC10, Meego handles properly almost all the hardware.
One exception is some of the hotkeys, and specially the brightness keys.
As it goes, X11 recognizes them properly, but no action is triggered;
handling the brightness is as easy as updating properly the values on the file:

/sys/class/backlight/acpi_video0/brightness

For example:

echo 4 > /sys/class/backlight/acpi_video0/brightness

would set middle brightness on this netbook [possible values are 0-7].
In any case, the previous line will fail, as the file has root permissions, so it is needed to sudo it.

Whatever the action is, it is needed to configure the keyboard to handle it,
and this is directly supported in Meego, with two caveats:

Updating the brightness requires root permissions.

Associating a shell script on the keys configuration seems not to work.

So, the basic solution is to write a very basic C program, setuid it with root privileges,
and associate it to the brightness keys. Easy as said, the program is as simple as:

It should update the screen's brightness. Time now not associate it to the appropriated hotkeys:
open the devices configuration:

Get there to the keyboard option, under All Settings, and activate the keyboard shortcuts:

Now, add a new shortcut, pressing the Add button, and enter:

Name: brightness up

Command: /usr/local/bin/brightness up

It will appear under Custom shortcuts;
select its shortcut, that will initially appear as disabled;
as soon as it is selected, it will change to New shortcut...:
press now the brightness up hotkey:
its caption will automatically change to XF86MonBrightnessUp.

Repeat now the same process to handle brightness down:
add a new shortcut, pressing the Add button, and enter:

Name: brightness down

Command: /usr/local/bin/brightness down

After associating it to the brightness down key will appear as XF86MonBrightnessDown.

And that is all! In fact, it should be still associated to a nice applet to show the brightness change,
but not for the time being!