6

I'm running 16.04 with LXDE on an old server. Graphics are obviously not awesome (8MB onboard graphics), so I am using x2go to forward my xsession over 10 100 1000. The problem is that the keystrokes (such as alt+tab, ctrl+alt+right, etc.) don't bind to the application, so instead of switching applications within x2go, it switches from the x2go application to the next open program on the client machine.

How could I bind all keystrokes (even nicer, one keystroke excluded) to a single application?

The client computer is running Unity. The host (the computer whose session I am sending through x2go) is running LXDE.

anonymous2
  • 4,325

1 Answers1

2

Disable Unity shortcuts

  1. Install ccsm

     sudo apt-get install compizconfig-settings-manager
    
  2. Go to Desktop category → Ubuntu Unity plugin → Switcher tab

    Click on each shortcut, uncheck Enable, then OK

  3. Go to Desktop category → Desktop Wall → Bindings tab

    Same way, disable the shortcuts that you want.

  4. Close ccsm, It is effective right after closing.

ccsm shortcuts have priority on custom one from system settings. You can use dconf to see the underlying setting changed when you make the above steps using GUI.

$ dconf watch /
/org/compiz/profiles/unity/plugins/unityshell/alt-tab-prev
  'Disabled'

/org/compiz/profiles/unity/plugins/unityshell/alt-tab-prev 'Disabled'

/org/compiz/profiles/unity/plugins/unityshell/alt-tab-forward unset

/org/compiz/profiles/unity/plugins/unityshell/alt-tab-forward unset

So better to make a wrapper script to disable unity switcher shortcuts, launch x2goclient, then enable them back after closing x2goclient.

dconf write /org/compiz/profiles/unity/plugins/unityshell/alt-tab-prev "'Disabled'"
dconf write /org/compiz/profiles/unity/plugins/unityshell/alt-tab-forward "'Disabled'"
...
x2goclient
dconf reset /org/compiz/profiles/unity/plugins/unityshell/alt-tab-prev
dconf reset /org/compiz/profiles/unity/plugins/unityshell/alt-tab-forward
...

Disable LXDE shortcuts

Old answer that could be useful for some.

The shortcut you mention belong to OpenBox. Which is launched with predefine settings for Lubuntu. (At least this is the case for Lubuntu 14.04).

~$ pgrep -a openbox
4772 openbox --config-file /home/lubuntu/.config/openbox/lubuntu-rc.xml

We should unbind them from OpenBox or any tools already binded them.

  1. Open its configuration file for editing

     leafpad ~/.config/openbox/lubuntu-rc.xml
    
  2. Then comment the shortcuts you want using XML comment tags <!-- --> or delete them.


New customized shortcut forwarded to x2goclient

After that setup global shortcuts to forward shortcut to x2goclient window using wmctrl & xvkbd.

  1. System Settings → Keyboard → Shortcuts tab

  2. Add new custom shortcut with command

     bash -c 'wid=$(wmctrl -l | awk "/X2Go Client/ {print $1; exit}"); echo $wid; if [ "$wid" ] ; then xvkbd -window $wid -xsentevent -text "\A\t"; fi'
    

    for AltTab

user.dz
  • 49,176