Cinnamon: keyboard shortcut for moving window between monitors

Created on 20 Jun 2013  Â·  25Comments  Â·  Source: linuxmint/cinnamon

I couldn't find this option anywhere, nor could I find it in the issues. I'm surprised this hasn't come up! It would be fantastic to have a keyboard shortcut setting for moving a window between two monitors in dual-monitor mode. The mouse is hideously slow. If this isn't the right place to request this feature, please let me know where to do it.

FEATURE REQUEST

Most helpful comment

In GNOME and Windows it's possible to use Super + Shift + Left/Right to move windows between monitors. It would be super helpful to have the same shortcuts in Cinnamon! :)

All 25 comments

See linuxmint/muffin#42.

I'd like the options in the System Settings > Keyboard > Shortcuts > Navigation > then some way to bind keys to flip windows between multiple monitors/displays.

@wulftone: As a work-around, you can use install the Alt-Tab Enhanced applet (requires Cinnamon 1.8 or newer), which moves the selected window(s) between monitors on the press of 'm'. Disclaimer: I am the author of that ridiculously overworked applet.

@autarkper Thanks, that's quite a bit more than I need, but maybe I'll make do... or maybe I'll extract the bit that moves windows between monitors. ; )

If you want @wulftone (or others), at least until Cinnamon maybe add this possibility later, here is the script I personally use for that (found I don't know anymore where on the web):

NEW LINK —AGAIN—: http://pastebin.com/zjFaRh28
(updated version again, now fully OK for normal -and- maximized windows ;
I've never looked more than that to this script content in fact, but was just basic shell script line errors about the maximized support! I fixed that. By the way, you just need to have these 3 tools installed before: xdotool, xwininfo, wmctrl)

Just edit and adapt these 2 lines at top for your situation (height is managed dynamically):
— screen width (the effective resolution! just set yours here.) —
screen_width1=1600
screen_width2=1920

Working nice here, at least for my configuration (primary screen at right, secondary screen at left). But else, can be easily adapted if required, even though there is no particular reason for this script to not work in a flipped screen configuration: as long as you've a dual monitor configuration, it should be OK. Hope it'll work for you too then.

I personally set to trigger this script by setting:
Command to execute: sh /path/to/move_window_monitor.sh
Keyboard shortcut: F9

Pressing F9 will switch the current active window to the other screen. And vice versa if I press multiple times on it so. ;)

The window size is always kept, but the window position is always set at left of screen in that script —can be enhanced of course—. Not a real problem though according to me.

I've checked this on my laptop running Ubuntu with Cinnamon (which only has one screen), but doesn't Super + Left/Right carry windows over to the next monitor when the window is attached to the corresponding edge of the other monitor?

It's certainly not the most elegant of solutions, but quicker than the mouse.

By the way, this is also how it works in Windows (at least 7 and up), so Super + Up should maximise windows too

I'm running Cinnamon on Fedora 19 - I found this blog post: http://blog.ealize.com/2012/11/move-window-to-other-display-in-cinnamongnome-3unity/

Works well for me.

I use the "Move window to left/right edge" in Cinnamon's keyboard shortcuts -> windows shortcuts. Works perfectly for maximized windows, if that's what you tend to use.

I'm running Cinnamon 1.8.8 on Ubuntu 12.04.3 LTS.

Thanks @contribucious , works well.

@contribucious Thanks for this. If you've got it checked in somewhere public I might send you a pull request.

@jeblackburn You're welcome. Thanks for the proposal, but not hosted on GitHub. However, if needed, feel free to enhance this one on your GitHub and share yours at any time with other people here. ;-)

Here's a similar script I made, but which I think does a bit better with fullscreen windows, and also gets your monitor dimensions for you from xrandr, and works with more than 2 monitors: https://github.com/ntowbinj/switch-monitor

@ntowbinj Thanks to share yours on web and to people here, mate! Sounds good! ;)

In GNOME and Windows it's possible to use Super + Shift + Left/Right to move windows between monitors. It would be super helpful to have the same shortcuts in Cinnamon! :)

//oups, sorry =)

@rauch, @TheBacha is asking to switch monitors, not workspaces

In case anyone has two monitors one above the other like me:
https://github.com/ntowbinj/switch-monitor/issues/4

+1 to TheBacha's suggestion

Is there any plan to implement this? I'd quite like to have this feature, as I often have need to move windows between monitors.

The Super + Left/Right hotkeys should push tiles to the next monitor when the window is already on the side of the current display. Currently this doesn't happen, and it breaks your workflow if you are used to this feature in KDE or Windows.

please make moving windows between monitors an option!

The original request is implemented in 2.6.x, any further issues/requests, make a new issue please.

Shift + Windows + arrow

it works!

If you want @wulftone (or others), at least until Cinnamon maybe add this possibility later, here is the script I personally use for that (found I don't know anymore where on the web):

NEW LINK —AGAIN—: http://pastebin.com/zjFaRh28
(updated version again, now fully OK for normal -and- maximized windows ;
I've never looked more than that to this script content in fact, but was just basic shell script line errors about the maximized support! I fixed that. By the way, you just need to have these 3 tools installed before: xdotool, xwininfo, wmctrl)

Just edit and adapt these 2 lines at top for your situation (height is managed dynamically):
— screen width (the effective resolution! just set yours here.) —
screen_width1=1600
screen_width2=1920

Working nice here, at least for my configuration (primary screen at right, secondary screen at left). But else, can be easily adapted if required, even though there is no particular reason for this script to not work in a flipped screen configuration: as long as you've a dual monitor configuration, it should be OK. Hope it'll work for you too then.

I personally set to trigger this script by setting:
Command to execute: sh /path/to/move_window_monitor.sh
Keyboard shortcut: F9

Pressing F9 will switch the current active window to the other screen. And vice versa if I press multiple times on it so. ;)

The window size is always kept, but the window position is always set at left of screen in that script —can be enhanced of course—. Not a real problem though according to me.

Thanks for posting this

Created an enhaced version of your script: https://github.com/edemir206/dual-monitor-window-switch

It swaps all screens between two monitors.

Nice mate. Thank you for sharing!

It swaps all screens between two monitors.

all windows I guess you meant (but I understood :wink:).

Was this page helpful?
0 / 5 - 0 ratings