3 NVIDIABUSID=$(lspci -d 10de: -n | grep '030[02]:' | cut -d' ' -f1 | tr . :)
5 case $(wc -l <<<"$NVIDIABUSID") in
7 echo "The BusID of the nVidia card can't be determined."
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 for driver in nvidia; do
29 -e "s,${re_busid},\1${NVIDIABUSID},"
35 echo "File $1 backed up as $1.pacsave"
40 # Backup old config files if they exist
41 if [ ! -f /etc/bumblebee/xorg.conf.nvidia ]; then
42 _backup /etc/bumblebee/xorg.conf.nvidia
44 if [ ! -f /etc/bumblebee/bumblebee.conf ]; then
45 _backup /etc/bumblebee/bumblebee.conf
50 _replace_busid /etc/bumblebee/xorg.conf.nvidia
52 echo "Update complete. The configuration files had been changed to their"
53 echo "default settings. You may need to restore them manually"
58 _replace_busid /etc/bumblebee/xorg.conf.nvidia
59 id -g bumblebee && echo "Bumblebee group existent" || \
60 groupadd bumblebee && echo "Bumblebee group created"
61 echo "Installation complete..."
63 echo "You must add yourself to 'bumblebee' group to run programs"
64 echo "Run your programs with: optirun <name of program>"
65 echo "Visit ArchWiki page on Bumblebee for documentation on how to finish setup,"
66 echo "configure and run applications with Bumblebee:"
67 echo "http://wiki.archlinux.org/index.php/Bumblebee"