HOWTO XGL

From Gentoo Linux Wiki

Jump to: navigation, search

Eye Candy
spacer


Methods

  • HOWTO XGL
    • Tips and Tricks
    • Troubleshooting
    • Alternative Run Methods
    • Weblinks
  • HOWTO AIGLX
  • HOWTO Metisse
  • HOWTO nVidia GL Desktop Effects

Window Managers

  • Beryl
  • Compiz
    • Tips and Tricks
    • Troubleshooting
  • Metacity
  • KWin

X Configuration

  • HOWTO Modular Xorg
edit
Note: Please note that XGL will not be added to portage due to dependency problems at this time. See bug #135329.
spacer
Wikipedia has an article on:
XGL

Contents

  • 1 Introduction
  • 2 Hardware Prerequisites
  • 3 Installing Xgl
    • 3.1 Software Prerequisites
    • 3.2 Checking Out A Portage Overlay
    • 3.3 Unmasking Relevant Packages
    • 3.4 Installing Xgl
    • 3.5 Updating Xgl
      • 3.5.1 Layman Update
      • 3.5.2 Manual Update
        • 3.5.2.1 Troubleshooting
  • 4 Running Xgl
    • 4.1 Configure a Compositing Window Manager
    • 4.2 Windowed Mode
    • 4.3 startx
    • 4.4 XDM
    • 4.5 KDM (for KDE users)
    • 4.6 GDM (for GNOME users)
      • 4.6.1 Configuring GDM to Wait Longer for Xgl to Start
      • 4.6.2 Configuring GDM to Use the Xgl Server
        • 4.6.2.1 Using gdmsetup
        • 4.6.2.2 Manually
    • 4.7 Alternative Run Methods
  • 5 More Information
[edit]

Introduction

spacer
spacer
Window sorting feature
spacer
spacer
Compiz Alt+Tab replacement
spacer
spacer
Cube plugin without 'in' setting and moving a window across desktops
spacer
spacer
Transparent Mplayer over desktop and programs - by neppakyo

Xgl is an X server that uses OpenGL for its drawing operations. Together with a compositing window manager such as Compiz or newer versions of Metacity, it allows for excellent quality 3D and 2D desktop effects. Xgl relies on an extension to Mesa, GLX_EXT_texture_from_pixmap, that is present only in Mesa >= 6.5.

Please note that the newest closed-source drivers from nVidia (version 1.0.9xxx) have XGL-like features onboard. There is no need to install anything else. If you don't want to use the newest drivers or you are using the legacy drivers, then you can follow this guide to gain GL desktop features. For information on using nVidia 9xxx drivers, please see HOWTO nVidia GL Desktop Effects.

Warning: This software isn't yet considered stable, but it works well in most situations. Use with caution anyway.
[edit]

Hardware Prerequisites

Please see HARDWARE Video Card Support Under XGL.

[edit]

Installing Xgl

[edit]

Software Prerequisites

Modular XOrg and Subversion are required for XGL installation.

XOrg 7.x Installation:

  • HOWTO Modular Xorg
  • www.gentoo.org/proj/en/desktop/x/x11/modular-x-howto.xml


Subversion Installation: You will also need to merge Subversion with webdav support enabled. You must disable the nowebdav flag. Add a line to /etc/portage/package.use if necessary:

File: /etc/portage/package.use
dev-util/subversion -nowebdav
# emerge -nav subversion
[edit]

Checking Out A Portage Overlay

This section has been moved to HOWTO Gentoo xeffects. Please update your links.

[edit]

Unmasking Relevant Packages

Many packages are marked as unstable and need to be unmasked so that portage will install them. Add the following to both /etc/portage/package.keywords and /etc/portage/package.unmask

