37

As Compiz Grid is not supported in ubuntu-2d, I am looking for alternative to tile windows.

This video shows that xfce4 and xfwm4 can snap windows to a part of the screen. I would like to do that by keyboard shortcuts.

I have already installed xfce4and xfwm4, but I don't see which one in the following list does the job:

enter image description here

Could anyone help?

Braiam
  • 67,791
  • 32
  • 179
  • 269
SoftTimur
  • 3,069
  • It's easy enough to run Awesome wm in XFCE, by the way :-) – Chan-Ho Suh Apr 17 '12 at 00:10
  • I think Awesome is another wm which does not depend on xfce. We can choose one of them as session while logging in, no? – SoftTimur Apr 17 '12 at 22:58
  • 1
    Hm, I'm not sure why I would randomly suggestion Awesome... I think someone else suggested (and then deleted) that you can use a tiling wm in XFCE. Anyway, answer to your question is yes. If you install awesome in Ubuntu, it will add a session to lightdm. Then you can add various things from XFCE like xfce-power-managerand xfsettingsd if you rely on those things. – Chan-Ho Suh Apr 17 '12 at 23:02
  • Sorry, I just installed xfce-power-manager, but launching it or xfsettingsd in a terminal (in a xfce session) does not have any effect... – SoftTimur Apr 17 '12 at 23:09
  • Hi. I thought you were asking about using Awesome in its own session in lightdm (the graphical login manager to your system). You would probably want to add those xfce applications I mentioned if you run Awesome separately, since it does not handle power management or display settings. It sounds like you are launching them in XFCE, which is pointless as they should already be running (xfce-power-manager should already be installed and running...) – Chan-Ho Suh Apr 17 '12 at 23:14
  • Oh I see, the proper name is xfce4-power-manager (this has a 4 in the name) so you installed an older version of it. Uninstall the one you installed: xfce-power-manager (without the 4!). Might cause some problems down the road. I'm sorry about that typo... I don't see any other typos. – Chan-Ho Suh Apr 17 '12 at 23:27

5 Answers5

20

Out of the box, most non-tiling managers and desktop environments such as XFCE/Xubuntu does not have tiling support.

A notable exception in Compiz which can be used with the majority of Desktop environments such as Xubuntu/Unity but not Gnome-Shell.

Specifically for Xubuntu, to get mouse tiling support you will need to either compile or install a modified window manager such as this Q&A:

Automatically size windows using Xfce like in gnome

To get keyboard tiling support without compiz and a non-tiling window manager, you will need to be more inventive and control the window position and sizing yourself - this answer gives you this solution.

However, for the best tiling support you should use a dedicated tiling-window manager such as Awesome.

Keyboard Tiling

A basic python script on launchpad allows you to control windows such as moving them to the left or right.

I've slightly modified this to work with XFCE/Xubuntu and to allow you to install in either 11.10 or 12.04. This can easily be tailored for other DEs such as unity-2d

Create keyboard shortcuts - an example is below:

enter image description here

You call the script stiler.py with the following parameters:

  • left - tile the current window to the left side of the screen.
  • right - tile the current window to the right side of the screen.
  • vertical - tile all windows vertically
  • horizontal - tile all windows horizontally
  • cycle - tile windows in a cyclical manner and rotate between those windows
  • prev - move the focus to the previous window
  • next - move the focus to the next window
  • maximize - maximise the current window

Some examples:

cycle windows

enter image description here

tile vertically

enter image description here

to install

sudo add-apt-repository ppa:fossfreedom/xfwm4
sudo apt-get update
sudo apt-get install stiler
fossfreedom
  • 172,746
  • Thanks for the comment, I think that will solve my problem... I try to install, and do sudo add-apt-repository ppa:fossfreedom/xfwm4. But I got an error: Traceback (most recent call last): File "/usr/bin/add-apt-repository", line 88, in <module> ppa_info = get_ppa_info_from_lp(user, ppa_name) File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 80, in get_ppa_info_from_lp curl.perform() pycurl.error: (7, "couldn't connect to host"), is it my problem or the problem of your code? – SoftTimur Apr 19 '12 at 12:01
  • that sounds like you are behind a proxy - are you? I think there are similar questions & answers somewhere on this site. – fossfreedom Apr 19 '12 at 12:04
  • Yes, I am behind a proxy... – SoftTimur Apr 19 '12 at 13:01
  • here is the Q&A, do you think I can solve it on my side? – SoftTimur Apr 19 '12 at 13:03
  • I think this Q&A should work for you. http://askubuntu.com/questions/53146/how-do-i-get-add-apt-repository-to-work-through-a-proxy – fossfreedom Apr 19 '12 at 13:16
  • 1
    This is great! Bookmarking... – Chan-Ho Suh Apr 20 '12 at 10:24
  • @fossfreedom, I have installed your program, and use it under ubuntu-2d, that works, thank you very much... One little problem is that it seems that the height of different applications (Chrome, home folder, terminal) is not the same, so their bottom are not aligned... – SoftTimur Apr 20 '12 at 12:58
  • ... there is a config file ~/.stilerc - you could try adjusting the values in there. Otherwise stuff gets more tricky. The actual stiler.py script calculates windows as literal window sizes. It doesnt understand the slight window sizes differences apps such as chrome, terminal etc. As I said in my answer - its a basic solution - a real tiling window manager has thousands of lines of code to cope with all of these issues. Hope this helps. – fossfreedom Apr 20 '12 at 13:06
  • @fossfreedom, I just realize that there is not a function to restore the current windows, right? – SoftTimur Apr 26 '12 at 07:08
  • @fossfreedom, Maximize window vertically provided by initial vm works well, especially for the height of a window. Do you think there is way to incorporate the launching of Maximize window vertically (by a shortcut) in the end of your stiler.py left? – SoftTimur Apr 26 '12 at 07:13
  • ... I'm not sure I understand the question - if you are asking how to combine two commands then a short cut with something like stiler.py left && stiler.py maximize will work. If you are saying the calculation for maximize vertically gives a better result than "left" - then the python code in stiler.py will need a tweak. If I find sometime (12.04 release issues and all that) I will have a look. If you can look at the calculation yourself (python is easy to read in any text editor)- that would be extremely helpful. – fossfreedom Apr 27 '12 at 10:23
  • This is nice, but doesn't seem to work well with a multi-monitor setup, at least the way I've got it configured. – alanaktion Nov 06 '14 at 21:42
