Friday, October 12, 2007

amsn 0.97b package with font anti-aliasing for debian


Debian added Tcl/Tk 8.5 in their unstable repos recently.

I took advantage of that and built a Tcl/Tk 8.5 version of the latest svn version of amsn (0.97b).

Download it and install it by typing the following commands:

sudo apt-get install tcl8.5 tk8.5
sudo dpkg -i amsn_0.97b_tcltk_8.5.deb


now you can try launching amsn

amsn &

finally, anti-aliased fonts ;)


Sunday, August 19, 2007

How-to: Debian, ATI, XGL + Compiz Fusion/Beryl

After a LOT of research, I am proud to present the Debian, ATI, XGL + Compiz Fusion/Beryl How-To!

Current version: 1.1

1.1 changes:
- Added Fusion Icon in Compiz. Now you can easily manage Compiz Fusion with the help of a tray icon :)

What's needed:
- Debian Unstable (sid): Etch could work too, but I haven't tried it.
- KDE or Gnome Desktop w/ GDM (KDM won't cut it, its so slow you need a minute to login...)
- ATI Graphics card supported by the (in)famous fglrx driver (tested on Radeon Mobility 9600)
- Basic shell knowledge


1. Update your system and get GDM if you don't have it

Either use your favorite package management tool (Adept/Synaptic) or the following commands to make sure you have the latest packages.

sudo apt-get update
sudo apt-get dist-upgrade

Make sure you're running the 2.6.22 kernel. If you aren't, get the new one:

// AMD
sudo apt-get install linux-image-2.6-k7

// INTEL
sudo apt-get install linux-image-2.6-686

Now install GDM

sudo apt-get install gdm

when asked, select gdm as your default login manager (don't worry, you can login to kde with gdm)

Note: I am using sudo to run commands as root. If you don't like it, become root and run the same commands without sudo!

2. Add some new repositories

Some stuff needed for this aren't included in Debian. Open the file /etc/apt/sources.list with your favorite text editor (as root) and add the lines listed below:

deb http://cairographics.org/packages/debian/ unstable/
deb http://download.tuxfamily.org/osrdebian/ unstable compiz-fusion-git
deb http://download.tuxfamily.org/3v1deb/ debian-unstable beryl-svn


save and close the file

Now update your package lists by typing

sudo apt-get update

===
Note: to edit the file from a terminal type

sudo vi /etc/apt/sources.list

to edit the file with a Graphical Text Editor type

sudo kwrite /etc/apt/sources.list
OR
sudo gedit /etc/apt/sources.list

===


3. Get the xserver-xgl package from ubuntu feisty

You're probably wondering why... Simple, it works! I've tried other packages without any luck but this one worked :)

Get the file from this link:
Ubuntu xserver-xgl mirrors


4. Download and install the latest and greatest (yeah right...) ATI driver.

You can download the file from this link:
ATI Linux Driver

You're gonna need some extra tools to finish the installation, its a good idea to install them now by typing:

sudo apt-get install module-assistant debhelper
sudo m-a prepare
(say yes to all)

When everything is done, you'll have to prepare the ATI driver for installation (make sure your shell is at the same directory where the ATI driver is located)

chmod +x ati-driver-installer-8.40.4-x86.x86_64.run
sudo ./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Debian/unstable
sudo dpkg -i fglrx*


This phase may bring up some errors but you can ignore them for now. Next is the kernel module of the driver:

sudo m-a a-i fglrx
sudo apt-get -f install


Right now you should be ready to switch to the latest fglrx driver. Patch your xorg.conf by typing:

sudo aticonfig --initial --overlay-type=Xv

then edit your
/etc/X11/xorg.conf file (sudo vi /etc/X11/xorg.conf) and make sure that you have the following sections looking like mine (if a section is missing, add it!):

Section "Extensions"
Option "Composite" "0"
Option "RENDER" "Enable"
EndSection

Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "vbe"
Load "GLcore"
EndSection

Section "DRI"
Mode 0666
EndSection

Just to make sure, you can reboot your computer now and type the following command in a console after your Desktop has loaded:

fglrxinfo

If you get something similar to this, you're good to go!

display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI MOBILITY RADEON 9600/9700 Series
OpenGL version string: 1.2 (2.0.6747 (8.40.4))


5. Installing XGL

Type the following commands in a console (you need to be where the xgl package currently is)

sudo apt-get install libglitz-glx1 libglitz1
sudo dpkg -i xserver-xgl_7.2.0.git.20070224-0ubuntu3_i386.deb
sudo apt-get -f install


6. Installing Compiz Fusion and/or Beryl

Run the following commands:

// Compiz Fusion
sudo apt-get install compiz compiz-fusion-plugins-main compiz-fusion-plugins-extra compiz-fusion-plugins-unsupported compizconfig-settings-manager
fusion-icon

If you're running KDE get this package as well:
sudo apt-get install compiz-kde

// Beryl
sudo apt-get install beryl



7. Installing Window Decorators

Run the following commands:

// KDE (beryl only)
sudo apt-get install aquamarine


// Gnome (beryl only)
sudo apt-get install heliodor


// Emerald (optional)
sudo apt-get install emerald emerald-themes


8. Fix some important paths to enable XGL acceleration

XGL expects to find dri modules in the old dri directory, so we have to create a link to the new one

sudo mkdir -p /usr/X11R6/lib/modules/
sudo ln -s /usr/lib/dri /usr/X11R6/lib/modules/dri


9. Create a wrapper for the fusion-icon app (COMPIZ ONLY)

Run the following command (or edit /usr/bin/compiz-manager with your favorite text editor as root):

sudo vi /usr/bin/compiz-manager

type in the following:
#!/bin/bash
LD_PRELOAD=/usr/lib/fglrx/diversions/libGL.so.1.2 /usr/bin/fusion-icon $@

then make the file an executable:

sudo chmod +x /usr/bin/compiz-manager

10. Alter GDM configuration to start with XGL (also: KDM instructions for the brave)

IMPORTANT NOTE: kdm is painfully slow (unusuable) under XGL, especially in high resolutions. I recommend running GDM even if you're using a KDE desktop :)

// GDM
edit the file
/etc/gdm/gdm.conf

sudo vi /etc/gdm/gdm.conf

add the following under [servers]:

0=Xgl

add the following lines at the end of the file

[server-Xgl]
name=Xgl
command=/usr/X11R6/bin/Xgl -fullscreen -ac -accel glx:pbuffer -accel xv:fbo -fp /usr/share/fonts/X11/misc/
flexible=true

// KDM
If you must use KDM, here's how (NOT recommended):

Edit /etc/kde3/kdm/kdmrc

sudo vi /etc/kde3/kdm/kdmrc

Find the following line:

ServerCmd=/usr/bin/X -br

and make it look like this one:

ServerCmd=/usr/X11R6/bin/Xgl -fullscreen -ac -accel glx:pbuffer -accel xv:fbo -fp /usr/share/fonts/X11/misc/


11.a. GNOME ONLY

You should be ready to go.

Reboot your computer (or restart your login manager) and login to your Desktop.

If you think everything's a bit too slow, don't worry! Its because you haven't launched Compiz/Beryl yet.

Launch a terminal and type the following command to get Compiz Fusion up and running (as a normal user):

compiz-manager

if nothing happens, you'll have to activate compiz. Do that by right-clicking on the new blue cube in your system tray and selecting Select Window Manager -> Compiz


To start beryl type:

beryl-manager

(you might need to right click on the diamond @ your system tray and select Beryl from the window manager submenu before beryl actually takes over)

Thats it! If all went well, you should be looking at your newly XGL accelerated desktop.

Try moving a window around to confirm it and check Compiz/Beryl options for more features!

Check out point 12 on how to make Compiz/Beryl autostart :)


11.b. KDE

IMPORTANT: If you're running KDE, DONT REBOOT. KDE is extremely slow without compiz/beryl loaded. So slow, it'll take you a minute to open up a console! Follow the instructions at point 12, then restart! KDE will take a while to load, but then everything should run smoothly!


12. Autostart Compiz/Beryl

If everything went well, you'll probably want to autostart compiz/beryl each time you login:

// KDE (if you have the session restore feature of kde enabled, you dont have to do this)
edit the file
~/.kde/Autostart/xglmanager (new file, normal user) and add the following lines in it:

#!/bin/bash
compiz-manager &

or these lines for beryl:

#!/bin/bash
beryl-manager &

then make the file an executable

chmod +x ~/.kde/Autostart/xglmanager

// GNOME
Go to
System -> Preferences -> Sessions
Click
New
Type in
Compiz or Beryl in the name field
and
compiz-manager or beryl-manager in the command field
click
OK and you're done!

=== DONE! ===

I hope this How-To helps all you guys out there who love Debian and are using an ATI card :)
Comments/Corrections most welcome.

Have fun with Compiz/Beryl!