Упатство:Инсталација на Beryl

Од Сподели wiki
Преработка од 22:16, 14 март 2007; направена од 62.162.80.170 (разговор)
(разл) ← Претходна преработка | Последна преработка (разл) | Следна преработка → (разл)
Прејди на прегледникот Прејди на пребарувањето

Note: Using AIGLX is preferred on Edgy Eft because it is included with X.org on Edgy.

Introduction

Installing Xgl and Beryl in (K)ubuntu Edgy Eft is simple. Getting it working is slightly more complex, but this how-to should make it easy. If you have used compiz previously, it will be very familiar ground indeed. And yes, if you think you can update / clarify / improve the instructions on this page, please register, log in and go ahead and add your suggestions. Have fun!


Note: More documentation is available at https://help.ubuntu.com/community/CompositeManager/XGL


Note: Lennart Hansen has written an all-graphical guide, Beryl and Xgl on Ubuntu Edgy Eft with ATI card. Lots of screenshots and handy for those who prefer not to use the terminal.

Graphic Card Drivers and 3D Video Acceleration

Note: If you have previously used Xgl with compiz, you should be good to go and you can skip this step.

The Xgl X server requires 3D video acceleration. Most graphics cards should automatically support 3D acceleration in Edgy Eft; some graphics cards might need some tweaking though.

You can check whether direct rendering is enabled by invoking

glxinfo | grep direct

in a terminal. If it returns

direct rendering: Yes

For ATi graphics cards you can check with:-

 fglrxinfo

then you're ready to install Xgl and Beryl. If it doesn't, you might need to install the appropriate driver for your graphics card. Follow the official Ubuntu Desktop Guide's instructions for Nvidia or ATI graphics card drivers, or check the ATI Linux Drivers Wiki for ATI fglrx drivers.

Migrating from Compiz-QuinnStorm

If you have the QuinnStorm version of Compiz installed on your system and want to migrate to Beryl, it's best to uninstall Compiz first and then install Beryl from scratch. Simply use Synaptic (GNOME) or Adept (KDE) to remove the compiz, compiz-gnome and gset-compiz meta-packages or use the command line:

sudo apt-get remove compiz compiz-gnome gset-compiz

and continue on with the rest of the tutorial.


Adding the Beryl Project repositories

Now add the Beryl Project's repository to /etc/apt/sources.list. This can be done using the Synaptic or Adept graphical interfaces, or from the command line. The line to be added is

deb http://ubuntu.beryl-project.org/ edgy main

Note: A number of mirrors are available if you find yourself getting slow speeds from the primary host. The current list of mirrors includes

deb http://www.beerorkid.com/compiz edgy main-edgy (latest: beryl 0.1.1)
deb http://media.blutkind.org/xgl edgy main (latest: beryl 0.1.1)
deb http://beryl.xglusers.de/ edgy main (latest: beryl 0.1.4; no aquamarine)
deb http://download.tuxfamily.org/3v1deb edgy beryl-svn ( bleeding edge beryl development, use with care )


Note: Are all these accurate? I've removed the ones I /know/ to be wrong...

Note: Fixed beerorkid.com repository; needed main-edgy instead of just main.

The packages in the repository are signed with a gpg signature so you can verify that they are valid. To add the gpg key to your keychain, use Synaptic / Adept or invoke the following command:

$ wget http://ubuntu.beryl-project.org/root@lupine.me.uk.gpg -O- | sudo apt-key add -
$ wget http://download.tuxfamily.org/3v1deb/DD800CD9.gpg -O- | sudo apt-key add - 
$ wget http://www.beerorkid.com/compiz/quinn.key.asc -O - | sudo apt-key add -

Next, make apt aware of the new software repositories by issuing the following command

$ sudo apt-get update

Done! The new software repositories should now be available for use.

Installing Xgl and Beryl

Use Synaptic or Adept to install the xserver-xgl package, or use the command line

$ sudo apt-get install xserver-xgl

Next, install the beryl and emerald-themes packages

$ sudo apt-get install beryl emerald-themes 

If you want to use the KDE window decorator, then append "aquamarine" to the above line. Note: beryl is a metapackage that will install the dependencies (beryl-core, beryl-plugins, beryl-manager, beryl-settings) as well as the emerald decorator but not emerald-themes.


Configuration

There are a number of ways to log into an Xgl Session and start the Beryl composite manager. Check and see which one suits you best.

Adding an Xgl login session

Adding a separate Xgl session to your (gdm or kdm) login screen is recommended for most situations because it allows you to switch easily between Xgl and standard Xorg sessions. After all, Xglx is not meant to be a full-fledged replacement for the standard Xorg server. Some applications (such as OpenGL games) might not run properly in an Xgl session; and keep in mind that the Beryl composite manager is still very much a work in progress. If you run into bugs or problems, you'll have your standard X session at your fingertips.

