Skip to content

Instantly share code, notes, and snippets.

@richchurcher
Last active March 8, 2022 20:08
Embed
What would you like to do?
Asus G14 Zephyrus reverse PRIME config (Nvidia dGPU, AMD iGPU)
#!/bin/sh -e
# Only required if you use .Xresources, see below.
[[ ~/.Xresources ]] && xrdb -merge ~/.Xresources
# Only required if you use a compose key (I use PrtScr).
setxkbmap -option compose:prsc
# Set up the providers. The order is important here, as I understand it.
xrandr --setprovideroutputsource NVIDIA-GO modesetting
# Use this following the above if --auto works for you (I have a
# more specific config which --auto can't predict).
# xrandr --auto
# Set root background colour to solid black (otherwise i3/picom
# combination results in sort of opaque backgrounds which I find
# annoying). You may need to install community/hsetroot.
hsetroot -solid '#000000'
# Use a compositor. This was crucial to getting some Steam applications to
# display correctly, particularly those that use Proton. You'll probably
# need to install community/picom.
picom -b
# Start the window manager.
exec i3
Xft.dpi: 130
# Sample multi-monitor alias (one in portrait mode)
alias multi='xrandr --output DP-1-0 --mode 3840x2160 --right-of eDP-1 --output HDMI-1 --mode 3840x2160 --rotate left --right-of DP-1-0'
# /etc/X11/xorg.conf.d/g14-reverse-prime.conf
#
# Run one external monitor off the HDMI port, the other off the USB-C DP.
#
# lspci | grep VGA
# 01:00.0 VGA compatible controller: NVIDIA Corporation TU106M [GeForce RTX 2060 Max-Q] (rev a1)
# 04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Renoir (rev c5)
Section "Module"
Load "modesetting"
EndSection
Section "Device"
Identifier "iGPU"
Driver "modesetting"
BusID "PCI:4:0:0"
EndSection
Section "Device"
Identifier "dGPU"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection
Section "Screen"
Identifier "iGPU"
Device "iGPU"
EndSection
Section "Screen"
Identifier "dGPU"
Device "dGPU"
EndSection
Section "ServerLayout"
Identifier "layout"
Screen 0 "iGPU"
Inactive "dGPU"
Option "AllowNVIDIAGPUScreens"
EndSection
# .config/pcom/pcom.conf
shadow = false
vsync = true
mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 0
detect-transient = true
detect-client-leader = true
use-damage = true
log-level = "warn";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment