2 NVIDIABUSID=$(lspci -d 10de: -n | grep '030[02]:' | cut -d' ' -f1 | tr . :)
4 case $(wc -l <<<"$NVIDIABUSID") in
6 echo "The BusID of the nVidia card can't be determined."
7 echo "You must set that manually in $1"
10 NVIDIABUSID="PCI:$NVIDIABUSID"
11 #echo "Detected Bus ID: $NVIDIABUSID"
15 echo "Multiple graphics cards are not supported by Bumblebee yet. The"
16 echo "following PCI Bus IDs have been detected:"
18 echo "If this information is wrong, please report it to:"
19 echo "https://github.com/Bumblebee-Project/Bumblebee/issues"
20 # empty the ID so we can detect this as error
25 re_busid='^( *BusID +")[^"]*'
27 sed -E -i "$1" -e "s,${re_busid},\1${NVIDIABUSID},"
32 #echo "File $1 backed up as $1.pacsave"
38 if [ -f "$1.pacsave" ]; then
39 sumNew=$(openssl dgst -md5 "$1")
40 sumSave=$(openssl dgst -md5 "$1.pacsave")
41 if [ "x${sumSave##* }" = "x${sumNew##* }" ]; then
46 echo "New $1 saved as $1.pacnew"
53 # Backup old config files if they exist
54 if [ -f /etc/bumblebee/xorg.conf.nvidia ]; then
55 _backup /etc/bumblebee/xorg.conf.nvidia
57 if [ -f /etc/bumblebee/xorg.conf.nouveau ]; then
58 _backup /etc/bumblebee/xorg.conf.nouveau
63 if [ -f /etc/bumblebee/xorg.conf.nvidia ]; then
64 _replace_busid /etc/bumblebee/xorg.conf.nvidia
65 _restore /etc/bumblebee/xorg.conf.nvidia
67 if [ -f /etc/bumblebee/xorg.conf.nouveau ]; then
68 _replace_busid /etc/bumblebee/xorg.conf.nouveau
69 _restore /etc/bumblebee/xorg.conf.nouveau
71 groupadd bumblebee && echo "Bumblebee group created"
72 echo "Update complete."
78 # Backup old config files if they exist
79 if [ -f /etc/bumblebee/xorg.conf.nvidia ]; then
80 _backup /etc/bumblebee/xorg.conf.nvidia
82 if [ -f /etc/bumblebee/xorg.conf.nouveau ]; then
83 _backup /etc/bumblebee/xorg.conf.nouveau
88 #groupdel bumblebee && echo "Bumblebee group deleted"
89 echo "Uninstallation complete."
90 echo "You may delete the group 'bumblebee' now."
94 if [ -f /etc/bumblebee/xorg.conf.nvidia ]; then
95 _replace_busid /etc/bumblebee/xorg.conf.nvidia
97 if [ -f /etc/bumblebee/xorg.conf.nouveau ]; then
98 _replace_busid /etc/bumblebee/xorg.conf.nouveau
100 groupadd bumblebee && echo "Bumblebee group created"
102 echo "Installation complete..."
103 echo "Visit ArchWiki page on Bumblebee for documentation on how to finish setup,"
104 echo "configure and run applications with Bumblebee:"
105 echo "http://wiki.archlinux.org/index.php/Bumblebee"