Wednesday, February 27, 2013

Xfce: changing standard global keyboard shortcuts

Q: Did you ever face the problem with Xfce not all of the globally defined keyboard shortcuts can be changed?

In my case Eclipse IDE shortcuts that I'm used to:
  • Perspective switch (Ctrl + F8)
  • Editor switch (Ctrl + F6)
  • ...
all of these were eaten by Xfce (as they're supposed to be used for some multi-workspace experience)
But hey! I don't use multiple workspaces! I'd rather like to use the full power of eclipse here.

Changing via UI 


But if you go over: Menu -> Settings -> Keyboad
There are not all the global shortcuts listed (at least those mentioned earlier are missing).

Looking for help


As I faced this problem already quite some time ago, I even participated in some discussions (like this on myeclipse related), and even submitted Xfce bug report.

Good old plain xml way 


But when I came back to this problem after some time, I've googled and found some references to file:
~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml

As I checked the contents, there seem to be even the shortcuts I'm facing the problem with.

I've seen there:
  <property name="xfwm4" type="empty">
    <property name="default" type="empty">
      <property name="&lt;Alt&gt;Insert" type="empty"/>
      <property name="Escape" type="empty"/>
      <property name="Left" type="empty"/>
      <property name="Right" type="empty"/>
      <property name="Up" type="empty"/>
      <property name="Down" type="empty"/>
      <property name="&lt;Alt&gt;Tab" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Shift&gt;Tab" type="empty"/>
      <property name="&lt;Alt&gt;Delete" type="empty"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;Down" type="empty"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;Left" type="empty"/>
      <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Down" type="empty"/>
      <property name="&lt;Alt&gt;F4" type="empty"/>
      <property name="&lt;Alt&gt;F6" type="empty"/>
      <property name="&lt;Alt&gt;F7" type="empty"/>
      <property name="&lt;Alt&gt;F8" type="empty"/>
      <property name="&lt;Alt&gt;F9" type="empty"/>
      <property name="&lt;Alt&gt;F10" type="empty"/>
      <property name="&lt;Alt&gt;F11" type="empty"/>
      <property name="&lt;Alt&gt;F12" type="empty"/>
      <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Left" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;End" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;Home" type="empty"/>
      <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Right" type="empty"/>
      <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Up" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_1" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_2" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_3" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_4" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_5" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_6" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_7" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_8" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_9" type="empty"/>
      <property name="&lt;Alt&gt;space" type="empty"/>
      <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Up" type="empty"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;Right" type="empty"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;d" type="empty"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;Up" type="empty"/>
      <property name="&lt;Super&gt;Tab" type="empty"/>
      <property name="&lt;Control&gt;F1" type="empty"/>
      <property name="&lt;Control&gt;F2" type="empty"/>
      <property name="&lt;Control&gt;F3" type="empty"/>
      <property name="&lt;Control&gt;F4" type="empty"/>
      <property name="&lt;Control&gt;F5" type="empty"/>
      <property name="&lt;Control&gt;F6" type="empty"/>
      <property name="&lt;Control&gt;F7" type="empty"/>
      <property name="&lt;Control&gt;F8" type="empty"/>
      <property name="&lt;Control&gt;F9" type="empty"/>
      <property name="&lt;Control&gt;F10" type="empty"/>
      <property name="&lt;Control&gt;F11" type="empty"/>
      <property name="&lt;Control&gt;F12" type="empty"/>
    </property>
    <property name="custom" type="empty">
      <property name="&lt;Control&gt;F3" type="string" value="workspace_3_key"/>
      <property name="&lt;Control&gt;F4" type="string" value="workspace_4_key"/>
      <property name="&lt;Control&gt;F5" type="string" value="workspace_5_key"/>
      <property name="&lt;Control&gt;F6" type="string" value="workspace_6_key"/>
      <property name="&lt;Control&gt;F7" type="string" value="workspace_7_key"/>
      <property name="&lt;Control&gt;F8" type="string" value="workspace_8_key"/>
      <property name="&lt;Control&gt;F9" type="string" value="workspace_9_key"/>
      <property name="&lt;Alt&gt;Tab" type="string" value="cycle_windows_key"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;Right" type="string" value="right_workspace_key"/>
      <property name="Left" type="string" value="left_key"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;d" type="string" value="show_desktop_key"/>
      <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Left" type="string" value="move_window_left_key"/>
      <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Right" type="string" value="move_window_right_key"/>
      <property name="Up" type="string" value="up_key"/>
      <property name="&lt;Alt&gt;F4" type="string" value="close_window_key"/>
      <property name="&lt;Alt&gt;F6" type="string" value="stick_window_key"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;Down" type="string" value="down_workspace_key"/>
      <property name="&lt;Alt&gt;F7" type="string" value="move_window_key"/>
      <property name="&lt;Alt&gt;F9" type="string" value="hide_window_key"/>
      <property name="&lt;Alt&gt;F11" type="string" value="fullscreen_key"/>
      <property name="&lt;Alt&gt;F8" type="string" value="resize_window_key"/>
      <property name="&lt;Super&gt;Tab" type="string" value="switch_window_key"/>
      <property name="Escape" type="string" value="cancel_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_1" type="string" value="move_window_workspace_1_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_2" type="string" value="move_window_workspace_2_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_3" type="string" value="move_window_workspace_3_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_4" type="string" value="move_window_workspace_4_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_5" type="string" value="move_window_workspace_5_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_6" type="string" value="move_window_workspace_6_key"/>
      <property name="Down" type="string" value="down_key"/>
      <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Up" type="string" value="move_window_up_key"/>
      <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Down" type="string" value="lower_window_key"/>
      <property name="&lt;Alt&gt;F12" type="string" value="above_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_8" type="string" value="move_window_workspace_8_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_9" type="string" value="move_window_workspace_9_key"/>
      <property name="Right" type="string" value="right_key"/>
      <property name="&lt;Alt&gt;F10" type="string" value="maximize_window_key"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;Up" type="string" value="up_workspace_key"/>
      <property name="&lt;Control&gt;F10" type="string" value="workspace_10_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_7" type="string" value="move_window_workspace_7_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;End" type="string" value="move_window_next_workspace_key"/>
      <property name="&lt;Alt&gt;Delete" type="string" value="del_workspace_key"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;Left" type="string" value="left_workspace_key"/>
      <property name="&lt;Control&gt;F12" type="string" value="workspace_12_key"/>
      <property name="&lt;Alt&gt;space" type="string" value="popup_menu_key"/>
      <property name="&lt;Alt&gt;&lt;Shift&gt;Tab" type="string" value="cycle_reverse_windows_key"/>
      <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Up" type="string" value="raise_window_key"/>
      <property name="&lt;Alt&gt;Insert" type="string" value="add_workspace_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;Home" type="string" value="move_window_prev_workspace_key"/>
      <property name="&lt;Control&gt;F2" type="string" value="workspace_2_key"/>
      <property name="&lt;Control&gt;F1" type="string" value="workspace_1_key"/>
      <property name="&lt;Control&gt;F11" type="string" value="workspace_11_key"/>
      <property name="override" type="bool" value="true"/>
    </property>
  </property>

That sounds promissing! Let's remove multi-workspace relevant and see if that helps.

After my update:
  <property name="xfwm4" type="empty">
    <property name="default" type="empty">
      <property name="&lt;Alt&gt;Insert" type="empty"/>
      <property name="Escape" type="empty"/>
      <property name="Left" type="empty"/>
      <property name="Right" type="empty"/>
      <property name="Up" type="empty"/>
      <property name="Down" type="empty"/>
      <property name="&lt;Alt&gt;Tab" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Shift&gt;Tab" type="empty"/>
      <property name="&lt;Alt&gt;Delete" type="empty"/>
<!--
      <property name="&lt;Control&gt;&lt;Alt&gt;Down" type="empty"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;Left" type="empty"/>
-->
      <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Down" type="empty"/>
      <property name="&lt;Alt&gt;F4" type="empty"/>
      <property name="&lt;Alt&gt;F6" type="empty"/>
      <property name="&lt;Alt&gt;F7" type="empty"/>
      <property name="&lt;Alt&gt;F8" type="empty"/>
      <property name="&lt;Alt&gt;F9" type="empty"/>
      <property name="&lt;Alt&gt;F10" type="empty"/>
      <property name="&lt;Alt&gt;F11" type="empty"/>
      <property name="&lt;Alt&gt;F12" type="empty"/>
      <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Left" type="empty"/>
<!--
      <property name="&lt;Alt&gt;&lt;Control&gt;End" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;Home" type="empty"/>
      <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Right" type="empty"/>
      <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Up" type="empty"/>

      <property name="&lt;Alt&gt;&lt;Control&gt;KP_1" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_2" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_3" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_4" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_5" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_6" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_7" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_8" type="empty"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_9" type="empty"/>
-->
      <property name="&lt;Alt&gt;space" type="empty"/>
      <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Up" type="empty"/>
<!--
      <property name="&lt;Control&gt;&lt;Alt&gt;Right" type="empty"/>
-->
      <property name="&lt;Control&gt;&lt;Alt&gt;d" type="empty"/>
<!--
      <property name="&lt;Control&gt;&lt;Alt&gt;Up" type="empty"/>
-->
      <property name="&lt;Super&gt;Tab" type="empty"/>
<!--
      <property name="&lt;Control&gt;F1" type="empty"/>
      <property name="&lt;Control&gt;F2" type="empty"/>
      <property name="&lt;Control&gt;F3" type="empty"/>
      <property name="&lt;Control&gt;F4" type="empty"/>
      <property name="&lt;Control&gt;F5" type="empty"/>
      <property name="&lt;Control&gt;F6" type="empty"/>
      <property name="&lt;Control&gt;F7" type="empty"/>
      <property name="&lt;Control&gt;F8" type="empty"/>
      <property name="&lt;Control&gt;F9" type="empty"/>
      <property name="&lt;Control&gt;F10" type="empty"/>
      <property name="&lt;Control&gt;F11" type="empty"/>
      <property name="&lt;Control&gt;F12" type="empty"/>
-->
    </property>
    <property name="custom" type="empty">
<!--
      <property name="&lt;Control&gt;F3" type="string" value="workspace_3_key"/>
      <property name="&lt;Control&gt;F4" type="string" value="workspace_4_key"/>
      <property name="&lt;Control&gt;F5" type="string" value="workspace_5_key"/>
      <property name="&lt;Control&gt;F6" type="string" value="workspace_6_key"/>
      <property name="&lt;Control&gt;F7" type="string" value="workspace_7_key"/>
      <property name="&lt;Control&gt;F8" type="string" value="workspace_8_key"/>
      <property name="&lt;Control&gt;F9" type="string" value="workspace_9_key"/>
-->
      <property name="&lt;Alt&gt;Tab" type="string" value="cycle_windows_key"/>
<!--
      <property name="&lt;Control&gt;&lt;Alt&gt;Right" type="string" value="right_workspace_key"/>
-->
      <property name="Left" type="string" value="left_key"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;d" type="string" value="show_desktop_key"/>
      <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Left" type="string" value="move_window_left_key"/>
      <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Right" type="string" value="move_window_right_key"/>
      <property name="Up" type="string" value="up_key"/>
      <property name="&lt;Alt&gt;F4" type="string" value="close_window_key"/>
      <property name="&lt;Alt&gt;F6" type="string" value="stick_window_key"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;Down" type="string" value="down_workspace_key"/>
      <property name="&lt;Alt&gt;F7" type="string" value="move_window_key"/>
      <property name="&lt;Alt&gt;F9" type="string" value="hide_window_key"/>
      <property name="&lt;Alt&gt;F11" type="string" value="fullscreen_key"/>
      <property name="&lt;Alt&gt;F8" type="string" value="resize_window_key"/>
      <property name="&lt;Super&gt;Tab" type="string" value="switch_window_key"/>
      <property name="Escape" type="string" value="cancel_key"/>
<!--
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_1" type="string" value="move_window_workspace_1_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_2" type="string" value="move_window_workspace_2_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_3" type="string" value="move_window_workspace_3_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_4" type="string" value="move_window_workspace_4_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_5" type="string" value="move_window_workspace_5_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_6" type="string" value="move_window_workspace_6_key"/>
-->
      <property name="Down" type="string" value="down_key"/>
      <property name="&lt;Control&gt;&lt;Shift&gt;&lt;Alt&gt;Up" type="string" value="move_window_up_key"/>
      <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Down" type="string" value="lower_window_key"/>
      <property name="&lt;Alt&gt;F12" type="string" value="above_key"/>
<!--
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_8" type="string" value="move_window_workspace_8_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_9" type="string" value="move_window_workspace_9_key"/>
-->
      <property name="Right" type="string" value="right_key"/>
      <property name="&lt;Alt&gt;F10" type="string" value="maximize_window_key"/>
<!--
      <property name="&lt;Control&gt;&lt;Alt&gt;Up" type="string" value="up_workspace_key"/>
      <property name="&lt;Control&gt;F10" type="string" value="workspace_10_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;KP_7" type="string" value="move_window_workspace_7_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;End" type="string" value="move_window_next_workspace_key"/>
      <property name="&lt;Alt&gt;Delete" type="string" value="del_workspace_key"/>
      <property name="&lt;Control&gt;&lt;Alt&gt;Left" type="string" value="left_workspace_key"/>
      <property name="&lt;Control&gt;F12" type="string" value="workspace_12_key"/>
-->
      <property name="&lt;Alt&gt;space" type="string" value="popup_menu_key"/>
      <property name="&lt;Alt&gt;&lt;Shift&gt;Tab" type="string" value="cycle_reverse_windows_key"/>
      <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Up" type="string" value="raise_window_key"/>
<!--
      <property name="&lt;Alt&gt;Insert" type="string" value="add_workspace_key"/>
      <property name="&lt;Alt&gt;&lt;Control&gt;Home" type="string" value="move_window_prev_workspace_key"/>
      <property name="&lt;Control&gt;F2" type="string" value="workspace_2_key"/>
      <property name="&lt;Control&gt;F1" type="string" value="workspace_1_key"/>
      <property name="&lt;Control&gt;F11" type="string" value="workspace_11_key"/>
-->
      <property name="override" type="bool" value="true"/>
    </property>

to be honest, I'm not sure if I need to update them in both sections, but to make things fast, let's do so.

OK, I guess I need to log-out/and in and see if that helped.

And as you could guess it...... worked!  (otherwise I would not write a blog post, right? :-) )

No comments: