PDA

View Full Version : [gnome] ESC key to close any active window



Koala Kid
January 22nd, 2011, 10:44 AM
Hi good people,
I'd like to set my ESC key to close any active window. Is it possible ?

Thank you :)

ajgreeny
January 22nd, 2011, 01:00 PM
Yes, it should be possible in System ->Preferences ->Keyboard Shortcuts, Window management, but it may confuse some programs where the Esc key is already set to do something else, so take care.

Koala Kid
January 22nd, 2011, 02:54 PM
Well, you can't really use ESC key, because when you try to set it, it just closes the preferences window :)
What I did is to use this command:

wmctrl -c :ACTIVE: and associate it with Alt+Z combination.

ajgreeny
January 22nd, 2011, 03:28 PM
Well, you can't really use ESC key, because when you try to set it, it just closes the preferences window :)
What I did is to use this command:

wmctrl -c :ACTIVE: and associate it with Alt+Z combination.
Yes, when you think about it, I suppose it would.

I presume you did get it working OK with no problem, but I'm interested as to why it was needed rather than Alt+F4.

Koala Kid
January 24th, 2011, 08:12 PM
Oh, I wasn't aware of this. Anyway, alt+z is more comfortable for my fingers :)

surfdoc
July 18th, 2012, 05:48 PM
does anyone know if this can be done? i use a mini keyboard (its like using a mobile), so any multi-key function is a hastle. esc is the obvious choice as it is used in programs like xbmc to go back to the parent view.

cheers

surfdoc
July 18th, 2012, 06:49 PM
so the missing link is xbindkeys

install xbindkeys and wmctrl

run


xbindkeys --defaults > /home/joe/.xbindkeysrc

to create a default config file
edit the file, comment out the examples with #, and add the lines


wmctrl -c :ACTIVE:
Escape

then save the file and run


xbindkeys

voila

|{urse
July 18th, 2012, 06:53 PM
You too cool for alt+f4 or something?

:rolleyes:

edit: oh forum blindness lol

surfdoc
July 18th, 2012, 07:13 PM
Actually - yes :cool:

wildmanne39
July 19th, 2012, 05:53 AM
Hi, this is an old thread so it has been closed, thanks for sharing.