For the LightDM display manager:
/etc/lightdm/display_setup.sh #!/bin/shxrandr --setprovideroutputsource modesetting NVIDIA-0xrandr --autoMake the script executable:
# chmod +x /etc/lightdm/display_setup.shNow configure lightdm to run the script by editing the [Seat:*] section in/etc/lightdm/lightdm.conf:
/etc/lightdm/lightdm.conf [Seat:*]display-setup-script=/etc/lightdm/display_setup.shNow reboot and your display manager should start.