Acnezine PA Hire London Bali Real Estate

Empathy Tips: How to close the window with Esc Shortcut and change the windows change

May 18

Tips para Empathy: Como cerrar la ventana con Esc y cambiar el Shortcut de cambio de ventanas

The other day I decided to delete my Ubuntu 11.04 Pidgin and Empathy settle due to its integration.
As soon I started to test the application I found 2 major problems.

  1. I can not switch between windows with Ctrl + Tab
  2. I can not close the existing window with Esc or Escape

According to the creators of these are not bugs Empathy, but says Gnome Escape = Cancel and Ctrl + Tab = switch focus between text elements. That is why to be consistent with Gnome not want to put these options in your code.

Then figure out for a long time I found the fix to this problem.

There is a file in the file system are set up where all actions can be performed on our GTK window. These actions have what is called "Accelerators" are keyboard shortcuts.

First we go to the file: / usr / share / empathy / empathy-chat-window.ui

We will edit as sudo (sudo gedit / usr / share / empathy / empathy-chat-window.ui).

Once opened you will see that XML is a common and current with various actions.

First of all you look for the following line:

  1
  id = "menu_conv_close" > <object "GtkAction" class = id = "menu_conv_close"> 
  <object class="GtkAction" id="menu_conv_close"> 

You will see that below this line there will be some similar to:

  1
  modifiers = "GDK_CONTROL_MASK" /> key = "q" <accelerator modifiers = "GDK_CONTROL_MASK" /> 
  key="q" <accelerator modifiers="GDK_CONTROL_MASK"/> 

What this says is that to close the conversation not touch Ctrl + K. We want to change it to Escape, then change the line above with:

  1
  /> key = "Escape" <accelerator /> 
  <accelerator key="Escape"/> 

and ready :) .

Going to the second problem of changing the windows with Ctrl + Tab is a bit more complicated. By default, GNOME does not let us change the windows with Ctrl + Tab and in turn, does not leave any GTK application bindear a shortcut to the Tab key. If we wanted to do this, we should touch the code and change a FLAG Empathy to let us step on what Gnome says. As this was going to be hard work, decided to change Ctrl + Tab and Ctrl + Shift + Tab to Ctrl + A in this case, which is quite similar.

Then look for now in the same file the following 2 lines

  1
  id = "menu_tabs_prev" > <object "GtkAction" class = id = "menu_tabs_prev"> 
  <object class="GtkAction" id="menu_tabs_prev"> 
  1
 id = "menu_tabs_next" > <object "GtkAction" class = id = "menu_tabs_next"> 
  <object class="GtkAction" id="menu_tabs_next"> 

And change the two accelerators. The current shortcuts say to change tab you have to use Ctrl + PageDown, which means that the shortcut I have to use about 3 coats : P . Then change the following respectively:

  1
  modifiers = "GDK_CONTROL_MASK|GDK_SHIFT_MASK" /> key = "a" <accelerator modifiers = "GDK_CONTROL_MASK|GDK_SHIFT_MASK" /> 
  key="a" <accelerator modifiers="GDK_CONTROL_MASK|GDK_SHIFT_MASK"/> 
  1
  modifiers = "GDK_CONTROL_MASK" /> key = "a" <accelerator modifiers = "GDK_CONTROL_MASK" /> 
  key="a" <accelerator modifiers="GDK_CONTROL_MASK"/> 

After that, reboot Empathy and voila!

