PDA

View Full Version : HOWTO: Windows Key & L to Lock Screen



chmac
27th June 2006, 12:23 PM
There seems to be a bug in Gnome / Metacity / X somewhere that means you can't use SUPER_L or SUPER_R (the left and right windows keys on a keyboard) with gnome system commands such as "Lock Screen".

So, to get it working, you can follow these steps

Go to Desktop > Preferences > Keyboard (or run gnome-keyboard-properties) then choose the Layout Options tab and under Alt/Win key behaviour select "Super is mapped to Win-keys".

Start Configuration Editor (gconf-editor) and select apps/metacity/global_keybindinngs.

Create a new key called "run_command_15" of type String with value "<Mod4>L".

Now in apps/metacity/keybinding_commands create a new key called "command_15" of type String with value "gnome-screensaver-command --lock".

You can repeat these steps to create as many other keybindings as you like. I don't know the steps on KDE, but I believe KDE has much better keyboard shortcut support than Gnome.

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

Cheers,


Callum.

AtlDynasty25
15th September 2006, 04:42 AM
There seems to be a bug in Gnome / Metacity / X somewhere that means you can't use SUPER_L or SUPER_R (the left and right windows keys on a keyboard) with gnome system commands such as "Lock Screen".

So, to get it working, you can follow these steps

Go to Desktop > Preferences > Keyboard (or run gnome-keyboard-properties) then choose the Layout Options tab and under Alt/Win key behaviour select "Super is mapped to Win-keys".

Start Configuration Editor (gconf-editor) and select apps/metacity/global_keybindinngs.

Create a new key called "run_command_15" of type String with value "<Mod4>L".

Now in apps/metacity/keybinding_commands create a new key called "command_15" of type String with value "gnome-screensaver-command --lock".

You can repeat these steps to create as many other keybindings as you like. I don't know the steps on KDE, but I believe KDE has much better keyboard shortcut support than Gnome.

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

Cheers,


Callum.

Bump.

Anyone know how to open the "gconf-editor" as described in the above tutorial? I try running gconf-editor from the terminal and it just says "bash: gconf-editor: command not found"

Thanks,
Matt

chmac
15th September 2006, 05:05 AM
AtlDynasty25, Click Applications > System Tools > Configuration Editor. If it's not there, you probably need to install it. Open a terminal and type:
yum install gconf-editor

Bingo, you're off... :)


Callum.

AtlDynasty25
15th September 2006, 01:29 PM
AtlDynasty25, Click Applications > System Tools > Configuration Editor. If it's not there, you probably need to install it. Open a terminal and type:
yum install gconf-editor

Bingo, you're off... :)


Callum.

Thanks, that did the trick. However, my super key still doesn't work unfortunately. It says "This key has no schema" I'm not sure what that means.

EDIT: I'm using XGL, and my super key is working now at least. Super+scroll wheel zooms. I'm not sure if that matters.

Adesso
15th September 2006, 03:33 PM
I finally got it to work after the 3rd try.

Running gconf-editor from the command shell as root, does not work
Running gconf-editor from the command shell as user, does not work

It seems you have to use the link from the menu, Applications > System Tools > Configuration Editor before the actual commands and keybindings will work ... :)

Firewing1
15th September 2006, 04:07 PM
This isn't true. I have my Super_L key set to opening menu functions, and they work.
Firewing1

chmac
17th September 2006, 10:41 AM
Firewing1, read the bug report here:
http://bugzilla.gnome.org/show_bug.cgi?id=165343

Using Super_L to open menus is not the same as using it to lock the screen. I don't remember 100% of the details, but I believe it's something to do with the way the keys are passed between gnome and metacity. I can assure you, it is true, and there are numerous other people on the bugzilla to confirm it.


Callum.

Gu3st
17th September 2006, 04:11 PM
Thanks Friend

KClaisse
19th October 2006, 06:04 PM
I know noone has posted in a while, but I had to thank you! This is just so cool!
But for those of us who still use xscreensaver, the command is

xscreensaver-command -lock

instead of

gnome-screensaver-command --lock

Thanks for the guide!