Adding an X session to your login screen is a two-step process: first we'll create a startup script that invokes the Xgl session and our desktop environment. Then we'll create the login screen entry that uses our script.


The startup script: Use your favorite text editor to create a script startxgl.sh in your path, like so:

$ sudo gedit /usr/local/bin/startxgl.sh

Note: The contents of the script varies depending on your desktop environment and the graphics card you use. And yes, users of other window managers, please help out and add your own startup scripts here.


GNOME & Nvidia graphics card

#!/bin/sh
/usr/bin/Xgl :1 -fullscreen -ac -br -accel xv:fbo -accel glx:pbuffer &
sleep 4  
export DISPLAY=:1 
exec gnome-session

For KDE, change the last line to

exec startkde


GNOME & ATI graphics card

#!/bin/sh
Xgl -fullscreen :1 -ac -br -accel glx:pbuffer -accel xv:pbuffer &
sleep 4  
export DISPLAY=:1 
exec gnome-session

Shutdown and reboot buttons in GNOME

Zoogie reported in the Ubuntu forums the following solution to the missing shutdown and reboot buttons in GNOME's exit menu. Your startxgl.sh should look like this:

#!/bin/sh
Xgl -fullscreen :1 -ac -br -accel glx:pbuffer -accel xv:pbuffer &
sleep 4  
export DISPLAY=:1 
cookie="$(xauth -i nextract - :0 | cut -d ' ' -f 9)"
xauth -i add :1 . "$cookie"
exec gnome-session


Alternative

For me, above script did load XGL properly, and Beryl could be run too. However, my theme wasn't loaded, everything looked incredibly ugly. Folders, files, everything had no theme. After some searching I found the following startxgl.sh script, which loads gdm as well, so gives me back my theme:

#!/bin/sh
Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer &
DISPLAY=:1
exec dbus-launch --exit-with-session gnome-session

Note: You may also need to install beryl-dbus as it wasn't installed on my system by default.

If you have a problem with your fonts appearing tiny, you may need to add the -dpi 96 flag to the Xgl call:

Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer -dpi 96 &

However, this is kind of a dirty trick. Normally the xserver automatically calculates the correct dpi by using the resolution and the size of the monitor. So if the dpi is too low, it probably means that the size of the monitor is not read correctly by the graphics card. Adding the following line to the Monitor section of the xorg.conf will solve this;

DisplaySize  344        222

Of course with the two numbers corresponding to the size of your monitor!! In milimeters.


Note: If your shutdown/restart buttons disappear when you are in Xgl you can add these lines to your startxgl.sh script:

cookie="$(xauth -i nextract - :0 | cut -d ' ' -f 9)"
xauth -i add :1 . "$cookie"

making it look like this:

#!/bin/sh
Xgl :1 -fullscreen -ac -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 gnome-session

For KDE, change the last line to

exec startkde

For XFCE, change the last line to

exec xfce4-session

Making the script executable: Now make sure the script has the right permissions settings set so that it can be invoked by session login entry - this can be done in Nautilus or Konqueror or simply by typing the following into a terminal:

$ sudo chmod a+x /usr/local/bin/startxgl.sh


IMPORTANT NOTE I recently found that if we start Gnome/KDE this way, we may lose font or mouse pointer configuration, since they don't get loaded with Xgl. The correct way that I found was to use "exec /etc/X11/Xsession" instead of gnome-session or startkde. Then you can put gnome-session or startkde as an Xsession argument, for example, "exec /etc/X11/Xsession startkde". - Lesterchakyn


Creating the login session entry: To create the login entry, create a new file /etc/X11/sessions/xgl.desktop

$ sudo mkdir -p /etc/X11/sessions
$ sudo gedit /etc/X11/sessions/xgl.desktop

Make it look like this:

[Desktop Entry]
Encoding=UTF-8
Name=Xgl
Exec=/usr/local/bin/startxgl.sh
Icon=
Type=Application

Note: The Name=Xgl entry is the description of the session that you'll see in your login menu, so you could change it to 'Xgl-Gnome' or 'Xgl-Beryl' if it suits you better.

Note: I had to create this file in /usr/share/xsessions before it was picked up by kdm - Huub Bouma


Done!


When you get to the GDM or KDM login screen, you should now have a session called 'Xgl' available; if you log into this session, Xgl will run as an overlay to the standard Xorg X session (that is, on DISPLAY: 1) and load your desktop environment. Logging into your normal session will give you the standard, un-accelerated desktop for trouble-shooting or running programs which don't play nicely with Xgl.

Changing your standard login

