Skip to content

Instantly share code, notes, and snippets.

@rogerzanoni
Created August 28, 2017 20:07
Show Gist options
  • Save rogerzanoni/9db83aaba40e3c3c99fd4519d0db874e to your computer and use it in GitHub Desktop.
Save rogerzanoni/9db83aaba40e3c3c99fd4519d0db874e to your computer and use it in GitHub Desktop.
dedicated-nvidia-config
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
exec i3
eval `ssh-agent -s`
xmodmap ~/.Xmodmap
xrdb -load ~/.Xresources
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:2:0:0"
EndSection
Section "Screen"
Identifier "nvidia"
Device "nvidia"
Option "AllowEmptyInitialConfiguration"
EndSection
Section "Device"
Identifier "intel"
Driver "modesetting"
EndSection
Section "Screen"
Identifier "intel"
Device "intel"
EndSection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment