Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

XFCE supports a hotkey to move a window to another workspace.

In fact this does two things:

  • It moves the window to the new workspace.

  • switches to this workspace.

I'm trying to disable this behaviour and make the hotkey only move the window without switching the workspace. Is this somehow possible, perhaps using hidden options?

share|improve this question

2 Answers 2

wmctrl lets you manipulate windows. You can bind keyboard shortcuts to the following commands:

wmctrl -r :ACTIVE: -t 0  // Move active window to workspace 1
wmctrl -r :ACTIVE: -t 1  // Move active window to workspace 2
wmctrl -r :ACTIVE: -t 2  // Etc...
share|improve this answer

It is also worth recording here that it is possible to do this with xdotool, which can be installed with

sudo apt-get install xdotool

You can bind the command below to perhaps a spare button on the side of your mouse, and then you can click that button to flick the active window to another workspace. The number of the workspace is specified at the end of the command.

xdotool getactivewindow set_desktop_for_window 1

This will move the currently active window (the one that has focus) to the desired workspace, while keeping you on the workspace where the command was issued, which was just what you specifically required. (To actually move to that other workspace yourself, you would use xdotool set_desktop 1.)

You could also select a particular window to move instead of just the active window, but probably shifting the active window (whatever it is) would be most useful to bind to a key.

Note: If you use a different window manager than that of the default on Xfce, or you use compiz, you may need to look at the viewport options in the xdotool manpage or try wmctrl instead.

For more detailed information on using xdotool for manipulating windows and workspaces, please see my answers here to related, but different questions:

There are so many things you can do with xdotool; please see the Ubuntu manpage or man xdotool.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.