sudo apt-get install compiz compiz-plugins compizconfig-settings-manager metacity
For Xubuntu 14.04 or 14.10, install dconf-tools:
sudo apt-get install dconf-tools
Here, you may also want to change the "titlebar-font" value from "Cantarell Bold 11" to "Droid Sans Bold 9" or else the window titlebar font might look way too big.
For Xubuntu 12.04, install gconf-editor:
sudo apt-get install gconf-editor
If no other plugins are enabled, you'll have to enable the following plugins (without these plugins enabled, Compiz won't work properly): Composite, Gnome Compatibility, OpenGL, Window Decoration, Move Window, Resize Window, Place Windows.
You can enable/disable more plugins later on, but the important part is to enable the plugins required for Compiz to work properly, which I've mentioned above, before running Compiz for the first time.
4. Let's start Compiz using the following command:
If everything works well, you can set Compiz as default – see step 5.
5. Set Compiz as default in Xubuntu / Xfce
To do this, run the following commands (use "mousepad", "leafpad" or whatever text editor you use for the second command and for all commands from now on that start with "mousepad"):
cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xmlmousepad ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
In the newly opened file in Mousepad (or some other text editor), look for the following bolded line (should be on line 12 in Xubuntu 14.04):
<property name="Failsafe" type="empty"> <property name="IsFailsafe" type="bool" value="true"/> <property name="Count" type="int" value="5"/> <property name="Client0_Command" type="array"> <value type="string" value="xfwm4"/> </property>
and replace "xfwm4" with "compiz". Then log out, log back in and that's it.
If later on you want to go back to using Xfwm4 instead of Compiz, open the same file again:
And replace "compiz" with "xfwm4", just like above.
Another way to do this is to (this is not the 100% proper way to do it, but I've added it in case the above method doesn't work for you): open Settings Manager > Session and Startup and on the Application Autostart tab, click "Add", under "Name" enter "Compiz" and under "Command", enter "compiz –replace" (both without quotes). You can leave the description field empty.