Ubuntu – How to correctly install Compiz on Xfce 4

compizcompositingsoftware installationsoftware-centerxfce

As I understand, Compiz can be installed as the compositing-manager on various desktop environments. I am using Ubuntu Studio 15.10 with Xfce 4.12 and I want to install Compiz in its basic configuration just to use simple fading, shadows and maybe the infamous Cube workspace-switcher, however I would like the visuals of my windows to stay as they are.

So far, I have only found old tutorials on how to install Compiz on Xfce that are sometimes dated multiple years back and often involve adding additional PPAs or plugins and applications that I do not want to use or can not understand the use of.

Is it possible to just install and use the Compiz version from the Ubuntu Software Center to get what I am looking for? Or will I still need some additional software to make it compatible to Xfce?

It would be great if someone could explain a current way of installing just the basic Compiz functionality or point to an up-to-date website which explains this.


[Edit]: I tried the installation myself and found out what is necessary to set up in the process. If you need a guide, please refer to the answer I posted blow.

Best Answer

To answer this question for someone who is looking for the same explanation as myself:

When installing Compiz just by itself, it will use its own built-in gtk-window-decorator, meaning that the window title bars will vanish on the first start without further configuration and if enabling the window decoration, the default blue theme will be used.

I would advise to install/configure it in the following way without any additional PPAs or external window decorators:

  1. Start by deactivating any compositors: In the Xfce options by unticking "compositing" in the window management settings or, if installed, by removing custom compositors such as Compton from the startup applications.
  2. Open a terminal and enter: sudo apt install compiz compiz-plugins compizconfig-settings-manager dconf-editor (The Compiz-Plugins are also needed for additional functionality such as animations and the Cube, dconf-editor for setting up the original Xfce Greybird-theme or another installed theme.)
  3. Press Alt+F2 and enter dconf-editor to open it, then change the "theme"-value to your theme, e.g. Greybird in org\gnome\desktop\wm\preferences. You may also look for the "button-layout" value and move the window buttons to either side here. The value works as such left-button1,left-button2:right-button1,right-button2. So by simply entering the button names (minimize, maximize, close), the window buttons will be situated to either side in order, seperated by a comma.
  4. Open the CompizConfig Settings Manager from the regular Xfce-settings menu under Extras and at least enable the following plugins: Composite, OpenGL, Window Decoration, Move Window, Resize Window, Place Windows. (You may also want to add such things as Grid for tiling windows and Application Switcher for alt-tabbing windows and so on.) Also make sure that four horizontal workspaces are enabled in the general settings when wanting to use the Cube plugin. To find out what plugins I could/should enable, I used the following sources: How To Set Up Compiz In Xubuntu, Compiz Fusion on Your Desktop: Howto Ubuntu (Video Series), Xubuntu + Compiz = Pretty pretty Xubuntu
  5. Press Alt+F2 again and enter compiz --replace to find out if everything works correctly before adding it to the Autostart Applications or changing any statup system files. If there are any problems, a simple logout/reboot will deactivate it again.
  6. You may have to use the command bash -c "sleep 2; compiz --replace" in the Autostart Applications, in case it doesn't start with compiz --replace alone.

[Edit] A few fixes, if you should need them:

  • If you situate a panel with the Whisker Menu at the bottom (Windows-like look), the menu will pop up a few pixels too high when using the Place Windows plugin. Just add a rule in the plugin settings for a fixed window placement for title=Whisker Menu and simply leave all settings on default.
  • When using newer GTK+ 3 programs like Gedit or GNOME Disks, Compiz will sometimes draw the window frame incorrectly (square, with space around it). This can be fixed by installing gtk3-nocsd from the official repository and rebooting to force traditional window styling.