Comment 154 for bug 95444

Revision history for this message
BoZ (ba-serge) wrote : Re: No Screen Backlight Control; Sony Vaio with nvidia 8 series graphics

For those who is interested in setting Fn keys with acpid.

As it has been already mentioned above in this thread, if you simply write
   nvclock -S -5
in your sonybright.sh it won't work unless you restart the daemon after login. Of course you can do this restart automatically on every startup. But to my opinion this does not smell to be the right way.

The actual problem is a weird user rights and home directory settings, since acpid runs as root. So to overcome that I propose just to put something like
    sudo -H -u YOURUSERNAME /usr/local/bin/nvclock -S -5
here after -u you put your user name (it is of course possible to find out that name in script. But if you are the only one it is obviously not worth spending time on that). -H option sets environment HOME to that of the target user.

It works for me. And there is no need to restart acpid...