Posted over 7 years ago. Visible to the public.

How to move a window to the next monitor on Xfce, Mate and other X Window Managers

Since I use this a lot in my daily work and there were no scripts working properly for me, I made one myself.
It's actually not bound to Xfce but should work on any window manager (haven't tried it, though).

Installation

  1. If you don't yet have xdotool, install it:

    Copy
    sudo apt-get install xdotool
  2. If you don't yet have wmctrl, install it:

    Copy
    sudo apt-get install wmctrl
  3. Store the attached file in some place that's in your PATH.
    The cool kids use ~/bin/.

  4. Make it executable: chmod +x ~/bin/move-to-next-monitor

Trying it

Open up a terminal and run it:

Copy
move-to-next-monitor

There should be no errors and the terminal window should have moved one monitor to the right.

Assigning a keyboard shortcut

  1. Your window manager has a way to setup global hotkeys somewhere. In Xfce you may open Xfce settings → Keyboard → Keyboard shortcuts
  2. Add an entry for move-to-next-monitor and assign a keyboard shortcut to it.
  3. It should be active right away, so try it on the settings window. :)

Done!


Props to icyrock.com who had a script that was basically working (not properly on 3 monitors and was lacking some workarounds) and saved me quite some time figuring this all out.

By refactoring problematic code and creating automated tests, makandra can vastly improve the maintainability of your Rails application.

Owner of this card:

Avatar
Arne Hartherz
Last edit:
7 days ago
by Henning Koch
Attachments:
move-to-next-monitor
Keywords:
xubuntu
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Arne Hartherz to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more