FUSE filesystem that pretends to contain $LIB/libGL.so.1 symlinks. On
access, redirect to system libGL or primus' libGL based on user's response.
User choices are saved in $XDG_CONFIG_HOME/libgl-switcheroo.conf.
Add the following lines into ~/.xprofile:
mkdir -p /tmp/libgl-switcheroo-$USER/fs
gtkglswitch &
libgl-switcheroo /tmp/libgl-switcheroo-$USER/fs &
If you are using KDM, GDM, or LXDM to login into an X session, the commands
from ~/.xprofile are executed. Otherwise, make sure that .xprofile is
sourced during X session startup (add . ~/.xprofile into your .xinitrc).
You can then run the following command in a shell session to make all programs run from that session go through the libGL switcheroo (useful for Steam):
export LD_LIBRARY_PATH=/tmp/libgl-switcheroo-$USER/fs/\$LIB${LD_LIBRARY_PATH+:}$LD_LIBRARY_PATH
make LIB64PATH=\"lib\" LIB32PATH=\"lib32\"
Adjust LIBxxPATH variables above as appropriate for your distribution
(reflecting how /usr/lib* are named):
- Arch needs
libandlib32as above - Gentoo needs
lib64andlib32 - RPM-based may need
lib64andlib - Debian (with multiarch) needs
lib/x86_64-linux-gnuandlib/i386-linux-gnu - Ubuntu (with multiarch) needs
x86_64-linux-gnuandi386-linux-gnu, and additionallyLIBPATH=\"/usr/lib\"