bayasdev / envycontrol

Easy GPU switching for Nvidia Optimus laptops under Linux
MIT License
1.26k stars 61 forks source link

[REQUEST] Provide a way to customize lightdm setup script #134

Open rogueai opened 1 year ago

rogueai commented 1 year ago

I'm using envycontrol in conjunction with lightdm, it works fine, but I'd like to customize the generated /etc/lightdm/nvidia.sh

The default script looks like this:

xrandr --setprovideroutputsource "modesetting" NVIDIA-0
xrandr --auto

However I'm using autorandr to setup monitors' layout, so having xrandr to manage it interferes with autorandr. I currently hacked together something quick and dirty by forking envycontrol to have something like this instead:

xrandr --setprovideroutputsource "modesetting" NVIDIA-0
autorandr -c

It would be nice to have a generic way to configure what to do after the modesetting bit.

Apologies if there's already a way to achieve this, I've probably missed it, and thanks for the project!

ToneyFoxxy commented 10 months ago

Edit the script at /usr/lib/python3.11/site-packages/envycontrol.py line 199

NVIDIA_XRANDR_SCRIPT = '''#!/bin/sh
# Automatically generated by EnvyControl

xrandr --setprovideroutputsource "{}" NVIDIA-0
xrandr --auto
'''
NVIDIA_XRANDR_SCRIPT = '''#!/bin/sh
# Automatically generated by EnvyControl

xrandr --setprovideroutputsource "{}" NVIDIA-0
autorandr -c
'''

Then edit /etc/pacman.conf line 25 #IgnorePkg = IgnorePkg = envycontrol