Wednesday, 3 August 2011

how to get windows key (left) and lower case L , key combination in rhel5.4 (tikanga) to lock screen

There seems to be a bug in Gnome / Metacity / X somewhere because i am unable to get windows  key (aka super_l or super_r) key with L to perform gnome lock screen. It allows me to enter only single key. I am not able to get windows key in combination with another key ( L key ) for lock functionality. So the below hack.

Start Configuration Editor (gconf-editor). Hit alt+f2 while logged in gnome. (you can see GUI ). This will bring run dialog. In that enter gconf-editor. If it throws a error most probably you don't have gconf-editor installed. Open a terminal ( as with Alt+F2 and enter gnome-terminal ) either as root or using sudo (i assume sudo is configured on your rhel machine or you can log in as root in terminal with "su - root").  Run the following command.

yum install gconf-editor
once gconf is installed and you have opened it:
* In apps/metacity/keybinding_commands create a new key called "command_15" of type String with value "gnome-screensaver-command --lock".
* select apps/metacity/global_keybindinngs.* Create a new key called "run_command_15" of type String with value "L". remember to type the string specified in the same as above. Including the < and > . The string translates to left windows key.

It took me hours to figure all this out, hence my post here. Comments / feedback most welcome

Courtesy: HOWTO: Windows Key & L to Lock Screen
with testing and validation of the above in rhel 5.4 by me.