File: /etc/portage/package.keywords
# Dependencies
dev-util/git
media-libs/glitz
media-libs/mesa
x11-apps/mesa-progs
sys-apps/man
x11-libs/cairo
dev-python/pycairo
x11-libs/qt
x11-misc/util-macros
x11-proto/glproto
x11-apps/xvinfo
x11-apps/xlsclients
x11-libs/libwnck
x11-misc/xwinwrap
virtual/xft
gnome-base/gconf
gnome-base/libgnomeui
x11-libs/gtk+
dev-libs/glib
x11-libs/libdrm

#XGL Package
x11-base/xgl

Ensure the glitz, pdf and png USE flags are enabled for Cairo. You will need to add the following line to package.use:

File: /etc/portage/package.use
x11-libs/cairo glitz pdf png X
[edit]

Installing Xgl

The first thing we will do is emerge Cairo.

# emerge --ask --verbose cairo 

Rebuild pango and gtk+ against the newly built Cairo package.

# emerge --ask --verbose pango gtk+

Verify glproto and libdrm are installed. Install them if necessary:

# emerge --ask --verbose --noreplace glproto libdrm

Emerge Xgl and Mesa:

# emerge --ask --verbose --noreplace mesa
# emerge --ask --verbose xgl

Then nVidia users should reinstall their driver package:

# emerge nvidia-drivers
Note: If xgl fails to compile fbmmx.c or fbedge.c, try removing the "-fforce-addr" flag from your CFLAGS. Have a look at forums.gentoo.org/viewtopic-t-486789-highlight-xgl+fbmmx.html
Note: If xgl still fails to compile, check out the fix on forums.xgl-coffee.org/viewtopic.php?t=178


When everything is done, Cairo should be present on your system as dependency. Check it with equery, a program contained in gentoolkit:

# equery d -o -p cairo

You should now have a functional Xgl installation.

[edit]

Updating Xgl

[edit]

Layman Update

Updating the overlay files with Layman is easy:

# layman -s xeffects
[edit]

Manual Update

Place the following script into the xeffects overlay directory:

File: /usr/local/portage/xeffects/svnup.sh
#!/bin/bash
# svn update and print log changes
REV="$(svn info | grep Revision | awk '{ print $2 }')"
echo "Update from revision ${REV} ..."
svn update "$@"
NEWREV="$(svn info | grep Revision | awk '{ print $2 }')"
 [[ "${REV}" -ne "${NEWREV}" ]]  && \
    svn log --verbose --revision "HEAD:$((${REV} + 1))"

Make it executable:

# chmod +x /usr/local/portage/xeffects/svnup.sh

Then change to the directory and execute it:

# cd /usr/local/portage/xeffects/
# ./svnup.sh
[edit]
Troubleshooting

The Beryl SVN repository has recently changed it's web address, and as a result, old copies of SVN distfiles will block new compiles of -9999 ebuilds.

!!! subversion.eclass: ESVN_REPO_URI (or specified URI) and working copy's URL are not matched.

Solution:

