updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / nvidia-utils-glselect / glselect
blobfb06c3431be5038608a9436c959387d8b15ff143
1 #!/bin/bash
2 # Written by Jonathan Schmidt <j.schmidt@archlinux.us>
4 # glselect - switch between mesa and nvidia gl libraries
7 newlib="$1"
9 if [ -e /usr/lib/libGLcore.so.1 ]
10 then
11 for i in `ls -l /usr/lib/libGLcore.so.1`
13 nvver=${i//libGLcore.so.}
14 done
15 elif [[ "$newlib" = "nvidia" ]]
16 then
17 echo "You do not have nvidia*-utils installed."
18 exit 1
21 if [[ "$newlib" = "mesa" ]]
22 then
23 ln -sf libGL.so.1.2 /usr/lib/libGL.so
24 ln -sf libGL.so.1.2 /usr/lib/libGL.so.1
25 ln -sf libglx.xorg /usr/lib/xorg/modules/extensions/libglx.so
26 elif [[ "$newlib" = "nvidia" ]]
27 then
28 ln -sf libGL.so.${nvver} /usr/lib/libGL.so
29 ln -sf libGL.so.${nvver} /usr/lib/libGL.so.1
30 ln -sf libglx.so.${nvver} /usr/lib/xorg/modules/extensions/libglx.so
31 elif [[ "$newlib" = "show" ]]
32 then
33 if [[ `readlink /usr/lib/libGL.so` = "libGL.so.1.2" ]]
34 then
35 echo "mesa"
36 elif [[ `readlink /usr/lib/libGL.so` = "libGL.so.${nvver}" ]]
37 then
38 echo "nvidia"
39 else
40 echo "You have not setup symlinks yet."
41 exit 1
43 else
44 echo "Usage: glselect [ mesa | nvidia | show ]"
47 exit