[SCRIPT] Xorg.conf Generator and Switche...
 

[SCRIPT] Xorg.conf Generator and Switcher  

  RSS

(@christopher_herrmann)
Active Member
Joined: 5 months ago
Posts: 11
Jan 20, 2019 4:16 am  

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.
https://github.com/novel-notion/xswitcher.git

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. 

TL;DR
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 topic was modified 5 months ago

Dual Booting Ubuntu 18.04 with Windows 10
Huawei Matebook X Pro
Asus XG-Station Pro
Having Xorg.conf troubles? Check out my script, xswitcher!


ReplyQuote
theitsage
(@itsage)
Famed Member Admin
Joined: 3 years ago
Posts: 4000
Jan 20, 2019 12:13 pm  

@christopher_herrmann Thank you for your work and sharing this script. It's great to see eGPU in Linux is getting traction.

Best ultrabooks for eGPU use

eGPU enclosure buying guide

94 external GPU build guides


ReplyQuote
nu_ninja
(@nu_ninja)
Estimable Member
Joined: 1 year ago
Posts: 181
Jan 21, 2019 3:55 am  

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)

and

$(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.

This post was modified 2 months ago

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460/560 (AKiTiO Node/Thunder2)
+ macOS 10.14+Win10
+ Linux Mint 19.1


theitsage liked
ReplyQuote
(@christopher_herrmann)
Active Member
Joined: 5 months ago
Posts: 11
Jan 22, 2019 1:59 pm  

Great! A nice little collaboration. Did the setup script work correctly?

Dual Booting Ubuntu 18.04 with Windows 10
Huawei Matebook X Pro
Asus XG-Station Pro
Having Xorg.conf troubles? Check out my script, xswitcher!


ReplyQuote
nu_ninja
(@nu_ninja)
Estimable Member
Joined: 1 year ago
Posts: 181
Jan 23, 2019 12:00 am  

Yes the setup was all good, my pciID is 0a:00.0 which translates to 10:0:0 in the xorg script so I had to tweak that in the file.

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460/560 (AKiTiO Node/Thunder2)
+ macOS 10.14+Win10
+ Linux Mint 19.1


ReplyQuote
(@christopher_herrmann)
Active Member
Joined: 5 months ago
Posts: 11
Jan 23, 2019 2:24 pm  

Hmm. I knew that would be one of the shortcomings. I will see if I can automate that process entirely in the next version.

Dual Booting Ubuntu 18.04 with Windows 10
Huawei Matebook X Pro
Asus XG-Station Pro
Having Xorg.conf troubles? Check out my script, xswitcher!


ReplyQuote
Jey
 Jey
(@jey)
New Member
Joined: 5 months ago
Posts: 1
Jan 25, 2019 11:05 pm  

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


ReplyQuote
(@christopher_herrmann)
Active Member
Joined: 5 months ago
Posts: 11
Jan 28, 2019 2:51 am  

That would be the section in the xswitcher script that says:

Section "Module"
Load "modesetting"
EndSection

Line 30-32
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

This post was modified 5 months ago

Dual Booting Ubuntu 18.04 with Windows 10
Huawei Matebook X Pro
Asus XG-Station Pro
Having Xorg.conf troubles? Check out my script, xswitcher!


ReplyQuote
(@christopher_herrmann)
Active Member
Joined: 5 months ago
Posts: 11
Jan 28, 2019 8:25 pm  

Update #2:
The script should now be able to handle hex numbers just fine i.e. "0a" in hex will be converted into 10 in dec.

Dual Booting Ubuntu 18.04 with Windows 10
Huawei Matebook X Pro
Asus XG-Station Pro
Having Xorg.conf troubles? Check out my script, xswitcher!


nu_ninja liked
ReplyQuote
(@christopher_herrmann)
Active Member
Joined: 5 months ago
Posts: 11
Feb 2, 2019 3:32 am  

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?

Dual Booting Ubuntu 18.04 with Windows 10
Huawei Matebook X Pro
Asus XG-Station Pro
Having Xorg.conf troubles? Check out my script, xswitcher!


ReplyQuote
(@michael_watkins)
Active Member
Joined: 4 months ago
Posts: 6
Apr 20, 2019 5:29 am  

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


ReplyQuote