How to Install Compiz-Fusion on Kubuntu Gutsy
by Jiang Yio on Oct.26, 2007, under Computing
Ubuntu Gutsy comes with Compiz-Fusion as the default window manager, so Ubuntu users have eyecandy enabled by default. If you like Kubuntu, does that mean you’re out of luck? Far from it! Because all the necessary packages are in the standard repositories, it’s pretty easy to get Compiz-Fusion on Kubuntu. Follow along!
Video Drivers
First, make sure you have the right video drivers installed. If you use Nvidia or ATI, you might want to enable the proprietary drivers via the Restricted Drivers Manager.
If you have a Nvidia card, make sure your xorg.conf is set up correctly:
$ sudo nvidia-xconfig –add-argb-glx-visuals -d 24
Xgl
If you have an ATI card and you’re using the proprietary driver, you have to install Xgl, an alternative X-server. Let’s first update our package index:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
Now install Xgl:
$ sudo apt-get install xserver-xgl
On Ubuntu Gutsy, Xgl will start automatically instead of Xorg, the default X-server. If that’s fine with you, you’re done setting up Xgl. If you want to be able to choose when logging in, we have to first stop Xgl from loading automatically:
$ mkdir ~/.config/xserver-xgl
$ touch ~/.config/xserver-xgl/disable
Now make a script that’ll start Xgl for you:
$ sudo kate /usr/local/bin/startxgl.sh
If you have an ATI card, put the following into the file:
#!/bin/sh
Xgl :1 -fullscreen -ac -br -accel xv:pbuffer -accel glx:pbuffer &
DISPLAY=:1
cookie=”$(xauth -i nextract - :0 | cut -d ‘ ‘ -f 9)”
xauth -i add :1 . “$cookie”
exec dbus-launch –exit-with-session startkde
If you have a Nvidia card, use the following instead:
#!/bin/sh
Xgl :0 -fullscreen -ac -br -accel xv:fbo -accel glx:pbuffer &
DISPLAY=:1
cookie=”$(xauth -i nextract - :0 | cut -d ‘ ‘ -f 9)”
xauth -i add :1 . “$cookie”
exec dbus-launch –exit-with-session startkde
Now make a desktop entry that lets you choose to start Xgl when logging in:
$ sudo kate /usr/share/xsessions/xgl.desktop
Put the following into the file:
[Desktop Entry]
Encoding=UTF-8
Name=XGL
Comment=Start an XGL Session
Exec=/usr/local/bin/startxgl.sh
Icon=
Type=Application
Now make both scripts executable:
$ sudo chmod +x /usr/local/bin/startxgl.sh
$ sudo chmod +x /usr/share/xsessions/xgl.desktop
To test Xgl, log out and choose the XGL entry before logging in.
Compiz-Fusion
Synchronize our package index in preparation for the Compiz-Fusion installation if it hasn’t been done yet:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
Install all the basic compiz packages and some supporting packages:
$ sudo apt-get install compiz compizconfig-settings-manager sexy-python librsvg2-common
If you want to use Beryl’s window decorator (emerald), install it and it’ll be used by default:
$ sudo apt-get install emerald
To start Compiz-Fusion, press [ALT]+[F2] and run “compiz –replace”, or run it in a terminal.
To start Compiz-Fusion every time you login, create an Autostart script:
$ kate ~/.kde/Autostart/compiz-fusion
If you’re not using Xgl, put the following into your script:
#!/bin/bash
sleep 5
compiz –replace
If you’re using Xgl, you might want to detect Xgl before running Compiz-Fusion:
#!/bin/bash
if xvinfo | grep -q Xgl ; then
xmodmap -e “keycode 22 = BackSpace BackSpace Terminate_Server” # or else [SHIFT]+[BKSP] kills Xgl
sleep 5
compiz –replace
fi
Now, if you find that Xgl demands too much system resources, you might want to tweak your script slightly:
#!/bin/bash
if xvinfo | grep -q Xgl ; then
xmodmap -e “keycode 22 = BackSpace BackSpace Terminate_Server” # or else [SHIFT]+[BKSP] kills Xgl
sleep 5
LD_PRELOAD=/usr/lib/fglrx/libGL.so.1.2.xlibmesa compiz –replace
fi
Make the script executable:
$ chmod +x ~/.kde/Autostart/compiz-fusion
Configuration
Now that you have Compiz-Fusion installed, you should configure it to give you all the effects you desire. Select “Settings” > “Advanced Desktop Effects Settings” from your “K” menu, or run “ccsm” on the commandline.
Before doing anything else, click on “Preferences” and in the “Backend” section, make sure “Flat-file Configuration Backend” is selected. Make a new profile by clicking the [+], so it’s easy to restore your settings. Click “Back” and look for the “Window Decoration” button. Right next to “Command”, type “kde-window-decorator” (this will prevent the window borders from disappearing in certain situations).
Now go on and configure your eyecandy!