For GNOME: Instead of adding a sekillall beryl-parate desktop session, you could alter your standard X session. This is not recommended for most users (see above). It might be useful however if you do not want to set up a separate X session for Beryl for some reason.

First change gdm.conf-custom:

$ sudo nano /etc/gdm/gdm.conf-custom

Go to the very bottom of the file and add:

0=Xgl
[server-Xgl]
name=Xgl server
command=/usr/bin/Xgl :0 -fullscreen -ac -accel glx:pbuffer -accel xv:fbo
flexible=true

When you reboot or restart the graphical session, the Xgl server should be running.

Running Beryl

Now it's time to test your Beryl installation. Open a terminal and type

$ beryl-manager

If all goes well, you should see the Beryl splash screen and your windows will become wobbly! Your system tray should show the Beryl icon - a red gem - that you can use to adjust beryl's and emerald's settings. Click on 'Beryl settings manager' or Emerald, the theme manager. It also provides fallback to another window manager (metacity for example), in case Beryl crashes.

If you don't see the beryl splash screen immediately, you may need to tell the manager to load Beryl - right-click on the red gem, go to "Select Window Manager" and choose "Beryl". If that doesn't work, there's a problem somewhere! Often, useful debugging output will show in the terminal window you used to start beryl with.


IRC channels


Ubuntu users can ask for help on the #ubuntu-xgl or #xgl channels on irc://irc.freenode.net/


Adding Beryl to Session Startup

Assuming all goes well, you can set up Beryl Manager to start up every time you load into your Xgl session.


GNOME


Note: This method will add beryl-manager to every gnome session, not just the Xgl session. Not very useful for those who wish to keep their Xorg and Xgl sessions separate. See below.

  • Go to System ? Preferences ? Sessions
  • Go to the 'Startup Programs' tab
  • Click the 'Add' button and type beryl-manager into the dialog box
  • Click 'Close'

Addenda:

1) If the window decorations do not show up when starting beryl this way, try adding beryl-xgl to the startup programs as well. See the Troubleshooting section below.

2) A command line version of this tip can be seen here.


KDE


Add beryl-manager to KDE's autostart. Open a terminal and create the following symlink:

$ ln -s /usr/bin/beryl-manager ~/.kde/Autostart/beryl-manager

Adding Beryl to an Existing Session


GNOME


To start beryl-manager only when the session "xgl" is started, I modified a script from Gentoo Wiki scripts.so:


Create the script: Use your favourite text editor to create a script start_beryl.sh. I placed and created it in /usr/local/bin/ so:

$ sudo gedit /usr/local/bin/start_beryl.sh

In the file paste this:

#!/bin/bash
#
# Start beryl-manager within gnome-session
#
if (( `ps -A -o comm | grep -c '^Xgl$'` == "1" )); then
       DISPLAY=:1 beryl-manager
       DISPLAY=:1 beryl-xgl
else echo "${0}: Error: beryl-manager not launched. Xgl not running?"
fi

and save the file.

Making the script executable: Now make sure the script has the right permissions settings set so that it can be invoked by session login entry - this can be done in Nautilus or Konqueror or simply by typing the following into a terminal:

$ sudo chmod a+x /usr/local/bin/start_beryl.sh

Add the script to gnome session startup:

  • Go to System ? Preferences ? Sessions
  • Go to the 'Startup Programs' tab
  • Click the 'Add' button and type /usr/local/bin/start_beryl.sh into the dialog box
  • Click 'Close'

Now, you can logout and start a session. When you start a gnome session, the script looks if XGL is started, and so, if you are in a xgl-session, it launches beryl-manager.


KDE


The Gentoo Wiki offers several startup scripts that allow you to start beryl or compiz only when the Xgl server is running. If this script is added to GNOME's session startup programs or KDE's autostart, beryl won't start unless we have entered the Xgl session - a more elegant solution to beryl startup automation. However, these scripts were written for compiz and also include various workarounds for font and keyboard-related issues that might not be needed for most situations. So please, everyone test these scripts and take the time to write up what works and what doesn't in the appropriate troubleshooting page. Thanks on behalf of the community!

Also, the script mentioned above for starting beryl in gnome also works if added to KDE's autostart.

Troubleshooting

Ugly GTK/Icon Themes

If have problems with being unable to change the GTK(controls) or icon themes once logged into your XGL session; type the following into a terminal:

$ gnome-settings-daemon &

Now try to change GTK/icon themes. If it fixes the problem, add it to your startup programs (In System --> Preferences --> Sessions).

Xgl start problem under Debian

If you use this howto to install Beryl under Debian, you should start xgl with:

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

because the fonts are not located in the same directory between ubuntu and Debian. Then, all is going fine :)

Using Beryl

See Default Commands for some default commands.