I leave you my configuration file to decide stepped directly:

  1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 ?> <!--*- mode: xml <? Xml version = "1.0"?> <! - * - Mode: xml  Chat  for All  Contact  = "t" modifiers = "GDK_SHIFT_MASK | Close Tab </ property> </ object> <accelerator key = "t" modifiers = "GDK_SHIFT_MASK |  Tab  Tab 
 <? Xml version = "1.0"?> <! - * - Mode: xml - * -> <object class="GtkUIManager" <interface> id="ui_manager"> <child> <object class = "GtkActionGroup" id = "actiongroup1"> <object class="GtkAction" <child> id="menu_conv"> <property name="name"> menu_conv </ property> <property name="label" translatable="yes"> _Conversation < / property> </ object> </ child> <object class="GtkAction" <child> id="menu_conv_clear"> <property name="stock_id"> gtk-clear </ property> <property name="name"> menu_conv_clear </ property> <property name="label" translatable="yes"> C_lear </ property> </ object> <accelerator key="L" modifiers="GDK_CONTROL_MASK"/> </ child> <child> <object class = "GtkAction" id = "menu_conv_insert_smiley"> <property name="icon-name"> face-smile </ property> <property name="name"> menu_conv_insert_smiley </ property> <property name = "label" translatable = "yes"> Insert _smiley </ property> </ object> </ child> <object class="GtkToggleAction" <child> id="menu_conv_favorite"> <property name="name"> menu_conv_favorite </ property> <property name = "label" translatable = "yes"> _Favorite Chat Room </ property> </ object> </ child> <object class="GtkToggleAction" <child> id="menu_conv_always_urgent"> <property name="name"> menu_conv_always_urgent </ property> <property name="label" Notify translatable="yes"> for All Messages </ property> </ object> </ child> <object class="GtkToggleAction" <child> id="menu_conv_toggle_contacts"> < property name = "name"> menu_conv_toggle_contacts </ property> <property name="active"> True </ property> <property name="label" translatable="yes"> _Show Contact List </ property> </ object> < / child> <object class="GtkAction" <child> id="menu_conv_invite_participant"> <property name="name"> menu_conv_invite_participant </ property> <property name="label" translatable="yes"> _Participant Invite ... </ property> </ object> </ child> <object class="GtkAction" <child> id="menu_conv_close"> <property name="stock_id"> gtk-close </ property> <property name="name"> menu_conv_close </ property> </ object> <accelerator key="Escape"/> </ child> <object class="GtkAction" <child> id="menu_contact"> <property name="name"> menu_contact </ property> <property name="label" translatable="yes"> C_ontact </ property> </ object> </ child> <object class="GtkAction" <child> id="menu_edit"> <property name="name"> menu_edit </ property> <property name="label" translatable="yes"> _edit </ property> </ object> </ child> <object class="GtkAction" <child> id="menu_edit_cut"> <property name = "stock_id"> gtk-cut </ property> <property name="name"> menu_edit_cut </ property> </ object> <accelerator key="X" modifiers="GDK_CONTROL_MASK"/> </ child> <child> <object class="GtkAction" id="menu_edit_copy"> <property name="stock_id"> gtk-copy </ property> <property name="name"> menu_edit_copy </ property> </ object> <accelerator key = " C "modifiers =" GDK_CONTROL_MASK "/> </ child> <object class="GtkAction" <child> id="menu_edit_paste"> <property name="stock_id"> gtk-paste </ property> <property name =" name "> menu_edit_paste </ property> </ object> <accelerator key="V" modifiers="GDK_CONTROL_MASK"/> </ child> <object class="GtkAction" <child> id="menu_edit_find"> <property name =" stock_id "> gtk-find </ property> <property name="name"> menu_edit_find </ property> </ object> <accelerator key="F" modifiers="GDK_CONTROL_MASK"/> </ child> <child> <object class = "GtkAction" id = "menu_tabs"> <property name="name"> menu_tabs </ property> <property name="label" translatable="yes"> _Tabs </ property> </ object> </ child> <object <child> class="GtkAction" id="menu_tabs_prev"> <property name="name"> menu_tabs_prev </ property> <property name="label" translatable="yes"> _Previous Tab </ property> </ object> <accelerator key="a" modifiers="GDK_CONTROL_MASK|GDK_SHIFT_MASK"/> </ child> <object class="GtkAction" <child> id="menu_tabs_next"> <property name="name"> menu_tabs_next </ property > <property name="label" translatable="yes"> _NEXT Tab </ property> </ object> <accelerator key="a" modifiers="GDK_CONTROL_MASK"/> </ child> <child> <object class = " GtkAction "id =" menu_tabs_undo_close_tab "> <property name="name"> menu_tabs_undo_close_tab </ property> <property name="label" translatable="yes"> _Undo Close Tab </ property> </ object> <accelerator key =" t "modifiers =" GDK_SHIFT_MASK | GDK_CONTROL_MASK "/> </ child> <object class="GtkAction" <child> id="menu_tabs_left"> <property name="name"> menu_tabs_left </ property> <property name =" label "translatable =" yes "> Move Tab _Left </ property> </ object> <accelerator key="Page_Up" modifiers="GDK_CONTROL_MASK|GDK_SHIFT_MASK"/> </ child> <child> <object class =" GtkAction "id = "menu_tabs_right"> <property name="name"> menu_tabs_right </ property> Move Tab <property translatable="yes"> name="label" _Right </ property> </ object> <accelerator key = "PAGE_DOWN" modifiers = "GDK_CONTROL_MASK | GDK_SHIFT_MASK" /> </ child> <object class="GtkAction" <child> id="menu_tabs_detach"> <property name="name"> menu_tabs_detach </ property> <property name = "label" translatable = " yes "> _Detach Tab </ property> </ object> </ child> <object class="GtkAction" <child> id="menu_help"> <property name="name"> menu_help </ property> <property name = "label" translatable = "yes"> _Help </ property> </ object> </ child> <object class="GtkAction" <child> id="menu_help_contents"> <property name="stock_id"> gtk-help < / property> <property name="name"> menu_help_contents </ property> <property name="label" translatable="yes"> _Contents </ property> </ object> <accelerator key = "F1" modifiers = "" / > </ child> <object class="GtkAction" <child> id="menu_help_about"> gtk-about <property name="stock_id"> </ property> <property name="name"> menu_help_about </ property> < / object> </ child> </ object> </ child> <UI> <menubar name="chats_menubar"> <menu action="menu_conv"> <menuitem action="menu_conv_clear"/> <menuitem action = "menu_conv_insert_smiley" /> <menuitem action="menu_conv_favorite"/> <menuitem action="menu_conv_always_urgent"/> <menuitem action="menu_conv_toggle_contacts"/> <menuitem action="menu_conv_invite_participant"/> <separator/> <menuitem action = "menu_conv_close" / > </ menu> <menu action="menu_contact" /> <menu action="menu_edit"> <menuitem action="menu_edit_cut"/> <menuitem action="menu_edit_copy"/> <menuitem action="menu_edit_paste"/> < separator /> <menuitem action="menu_edit_find"/> </ menu> <menu action="menu_tabs"> <menuitem action="menu_tabs_prev"/> <menuitem action="menu_tabs_next"/> <menuitem action = "menu_tabs_undo_close_tab" / > <separator/> <menuitem action="menu_tabs_left"/> <menuitem action="menu_tabs_right"/> <menuitem action="menu_tabs_detach"/> </ menu> <menu action="menu_help"> <menuitem action = "menu_help_contents "/> <placeholder name="LaunchpadItems"/> <menuitem action="menu_help_about"/> </ menu> </ menubar> </ u> </ object> <object class="GtkWindow" id="chat_window"> <property name="title" translatable="yes"> Chat </ property> <property name="role"> chat </ property> <property name="default_width"> 580 </ property> <property name = "default_height "> 480 </ property> <object class="GtkVBox" <child> id="chat_vbox"> <property name="visible"> True </ property> <child> <object class =" GtkMenuBar "builder =" ui_manager "id =" chats_menubar "> <property name="visible"> True </ property> </ object> <property name="expand"> <packing> False </ property> <property name="fill"> False < / property> </ packing> </ child> <child> <placeholder/> </ child> </ object> </ child> </ object> </ interface>