I'm working in multi display workspace, I would like to have keyboard shortcut for moving active window to another display (I don't mean workspaces). How can I achieve this in XFCE? In Unity I was using Compiz with predefined keyboard shortcuts.

my workspace

2 Answers 2


XFCE does not have a built-in command that allows you to move a window to another monitor, however there is this Python script that can do that.

The script is used as:

movescreen.py <up|down|left|right|prev|next|fit> [win_id|mouse]
  • First, make sure the script's dependencies are satisfied:

    sudo apt install python xrandr xwininfo wmctrl xdotool
  • Download the script and move it to the folder that you want, for example ~/scripts/ (I am assuming this as the script's folder for the next steps, you may, however, use whatever you want).

  • Give executable rights to the script:

    chmod u+x ~/scripts/movescreen.py
  • Open Keyboard and select the Application Shortcuts tab.

  • Click the Add button at the bottom left.

  • In the Command pop-up window enter the command to move the window, using the absolute path to the script. For example, to move the window to the monitor left, enter:

    /home/<your_username>/scripts/movescreen.py left
  • Press OK and assign the shortcut you want, for example Ctrl+Super+Left.

  • Repeat the steps for all other directions.

The script is not perfect, but works reasonably well. Also, being built in Python means that it is relatively easy to tweak it.

  • 1
    It works! Thank you!
    – ybonda
    Jan 10 at 15:22

Managed to do it as follows:

  1. Install xdotool using:

    apt install xdotool
  2. Then run:

    xdotool getactivewindow getwindowgeometry

    with output:

    Window 69206023
      Position: 2201,251 (screen: 0)
      Geometry: 774x568
  3. Moving to right command:

    xdotool getactivewindow windowmove 2201 251 windowsize 774 568
  4. Finally just put the following in /usr/bin/moveright script and bind it on a keyboard shortcut:

    xdotool getactivewindow windowmove 2201 251 windowsize 774 568
  • 1
    This is a very good & simple solution. If I may add something, there's no need to specify a windowsize XX XX parameter in the xdotool command. That way, you can use it with arbitrary windows without changing their size.
    – xgrau
    Jul 15, 2021 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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