标签归档:linux

rdesktop Patch: Switch Local Workspaces and Windows by Local Hot Keys

rdesktop is a powerful RDP client for Linux. The inability of switch applications between remote side and local side by hot key makes it a little uncomfortable. Look around the internet, you can find many requests for the feature but no solutions. So I made the patch. It do things like:

  • Double press Ctrl+Alt+Left or Ctrl+Alt+Right to switch local active workspaces.
  • Double press Ctrl+Alt+Tab to switch local active window.
  • Other hot keys are sent directly to remote machine.
  • If using -fD options and having two or above workspaces, the effect is amazing!
  • If rdesktop is running in fullscreen mode (-f and without -D), Ctrl+Alt+Left/Right/Tab will toggle it to window mode first. After switching back, it can NOT toggle to fullscreen automatically. Press Ctrl+Alt+Enter to do that. (I know this is boring. But it is the best I can do. Rdesktop use override_redirect to implement fullscreen which makes it always the top-most window no matter which workspace/window you have switched to)

Download and unpack rdesktop.tgz to get a patched executable file: rdesktop. Overwrite /usr/bin/rdesktop with it. That’s all. The file was compiled with all debian/ubuntu official patches and tested in Ubuntu 9.10 (Karmic). It should work in other Linux distribution too. If it does or does not work in your environment, please leave a comment to report.

switch_local_workspace_and_window.patch is the code.

rdesktop忽略Ctrl+Alt+Left/Right的补丁

此贴已老,请移步rdesktop Patch: Switch Local Workspaces and Windows by Local Hot Keys

经常本地运行Linux,用rdesktop连接远程的Windows主机,两边配合工作。如果能通过快捷键切换两个桌面环境,会很方便。但rdesktop窗口会吸走所有的按键,发给远程桌面,包括Window Manager管理的热键。加上“-K”参数,远端就收不到很多热键了,比如最常用的Alt+Tab。在网上搜了一下,很多人都为此困扰,但没有任何解决办法。可能大牛们都只用纯用*nix,根本无视rdesktop的存在吧。于是,我就自己做了这个补丁,实现了下面的效果:

  • Linux桌面上要有至少两个Workspace,一个运行rdesktop,其余的本地用
  • 在rdesktop中,连按两次及以上的Ctrl+Alt+Left/Right,可以切换Workspace,也就是虚拟桌面
  • 建议启动rdesktop的时候,不加“-K”参数
  • 如果用全屏方式(-f)启动rdesktop,切换Workspace的时候,rdesktop会跟着走,达不到想要的效果。这和rdesktop用override_redirect方式实现全屏窗口有关。我不知道该怎么解决。如果有了解的朋友,请不吝赐教。我现在是用“-D”参数隐藏rdesktop窗口的外框,用“-g”设一个足够大的窗口,刚好上顶上面的panel,下踩下面的panel。

rdesktop_1.6.0-2ubuntu99_i386.deb是我在Ubuntu karmic上编译好的安装文件,估计Debian上也能用。用“sudo dpkg -i rdesktop_1.6.0_2ubuntu99_i386.deb”安装。其它平台可以下载rdesktop源代码,打上99_switch_desktop_support.dpatch补丁,自己编译试试,估计应该都能好用。