20

Xubuntu LTS 16.04 has the ability to tile windows by default by using the mouse. Grab a window with your mouse and move it to the top, bottom, left, right, top-right, top-left, bottom-right or bottom left.

If you want to use your keyboard instead, you have to configure the shortcuts in the Window Manager as the following screen shot shows:

Window Manager

I answered this old question here because as a Xubuntu novice I was looking for this feature too and couldn't find it in the beginning.

fliegenpilzmann
  • 321
  • 2
  • 4
7

I've had better luck with quicktile. Use it the same way, create shortcuts to the command.

http://ssokolow.github.com/quicktile/

Stephen
  • 333
  • ...or, for snappier response, avoid forcing it to start and shutdown every time you trigger it by using the internal keybinder. Just install python-xlib and run it with the --daemonize option. (Details in the README) – ssokolow Nov 12 '12 at 16:00
  • This was the easiest way out of all the solutions I tried. Thanks! – protoEvangelion Mar 16 '18 at 19:32
4

In that video, the description says xfwm4-tiling. So it's not just XFCE (and xfwm) doing that. It's an additional package. apt-cache search doesn't find it, so it's not in the Ubuntu repositories. Video description also says s/he's using Arch Linux and refers to AUR, which is the Arch repositories.

Unless you want to figure out how to compile and use it in Ubuntu, or find someone that's done that already (maybe there's a PPA), if you want that tiling behavior, you'll probably have to switch from xfwm to another window manager that supports tiling.

Above in the comments, someone mentioned you could look into using Awesome (but later deleted that comment). I mentioned you can use Awesome inside XFCE. It's actually probably easier to use XFCE apps inside Awesome than the other way around. If you install awesome using apt-get, you will find an awesome session installed in the graphical login manager (lightdm).

You can then configure awesome to autostart various XFCE apps, such as xfce4-power-manager (important for power management functions like suspend and shutdown on low battery), xfsettingsd (daemon which makes sure some, but not all, XFCE settings are executed, such as display settings and gtk theming), xfce4-panel (so you can use the panel you are accustomed to), xfce4-volumed (xfce volume daemon), etc. Awesome doesn't support compositing, but you can get that by autostarting xcompmgr. There's a lot of info online on how to run this stuff in Awesome, including elsewhere on this site.

Here's a basic tutorial for using Awesome.

If you want to run Awesome in XFCE, that's not difficult, but Awesome needs to be reconfigured to work properly with the XFCE panel; I don't know how easy that is (my guess is it's not hard, but it's a time investment in any case).

Chan-Ho Suh
  • 7,562
  • 1
    the xfwm4 tiling is described in my answer here: http://askubuntu.com/questions/41566/how-do-i-get-aero-snap-in-unity-2d – fossfreedom Apr 18 '12 at 09:00
  • Your own PPA, eh? Nice :-) Does it also avoid overlapping? – Chan-Ho Suh Apr 18 '12 at 09:13
  • yes - its quite a nice patch from the Arch developers that tiles windows without overlapping. I note the patch has now been incorporated into xfce v4.10 that should (hopefully) find its way into Xubuntu 12.10. – fossfreedom Apr 18 '12 at 10:24
  • Rather than continuing to give the correct answer in this comment thread, why not put it into an actual answer? :-) – Chan-Ho Suh Apr 18 '12 at 10:28
  • ... I've already pointed the OP to that answer in a previous question he raised. In this case he is after a "keyboard" tiling solution - xfce-tiling is a mouse only solution so adding this will not actually answer his question :( – fossfreedom Apr 18 '12 at 10:34
1

Just Press and hold super key and you will get most useful shortcuts in ubuntu as shown in image.

enter image description here

muru
  • 197,895
  • 55
  • 485
  • 740