rm -rf /usr/portage/distfiles/svn-src/*
[edit]

Running Xgl

[edit]

Configure a Compositing Window Manager

You may choose Compiz or Beryl. Please see those pages for more information.

[edit]

Windowed Mode

Running Xgl in this manner creates an X-Nest window containing the Xgl server. This is an excellent way to test out your installation before attempting to start it in fullscreen mode.

To try it out as another window on an already running X server:

Code: For ati users
Xgl :1 -ac -accel glx:pbuffer -accel xv:pbuffer -fp /usr/share/fonts/misc,/usr/share/fonts/other_fonts
Code: For nvidia users
Xgl :1 -ac -accel glx:pbuffer -accel xv -fp /usr/share/fonts/misc,/usr/share/fonts/other_fonts


Xgl will not read the configuration of FontPath in xorg.conf, thus it's better to append the font paths separated by comma with -fp option. You can also use this script to get all font paths automatically from xorg.conf:

 grep -i fontpath /etc/X11/xorg.conf | egrep -v "[:space:]*#" | sed "s/.\+\"\(.\+\)\"/\1,/g" | xargs echo | sed "s/\ //g" | sed "s/,\$//"

To test your configuration, start a compositing window manager, then an xterm. Follow directions for each individual window manager, while remembering to prepend the command with DISPLAY:1 to start on your windowed X session.

Then start your xterm:

# DISPLAY=:1 xterm &

If this was successful, we can now configure your system to start Xgl with your graphical login manager. You will need to follow the instructions for whichever graphical login system you use. This is the last step required in order to fully use Xgl.

[edit]

startx

If you usually boot to console and use startx to start Xorg server and .xinitrc to load your desktop manager at DISPLAY:0, you can alternatively create startxgl to start Xgl server and .xglinitrc to load the desktop manager at DISPLAY:1. This will not replace your current configuration, so you can return to the normal XOrg server at your convenience.

1) Copy startx (cp /usr/bin/startx /usr/local/bin/startxgl) and modify 2 lines:

File: /usr/local/bin/startxgl
 ## userclientrc=$HOME/.xinitrc
 userclientrc=$HOME/.xglinitrc

 ## xinit $clientargs -- $serverargs -deferglyphs 16 &
 # ATI
 xinit $clientargs -- /usr/bin/Xgl :1 $serverargs -ac -accel xv -accel glx:pbuffer -deferglyphs 16 &
 # NVIDIA
 xinit $clientargs -- /usr/bin/Xgl :1 $serverargs -ac -accel xv -accel glx:fbo -deferglyphs 16 &

2) create ~/.xglinitrc (vi ~/.xglinitrc)

File: ~/.xglinitrc
 sleep 2 # give Xgl some extra time to start
 # setxkbmap fi # Use if keyboard does not work properly
 ##------KDE USERS------
 #DISPLAY=:1 KDEWM=compiz-decorator exec startkde
 DISPLAY=:1 KDEWM=beryl-manager exec startkde
 ##------GNOME USERS------
 #DISPLAY=:1 WINDOW_MANAGER=compiz-decorator exec gnome-session
 #DISPLAY=:1 WINDOW_MANAGER=beryl-manager exec gnome-session

If you experience dbus problems, e.g. while using banshee, simply add banshee-launch to the DISPLAY line

File: ~/.xglinitrc
 DISPLAY=:1 WINDOW_MANAGER=beryl-manager exec banshee-launch gnome-session

3) To start your desktop manager with XOrg use startx, to start it with Xgl use startxgl.

[edit]

XDM

Simply replace the reference to the standard X server with the Xgl server:

File: /etc/X11/xdm/Xservers
:0 local /usr/bin/Xgl vt7
[edit]

KDM (for KDE users)

KDM can start Xgl by default with a couple configuration file changes.

The ServerCmd entry controls how the X server is called. We'll change this to reflect the Xgl server:

File: /usr/kde/<your version>/share/config/kdm/kdmrc
# NVidia Command
ServerCmd=/usr/bin/Xgl -br -ac -accel glx:pbuffer -accel xv
# ATI Command
ServerCmd=/usr/bin/Xgl -br -ac -accel glx:pbuffer -accel xv:pbuffer


You will also have to change the ServerTimeout setting in the same section since Xgl might take a little longer to start up than normal X:

File: /usr/kde/<your version>/share/config/kdm/kdmrc
ServerTimeout=30
[edit]

GDM (for GNOME users)

You must do three things to have Xgl work with GDM and have Compiz load automatically when you log in.

  1. Configure GDM to wait long enough for Xgl to start before assuming it is defunct.
  2. Configure GDM to use the Xgl server.
  3. Setup your GNOME-session to automatically load your compositing window manager.
[edit]

Configuring GDM to Wait Longer for Xgl to Start

GDM is configured, by default, to kill an Xserver that has taken longer than 10 seconds to start up. Unfortunately, newer versions of Xgl can take longer than this. Due to the work of Gentoo Xgl users, Gdm (as of version 2.14.1) can now be configured to wait longer than 10 seconds.

# emerge --ask --verbose >=gdm-2.14.1

Add/modify the following commands to the [daemon] section of /usr/share/gdm/defaults.conf. The line:

File: /usr/share/gdm/defaults.conf
GdmXserverTimeout=30
[edit]

Configuring GDM to Use the Xgl Server

[edit]
Using gdmsetup
  • First, back up your gdm.conf file *AND* custom.conf
# cp /usr/share/gdm/defaults.conf /usr/share/gdm/defaults.conf.bak
# cp /etc/X11/gdm/custom.conf /etc/X11/gdm/custom.conf.bak
  • Run gdmsetup
  • Select the Security tab
  • Click the Configure X Server button found at the bottom right of the tab

First we delete the entry for the standard X server

  • Click on the standard server that appears in the Servers to Start list
  • Click the Remove Button

Now we create a new entry for the Xgl server

  • Click the Add/Modify button
  • Set the new server to use VT 1. Use Standard for the Server option — this indicates which profile to use for the server, ideally we could create a new "Xgl" profile here but at the present time we cannot create a new profile using gdmsetup, so we'll just modify the settings for the Standard profile. Don't enter any options here. Click Ok when done.
  • Under Server Settings change the Server Name to "Xgl"
  • Enter your Xgl command in the Command box, for example, ATI users would type:
/usr/bin/Xgl :1 -ac -accel glx:pbuffer -accel xv:pbuffer
  • NVIDIA users should use:
/usr/bin/Xgl -br -ac -accel glx:pbuffer -accel xv
  • Change the Launch dropdown to Greeter
  • Check the Logins are handled by this computer box
  • Check the Flexible (on demand) box
  • Save and Close
  • Restart GDM
[edit]
Manually
  • First, back up your gdm.conf file *AND* custom.conf
# cp /usr/share/gdm/defaults.conf /usr/share/gdm/defaults.conf.bak
# cp /etc/X11/gdm/custom.conf /etc/X11/gdm/custom.conf.bak
  • Now open /usr/share/gdm/defaults.conf in a text editor and search for the [servers] section. This should be near the end of the file.
  • Comment out 0=Standard and add a new line that reads 0=inactive and one that reads 1=Xgl.
  • Add the server information for the Xgl server, remember to substitute the correct Xgl server command! The one below is for ATI cards.

The modified /usr/share/gdm/defaults.conf:

File: /usr/share/gdm/defaults.conf
 
[servers]
#0=Standard
0=inactive
1=Xgl

# Definition of the Xgl X server.
[server-Xgl]
name=Xgl
# INSERT YOUR XGL COMMAND BELOW, i.e. for ATi:
command=/usr/bin/Xgl -br -ac -accel glx:pbuffer -accel xv:pbuffer
flexible=true
chooser=false
handled=true
priority=0
  • Restart GDM
[edit]

Alternative Run Methods

More run methods for XGL/Compiz/Beryl have been moved to another page. Please note that these have been moved because they are either incomplete, incorrect, uncommon, or outdated. Use them at your own risk.

HOWTO XGL/Alternative Run Methods

[edit]

More Information

HOWTO XGL/Weblinks
HOWTO XGL/Tips and Tricks
HOWTO XGL/Troubleshooting

Retrieved from "gentoo-wiki.com/HOWTO_XGL"
Views
  • Article
  • Discussion and Bugs
  • Edit This Page
  • History
Personal tools
  • Log in / create account
Navigation
  • Main Page
  • Wiki News
  • Recent changes
  • Random page
  • Help
Indexes
  • HOWTO Index
  • Tips & Tricks
  • MAN Pages
  • Hardware
  • Security
  • FAQ
  • Screenshots
  • Misc
  • Other Indexes

  • Wiki Pages
  • Wanted Articles
  • Categories
Toolbox
  • What links here
  • Related changes
  • Upload file
  • Special pages
  • Printable version
In other languages
  • Deutsch
  • Español
  • Français
  • עברית
  • Magyar
  • Русский
  • 中文
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.