Section "Device" Identifier "nvidia" Driver "nvidia" # By default, the NVIDIA X driver will bail out if there # are no displays available. In order to ensure that the # X server can start with no heads connected directly to # the dGPU, you must add # 'Option "AllowEmptyInitialConfiguration"' to the # "Screen" section of xorg.conf. Option "AllowEmptyInitialConfiguration" VendorName "NVIDIA Corporation" EndSection
Section "Device" Identifier "intel" # By default, your xorg.conf will be set up such that only # the NVIDIA driver will be loaded. In order to ensure # that the iGPU’s heads are available for configuration, # the 'modesetting' driver must be specified. Driver "modesetting" VendorName "Intel Graphics" EndSection
# merge in defaults and keymaps if [ -f $sysresources ]; then xrdb -merge $sysresources fi
if [ -f $sysmodmap ]; then xmodmap $sysmodmap fi
if [ -f "$userresources" ]; then xrdb -merge "$userresources" fi
if [ -f "$usermodmap" ]; then xmodmap "$usermodmap" fi
# start some nice programs if [ -d /etc/X11/xinit/xinitrc.d ] ; then for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do [ -x "$f" ] && . "$f" done unset f fi
# Dual Display # The X server must be told to configure iGPU displays using PRIME. # This can be done using the ‘xrandr’ command line tool, # via ‘xrandr –setprovideroutputsource modesetting NVIDIA-0’. # If this fails, you can verify the available graphics devices # using ‘xrandr –listproviders’. xrandr --setprovideroutputsource modesetting NVIDIA-0 # Once PRIME is configured as described above, the iGPU’s heads may # be configured as if they were the dGPU’s with any RandR-aware tool, # be it ‘xrandr’ or a distro-provided graphical tool. The easiest way # to get something to display is ‘xrandr –auto’, but more complicated # configuration is possible as well. xrandr --auto # If your display dpi is not correct add the following line # xrandr --dpi 96
# Disable DPMS turning off the screen xset -dpms xset s off
# Enforce correct locales from the beginning: # LC_ALL is unset since it overwrites everything # LANG=de_DE.UTF-8 is used, except for: # LC_MESSAGES=C never translates program output # LC_TIME=en_DK leads to yyyy-mm-dd hh:mm date/time output unset LC_ALL export LANG=zh_CN.UTF-8 export LC_MESSAGES=C export LC_TIME=en_US.UTF-8
# Use XToolkit in java applications export AWT_TOOLKIT=XToolkit
# Set background color xsetroot -solid "#333333"
# Enable core dumps in case something goes wrong ulimit -c unlimited