Last visit was: It is currently 21/10/2014, 9:43


All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: [NC10] How to map the remaining non-working FN keys
PostPosted: 22/02/2009, 17:59 
Administrator
Administrator
User avatar

Joined: 12/02/2009, 18:08
Posts: 1377
Location: Italy
To enable all the FN keys on NC10 we simply need to install a fixed kernel and edit an HAL file (Here is the howto).

However, even if the keys are all enabled, on Ubuntu 8.10 some of them are not mapped by default. So, let's see how to map them.

I will just explain how to map the FN-F5 and FN-F8 keys to replicate the same functionalities they have on windows xp. For all the other keys it works the same way, just adapt the commands to your needs. You can map any key (not only the FN keys) to any program or script you need. :)

Let's start with FN-F5. It will toggle the screen brightness on/off (note: if you are using my repository and you installed the nc10-scripts package, then the key is already mapped; however I leave it here just as an example for how to map other keys).

First of all, we have to install the xbacklight package from ubuntu repositories because we are going to use a script that needs it to work.
Once installed, download the script, make it executable and put it in /usr/local/bin.

Now, map it to the FN-F5 key with the following commands:
Code:
gconftool-2 -s --type string /apps/metacity/keybinding_commands/command_1 '/usr/local/bin/lcdonoff.sh'
gconftool-2 -s --type string /apps/metacity/global_keybindings/run_command_1 XF86Launch1

The first one will put the /usr/local/bin/lcdonoff.sh in the command_1 position, the second one will enable the XF86Launch1 key (ie FN-F5) to launch the command_1.

We are done. Not so difficult, eh? :D

Now the FN-F8 key. It will switch the CPU governor between ondemand, performance and powersave governors.

Download this script, make it executable and put it in /usr/local/bin (as usual).
It needs the libnotify-bin package to show popups, so be sure it's installed. Besides that, it needs admin rights to work so we have to use sudo to run it.
However, we don't want to insert the password everytime we run the script, so we'll add a new rule to sudo to run it with no need to insert the password (exactly as done for the wireless card here).

In a terminal, run the command
Code:
sudo visudo

to open the sudo configuration file.

Go to the line
Code:
# Cmnd alias specification

and below it add this one:
Code:
Cmnd_Alias      CPUSCALING=/usr/local/bin/cpuscaling.sh

Now go to the end of file and add this line:
Code:
%admin ALL=(ALL) NOPASSWD: CPUSCALING


Exit (CTRL+x) and save the file.
Due to this new rule, all the users in admin group can run the CPUSCALING command (and ONLY this command) with no need for the password.

Now, map the script to the FN-F8 key with the following commands:
Code:
gconftool-2 -s --type string /apps/metacity/keybinding_commands/command_3 'sudo /usr/local/bin/cpuscaling.sh'
gconftool-2 -s --type string /apps/metacity/global_keybindings/run_command_3 XF86Launch3


Done.
If you press the key once, a popup will show the governor in use. If you continue to press the key, the governor will be changed.

Now, using the same method, bind all the other keys to what you want. For example, on my installation the FN-F3 key opens a terminal, FN-F7 launches eclipse and FN-F8 launches devhelp (I simply don't need to handle the cpu governors, I just leave it to 'ondemand' all the times. So I used the key for other stuff :)).

Ok, that's all. For any question or problem, ask here. :)

_________________
Please consider a little donation to keep the 'Linux On My Samsung' project up and running. Thank you!


Last edited by voRia on 05/05/2009, 11:31, edited 1 time in total.

Top
 Profile  
 
 Post subject: RE: [NC10] How to map the remaining non-working FN keys
PostPosted: 24/04/2009, 16:33 
Newbie
Newbie

Joined: 23/04/2009, 11:18
Posts: 31
XF86WLAN wont works for me, when i look fn-f9 keykode in xev, i cant see anything useful. Why xmodmap doesnt know XF86WLAN ?

I solve this problem, i edited icewm keys file and i changed wlan command and its worked. If the command is wrong icewm disables key.


Last edited by mbt28 on 24/04/2009, 16:40, edited 1 time in total.

Top
 Profile  
 
 Post subject: RE: [NC10] How to map the remaining non-working FN keys
PostPosted: 25/04/2009, 2:06 
Newbie
Newbie

Joined: 23/04/2009, 16:35
Posts: 9
I am having a problem with the fn-f5 script. It blacks out the screen as it should, but when I use the setting "dim on idle" in power manager, the display comes back on when idle. looks like the dim on idle just sets some value instead of decreasing the brightness from where it is.


Last edited by tkoorn on 25/04/2009, 2:07, edited 1 time in total.

Top
 Profile  
 
 Post subject: RE: [NC10] How to map the remaining non-working FN keys
PostPosted: 25/04/2009, 18:18 
Administrator
Administrator
User avatar

Joined: 12/02/2009, 18:08
Posts: 1377
Location: Italy
'tkoorn' pid='834' dateline='1240621588' wrote:
I am having a problem with the fn-f5 script. It blacks out the screen as it should, but when I use the setting "dim on idle" in power manager, the display comes back on when idle. looks like the dim on idle just sets some value instead of decreasing the brightness from where it is.


Fixed with the new 'lcdonoff.sh' script included in 'nc10-scripts' package (0.3~ppa2~nc10~jaunty) on my repository.

Changelog:
Code:
* New 'lcdonoff.sh' script: xbacklight is not used anymore, gnome-power-manager is used instead.
* Dropped xbacklight dependency.

_________________
Please consider a little donation to keep the 'Linux On My Samsung' project up and running. Thank you!


Last edited by voRia on 25/04/2009, 18:21, edited 1 time in total.

Top
 Profile  
 
 Post subject: RE: [NC10] How to map the remaining non-working FN keys
PostPosted: 25/04/2009, 20:00 
Administrator
Administrator
User avatar

Joined: 12/02/2009, 18:08
Posts: 1377
Location: Italy
Ok, sometimes the new 'lcdonoff.sh' script messed up the gpm settings, so the old one is back with slight modifications.

Here is the changelog (0.3~ppa3~nc10~jaunty):
Code:
* Revert: "New 'lcdonoff.sh' script: xbacklight is not used anymore, gnome-power-manager is used instead."
* xbacklight dependency readded.
* 'lcdonoff.sh' script now disables/enables the gnome-power-manager 'idle_dim' options when needed in order to avoid unwanted screen resume.

_________________
Please consider a little donation to keep the 'Linux On My Samsung' project up and running. Thank you!


Top
 Profile  
 
 Post subject: RE: [NC10] How to map the remaining non-working FN keys
PostPosted: 25/04/2009, 20:28 
Newbie
Newbie

Joined: 23/04/2009, 11:18
Posts: 31
'voRia' pid='845' dateline='1240686013' wrote:
Ok, sometimes the new 'lcdonoff.sh' script messed up the gpm settings, so the old one is back with slight modifications.

Here is the changelog (0.3~ppa3~nc10~jaunty):
Code:
* Revert: "New 'lcdonoff.sh' script: xbacklight is not used anymore, gnome-power-manager is used instead."
* xbacklight dependency readded.
* 'lcdonoff.sh' script now disables/enables the gnome-power-manager 'idle_dim' options when needed in order to avoid unwanted screen resume.



I think dont remove old lcdonoff.sh, maybe someone uses it with kde, lxde, or other window managers.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net & kodeki