32

In Windows 7, you can press Shift+Windows Key+/ to instantly move the current window to the next/previous monitor. Is there an equivalent feature in Ubuntu 11.04? I poked around the Keyboard Shortcuts dialog but didn't see anything relating to moving windows among multiple monitors.

21

What you need:

  • wmctrl (sudo apt-get install wmctrl)
  • The dimensions of each monitor

How to do it:

  • From the terminal, run gnome-keybinding-properties and click "Add"
    • Name the entry something like "Move to left monitor" and enter this command:
      • wmctrl -r ":ACTIVE:" -e 0,0,0,1280,1024
        • You can change ":ACTIVE:" to ":SELECT:" and wmctrl will wait until you select a window
        • The values for -e are gravity,x-coordinate,y-coord,width,height. I have gravity set to 0, which is default (I don't actually know what gravity does), x and y-coordinates set to 0 and 0, and the width and height are the dimensions of the left monitor: 1280 and 1024. Change this to match your configuration.
    • Click where it says "Disabled" and press the same keyboard shortcut as in windows, i.e. Shift+Super+left
    • Make another entry for "move to right monitor"
      • wmctrl -r ":ACTIVE:" -e 0,1280,0,1366,768
        • Where I have "1280", put the horizontal resolution of your left monitor. The vertical resolution can be more tricky if your monitors have different resolutions, and especially if they aren't lined up along the top or bottom. Mine are aligned along the top, so the vertical-coordinate value is "0".
        • My right monitor is 1366x768, so replace those values with the appropriate ones.
    • Map the shortcut-key sequence and you're finished!

You may have to tweak the coordinates and dimensions to account for the top (usually 24px tall) or side panels.

For more reading on wmctrl, check out http://movingtofreedom.org/2010/08/10/arranging-windows-from-the-gnulinux-command-line-with-wmctrl/

I hope this helps!

  • 7
    I recommend using -1 in the last two fields to leave the windows dimensions unchanged when it moves (e.g., wmctrl -r ":ACTIVE:" -e 0,0,0,-1,-1) – Sk606 Nov 27 '12 at 18:22
  • As per this askubuntu.com/questions/75631/… answer. For current versions of gnome/ubuntu after installing wmctrl use: "gnome-control-center keyboard" or via GUI "settings -> devices -> keyboard" and then click the "+" in the bottom. – user3605780 Sep 11 at 10:26
21

If you use Compiz as the window manager on your Ubuntu installation (Which I believe comes pre-installed with 11.04). Open Compiz Config Settings Manager (do a sudo apt-get install compizconfig-settings-manager if you don't have ccsm installed.)

  • Go to Window Management -> Put
  • Enable the Put plugin.
  • Give your required key combination for the Put To Next Output option in the Bindings tab.

This will allow you to get the same functionality as what you require. The Put plugin has loads of other productivity increasing options too. Enjoy.

  • 1
    This works great for me on Ubuntu 12.04 64bit with Unity. Remember though that Compiz is a dangerous tool, many of its (seemingly harmless) options can easily break your setup, so don't mess around with it unless you've got backups and/or are sure your steps are safe. – Sicco Jan 8 '13 at 11:14
  • 2
    It appears that put was removed/omitted in 13.04. – Sean McCleary Aug 26 '13 at 17:40
  • 2
    If you haven't got the Pug plugin, you can install the package compiz-plugins-main which also installs some other plugins. I also had to restart X after I had set a shortcut. – gitaarik Jul 7 '15 at 8:42
  • I think that this should be the accepted answer. – MasterAM Aug 28 '16 at 14:14
  • works fine on ubuntu 18.04 + unity – Kennet Celeste Sep 15 '18 at 17:12
18

Compiz and Unity will be soon obsolete.

  • meta + left right moves in a single window but this fills in the gaps. I couldn't make sense of the extension though - it was moving other windows around in a strange way aswell and there seems to be no documentation – JonnyRaa May 25 '18 at 14:57
  • @JonnyLeeds Disable unused shortcuts the may overlap. – Waldemar Wosiński May 30 '18 at 5:42
  • It's quite new but available and easy. – Shihe Zhang Dec 22 '18 at 6:11
  • 1
    best answer!!!! – otaviodecampos Mar 21 at 19:50
  • Great, thanks for the answer! – Guilherme Garnier May 21 at 17:13
0

If you're using Budgie Desktop Environment,
then the default shortcut for moving window into monitor is Shift + Super + Arrow.

Ubuntu Budgie Keyboard Shortcuts

New contributor
Imtiaz Shakil Siddique is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

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.