Confira meus scripts para ativar / desativar monitores externos:
Instalação:
# You will need latest NVIDIA drivers installed. At the time of writing, version is 331.20.
# On ubuntu 13.10, it looks like this:
sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install nvidia-331
# Now we need to install bumblebee:
sudo add-apt-repository ppa:bumblebee/stable
sudo apt-get install bumblebee bumblebee-nvidia bbswitch-dkms
# Reboot
# Intel-virtual-output tool
# First, you will need latest xf86-video-intel driver installed (2.99). Ubuntu 13.10 comes with it,
# so you don’t need to update driver in that case. However, what made all of this possible is the
# latest release of intel-virtual-output tool, which comes bundled with xf86-video-intel driver
# source. But, ubuntu’s package does not bundle it, and we need to compile it from source. One
# MAJOR thing to note here is: DO NOT compile it from ubuntu’s deb-src package. That package is old,
# and current release has some major fixes for the tool that we will actually need in order to have
# everything working properly. So lets do it:
sudo apt-get install git xorg-dev git autoconf automake libtool
cd /usr/src
git clone git://anongit.freedesktop.org/xorg/driver/xf86-video-intel
cd xf86-video-intel
./autogen.sh
cd tools
make
sudo cp intel-virtual-output /usr/bin/
sudo chmod +x /usr/bin/intel-virtual-output
# Install augtool:
sudo apt-get install augeas-tools
Escreva este conteúdo para o arquivo /etc/bumblebee/dual-monitor/disable.aug
:
set /augeas/load/PHP/incl[last()] /etc/bumblebee/bumblebee.conf
set /augeas/load/Xorg/incl[last()] /etc/bumblebee/xorg.conf.nvidia
load
set /files/etc/bumblebee/bumblebee.conf/bumblebeed/KeepUnusedXServer false
set /files/etc/bumblebee/bumblebee.conf/driver-nvidia/PMMethod auto
set /files/etc/bumblebee/bumblebee.conf/driver-nouveau/PMMethod auto
set /files/etc/bumblebee/xorg.conf.nvidia/ServerLayout/Option[last() + 1] "AutoAddDevices"
set /files/etc/bumblebee/xorg.conf.nvidia/ServerLayout/Option[last()]/value "false"
set /files/etc/bumblebee/xorg.conf.nvidia/ServerLayout/Option[last() + 1] "AutoAddGPU"
set /files/etc/bumblebee/xorg.conf.nvidia/ServerLayout/Option[last()]/value "false"
set /files/etc/bumblebee/xorg.conf.nvidia/Device/Option[last() + 1] "UseEDID"
set /files/etc/bumblebee/xorg.conf.nvidia/Device/Option[last()]/value "false"
set /files/etc/bumblebee/xorg.conf.nvidia/Device/Option[last() + 1] "UseDisplayDevice"
set /files/etc/bumblebee/xorg.conf.nvidia/Device/Option[last()]/value "none"
save
Escreva este conteúdo para o arquivo /etc/bumblebee/dual-monitor/enable.aug
:
set /augeas/load/PHP/incl[last()] /etc/bumblebee/bumblebee.conf
set /augeas/load/Xorg/incl[last()] /etc/bumblebee/xorg.conf.nvidia
load
set /files/etc/bumblebee/bumblebee.conf/bumblebeed/KeepUnusedXServer true
set /files/etc/bumblebee/bumblebee.conf/driver-nvidia/PMMethod none
set /files/etc/bumblebee/bumblebee.conf/driver-nouveau/PMMethod none
rm /files/etc/bumblebee/xorg.conf.nvidia/ServerLayout/Option[. = "AutoAddDevices"]
rm /files/etc/bumblebee/xorg.conf.nvidia/ServerLayout/Option[. = "AutoAddGPU"]
rm /files/etc/bumblebee/xorg.conf.nvidia/Device/Option[. = "UseDisplayDevice"]
rm /files/etc/bumblebee/xorg.conf.nvidia/Device/Option[. = "UseEDID"]
save
Escreva este conteúdo para o arquivo /usr/local/bin/nvidia-enable
:
#!/bin/bash
sudo augtool --noload --file /etc/bumblebee/dual-monitor/enable.aug
sudo modprobe bbswitch
optirun true
intel-virtual-output
Escreva este conteúdo para o arquivo /usr/local/bin/nvidia-disable
:
#!/bin/bash
PID=$(ps ax | grep Xorg | grep :8 | grep -v grep | awk '{print }')
# Kill the second X server.
if [ ! -z $PID ]; then
sudo kill -15 $PID
fi
# Now you need to turn off nvidia card completely.
if lsmod | grep -q nvidia; then
sudo rmmod nvidia
fi
sudo tee /proc/acpi/bbswitch <<<OFF
sudo augtool --noload --file /etc/bumblebee/dual-monitor/disable.aug
sudo service bumblebeed restart
Definir permissões permanentes:
sudo chmod +x /usr/local/bin/nvidia-enable
sudo chmod +x /usr/local/bin/nvidia-disable
Agora você está pronto para executar: nvidia-enable
e nvidia-disable
para ativar e desativar a placa discreta da Nvidia e exibições externas.
Original artigo que recebe a maior parte dos créditos.