[SCRIPT] Xorg.conf Generator and Switcher
Hello everyone. I just finished whipping up a really basic script that I hope will help some people out.
This script automatically enables your eGPU when you boot with it plugged in, and disables the config when you boot without it.
You can find it here. Just clone the repo and then run setup.sh as root and that should be it.
The script looks for the PCI Bus ID of your eGPU and then will generate the xorg.conf seen in this post, with your own BusID substituted. So, in theory, it could work with multiple eGPU enclosures. If you are not docked, then it will delete the xorg.conf and everything will boot as normal.
The setup.sh script will make this script run on bootup before X loads.
While we still don't have hotplugging, I would like to think that this script brings us one step closer to true plug and play.
Run setup.sh and reboot. Booting with eGPU plugged in will generate xorg.conf. Booting w/o eGPU will just be a normal boot.
This works well with the gswitch script too, I just replaced the contents of the if and else in the xswitcher file with
$(yes n | gswitch egpu)
$(yes n | gswitch internal)
so then it gets setup automatically at boot, but you can also switch on the fly with just a logout through the gswitch gui.
Edit: Attached cleaned up version of the xswitcher file I used.
Great! A nice little collaboration. Did the setup script work correctly?
Hmm. I knew that would be one of the shortcomings. I will see if I can automate that process entirely in the next version.
hey buddy, i want to thank you for the nice script.
i tested it on parrot security OS. Workin flawless :)!
just a minor question, what do i need to change to keep the internal display active together with the egpu connected displays ?
Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts
That would be the section in the xswitcher script that says:
However that is not my xorg.conf so 50/50 if that is correct...
Edit: I did not write that xorg.conf is what I meant to say. Also, for some reason, my internal screen is still enabled despite having those lines in the xorg.conf file so YMMV
The script should now be able to handle hex numbers just fine i.e. "0a" in hex will be converted into 10 in dec.
Update #3: So something broke?
I am not really sure why things aren't working. I ran installed an update from the Software Center (via that little pop-up dialogue window). Now the xorg.config script no longer works. Has anyone else encountered this issue?
works great except running pop os 19.04 and when it goes to sleep and wakes up cannot control mouse or keyboard and x seems frozen have to manually power down
Pending: 2018 Lenovo X1 Extreme / Razer Core v2 my signature to give context to my posts