Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
which script runs when I press brightness button?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Mon Jul 26, 2010 6:41 pm    Post subject: which script runs when I press brightness button? Reply with quote

Hello list, when I press the volume up button (F12 in my laptop) I see a notification and the volume increases. Presumably this is triggered by having volume_up XF86AudioRaiseVolume in /apps/gnome_settings_daemon/keybindings. However, when I press the brightness button up (F2 in my laptop) my brightness also increases, but looking in gconf-editor I can't find where is the assignement of a key to F2. I can't also find where is the script that gets executed. I'm asking cause I'd like to also have a similar script running for the keyboard backlight (that I can currently control by editing directly /sys/class/leds/smc\:\:kbd_backlight/brightness)

Thanks,

R.
Back to top
View user's profile Send private message
CrankyPenguin
Apprentice
Apprentice


Joined: 19 Jun 2003
Posts: 277

PostPosted: Mon Jul 26, 2010 8:28 pm    Post subject: Depends upon the system. Reply with quote

On some systems the process is handled entirely in hardware and you may not have a hook for a separate script. However if you do it would likely require the backlight module which is part of the acpi code in the kernel and then I would suggest something like acpid which allows hooks of that type.
_________________
Linux, the OS for the obsessive-compulsive speed freak in all of us.
Back to top
View user's profile Send private message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Mon Jul 26, 2010 8:49 pm    Post subject: Reply with quote

Hi thanks for the answer. It kind of confuses me though. I understand the first part:
Quote:
On some systems the process is handled entirely in hardware and you may not have a hook for a separate script.

Indeed I am happy with this. Since I don't run acpid (long story short: it's a macbook air and the acpi code in the kernel needs some time still to boot properly) it may well be that brightness is controlled by hald, but I can't find the place where this is set up, it might be calling /usr/libexec/scripts/hal-system-lcd-{g,s}et-brightness but I don't really know/think so.

On the other hand:
Quote:
However if you do it would likely require the backlight module which is part of the acpi code in the kernel and then I would suggest something like acpid which allows hooks of that type.
This confuses me a little. I guess it should be quite easy to write a script that just increases or decreases brightness by editing the appropriate /sys/class/leds... and bind it with the windowmanager to F5-F6, I don't see how acpid will be "needed". On the other hand I suppose you mean by "require the backlight module..." that I do need the appropriate driver that provides /sys/class/leds/smc\:\:kbd_backlight/brightness which indeed in my case it is is the nvidia_bl module which is loaded.

What I wandered is how is that my system "knows" that F1 corresponds to lowering brightness, since I couldn't find any place where this key is bound to anything. This seems different with volume down = F11 since this key binding appears in gnome-settings (although I also don't know where is the script that actually changes the volume).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum