42

I am trying to figure out if it's possible to do the following(or rather bind this action to a hot key): If on a workspace I have 2 windows, I want to maximize each one vertically and resize them horizontally to be half of the screen each and position them next to each other. Basically after this operation there should 2 equally sized windows, taking up all space.

If that's not possible with default Gnome, how can I write up a python script to do that(i.e. where can I start? Never did UI scripting with Python before...)

Jorge Castro
  • 71,754
Alex
  • 2,208
  • 1
    I would like to hear how this can be done with python. Can windows be resized and repositioned by command line? – emf Oct 01 '10 at 17:04

6 Answers6

54

Unity has this built in by default.

You can Ctrl + Alt + a keypad key to arrange the window. It's fairly logical if you have a keypad!

Jorge Castro
  • 71,754
Oli
  • 293,335
  • 1
    That's nice - but you need a keypad. And that's not on my ThinkPad's keyboard... – petermolnar Aug 06 '12 at 15:39
  • @petermolnar Is there not even a Fn-overlay one? Lots of laptops (ThinkPads inclusive) have overlays for keypad keys so you press Fn+j for KP1, for example. Give it a go. – Oli Aug 06 '12 at 17:21
  • that's available for now, will be extinct from Tx30 ( T430, T530 ... ) – petermolnar Aug 07 '12 at 20:54
  • 1
    So Ctr-Alt-7 docks top left, ctr-alt-1 does bottom left, should ctr-alt-4 do full left side? Mine doesn't... any idea where you can set these quick keys? – Dan Ciborowski - MSFT Jun 27 '13 at 18:35
  • 2
    Hmm. In 13.04 Ctrl + Alt + Arrow moves workspaces....is there a way to set the keyboard shortcut you want for this functionality? – Chris Pfohl Jul 26 '13 at 11:49
  • this worked nice. but since a couple off day's it is broken. do you know a solution? – tibi Jun 25 '17 at 06:25
  • found this: Systems > Preferences > CompizConfig Settings Manager

    and scroll down to Window Management. Then check Grid mode and, once you open the options for that mode, choose keybindings for Put Left and Put Right.

    – tibi Jun 25 '17 at 06:28
15

Ctrl + Superkey + Arrow

A example of a superkey is the windows/start key. I am using Ubuntu 12.10.

13

Aside from the Grid plugin, which is very buggy on my system, there are these alternatives for simple tiling:

X-tile: This is a Gnome panel applet that when right clicked will allow you to select an array of options to tile all windows on a particular viewport/workspace. It also has a stand-alone window when left-clicked with lots of options. X-tile has recently been fixed to be compatible with Compiz viewports, but be warned that the display size options may need to be tweaked if you use an unconventional desktop layout, such as AWN dock, auto-hide panels, etc. Don't worry, it's all done through a simple GUI interface.

You can find it here: http://linux-apps.com/content/show.php/X+Tile?content=99624

PYwo: Python window organizer. This little program runs in the background and seems much lighter than Grid. It also is more feature-rich, even with the default settings. Although very simple in scope, there is no GUI.

You can find it here: http://code.google.com/p/pywo/

Easystroke: This is system-wide mouse gesture program for the Ubuntu desktop. And it is awesome. Once you set your keyboard shortcuts you can use this program to assign simple mouse gestures to them. For example, if Ctrl+Alt+L is your shortcut to tile a single window to left-top of the screen, you can make an Easystroke rule that when you hold the right mouse button and draw a line up and left the selected window gets tiled as if you hit the keys. This program also offers application specific gestures, allowing you to set commands for web browsers, file managers, and so on. It comes with an easy to use gui and is available in the official repositories.

Enter this in a terminal:

sudo apt-get install easystroke

VidathD
  • 2,704
Deadite81
  • 860
4

Install and use the CompizConfig Settings Manager:

sudo apt-get install compizconfig-settings-manager 

Go to Windows Management > Grid to set the keys you want!

CompizConfig Settings Manager screenshot

Note: DON'T touch any option if you are not sure about the result. I already broke Ubuntu Unity to not follow that warning...

chelder
  • 449
1

Try this http://www.omgubuntu.co.uk/2009/11/get-aero-snap-in-ubuntu/

lukasz
  • 2,406
1

If you want to simply do resizing by dragging a window to an edge of your screen like in Windows 7 Aero Snap, try this:

http://ubuntuforums.org/showpost.php?p=9974221&postcount=123

Even better than with Aero Snap, you can tile Windows horizontally, vertically, or make them take up only a quarter of your screen.

Or you can wait for Compiz 0.9 to be released. Edge binding functionality is going to be implemented there by default in the Grid plugin.

YSN
  • 2,349