Skip to content

Instantly share code, notes, and snippets.

@floriandejonckheere
Created February 3, 2017 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floriandejonckheere/9239430e3f8554202fc28c392840b287 to your computer and use it in GitHub Desktop.
Save floriandejonckheere/9239430e3f8554202fc28c392840b287 to your computer and use it in GitHub Desktop.
Enable/disable Bumblebee relevant services and modules
#!/bin/sh
if [[ "$1" == "stop" ]]; then
sudo systemctl stop nvidia-persistenced bumblebeed
sudo rmmod nvidia_modeset nvidia
echo OFF | sudo tee /proc/acpi/bbswitch
cat /proc/acpi/bbswitch
xrandr --output VIRTUAL3 --off --output VIRTUAL2 --off --output VIRTUAL1 --off --output VIRTUAL7 --off --output VIRTUAL6 --off --output VIRTUAL5 --off --output VIRTUAL4 --off --output VIRTUAL9 --off --output VIRTUAL8 --off --output LVDS1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output VGA1 --off
else
sudo systemctl start nvidia-persistenced bumblebeed
sudo modprobe bbswitch
sudo intel-virtual-output
xrandr --output VIRTUAL3 --off --output VIRTUAL2 --off --output VIRTUAL1 --mode VIRTUAL1.736-1440x900 --pos 1920x0 --rotate normal --output VIRTUAL7 --off --output VIRTUAL6 --off --output VIRTUAL5 --off --output VIRTUAL4 --off --output VIRTUAL9 --off --output VIRTUAL8 --off --output LVDS1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output VGA1 --off
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment