set-egpu
set-egpu copied to clipboard
Possibly a better way to set eGPU
@mayankk2308 If you ever decide to optimize this script, I suggest you take a look at this PLIST file: ~/Library/Preferences/com.apple.LaunchServices/com.apple.LaunchServices.plist has a collection named "LSeGPUIsPreferred". Opening this collection we see a list of all app bundles.
For each app bundle we have two items. "Item 1" is a number. Prefer eGPU Selected = 3 Prefer eGPU Not Selected = 2
I think this would be the safest way to modify this via a script and also allow backing up this file if needed.
Example PLIST as XML:
The "data" field is BASE64 encoded.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSeGPUIsPreferred</key>
<dict>
<key>com.apple.BluetoothExplorer</key>
<array>
<data>Ym9vaxADAAAAAAQQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAIAAAQAAAADAwAAAAAAIAwAAAABAQAAQXBwbGljYXRpb25zGgAAAAEBAABBZGRpdGlvbmFsIFRvb2xzIGZvciBYY29kZQAACAAAAAEBAABIYXJkd2FyZRYAAAABAQAAQmx1ZXRvb3RoIEV4cGxvcmVyLmFwcAAAEAAAAAEGAAAQAAAAJAAAAEgAAABYAAAACAAAAAQDAAD5FVQLAAAAAAgAAAAEAwAAlxYBBwAAAAAIAAAABAMAAG1IAQcAAAAACAAAAAQDAACDTwEHAAAAABAAAAABBgAAkAAAAKAAAACwAAAAwAAAAAgAAAAABAAAQcIJu3QAAAAYAAAAAQIAAAIAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAgAAAABCQAAZmlsZTovLy8MAAAAAQEAAE1hY2ludG9zaCBIRAgAAAAEAwAAAKAgaHQAAAAIAAAAAAQAAEHBzOSKUFO7JAAAAAEBAAAxNDU0Q0Y1Ny0xQTRGLTQ4QzEtODVEMS0yMjQxNTI0RThFMTEYAAAAAQIAAIEAAAABAAAA7xMAAAEAAAAAAAAAAQAAAAEAA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+////AQAAAAAAAAAQAAAABBAAAEgAAAAAAAAABRAAAIwAAAAAAAAAEBAAALAAAAAAAAAAIBAAADQAAAAAAAAAMBAAAHwAAAAAAAAAQBAAAKAAAAAAAAAAAiAAAGABAAAAAAAABSAAANAAAAAAAAAAECAAAOAAAAAAAAAAESAAABQBAAAAAAAAEiAAAPQAAAAAAAAAEyAAAAQBAAAAAAAAICAAAEABAAAAAAAAMCAAAGwBAAAAAAAAENAAAAQAAAAAAAAAAP8AAHQBAAAAAAAA</data>
<integer>3</integer>
</array>
<key>com.apple.DVDPlayer</key>
<array>
<data>Ym9vaxADAAAAAAQQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAIAAAQAAAADAwAAAAAAIAYAAAABAQAAU3lzdGVtAAAHAAAAAQEAAExpYnJhcnkADAAAAAEBAABDb3JlU2VydmljZXMMAAAAAQEAAEFwcGxpY2F0aW9ucw4AAAABAQAARFZEIFBsYXllci5hcHAAABQAAAABBgAAEAAAACAAAAAwAAAARAAAAFgAAAAIAAAABAMAAORYAAD///8PCAAAAAQDAABZWQAA////DwgAAAAEAwAABscAAP///w8IAAAABAMAABd0AQD///8PCAAAAAQDAADFdAEA////DxQAAAABBgAAjAAAAJwAAACsAAAAvAAAAMwAAAAIAAAAAAQAAEHBiGotgAAAGAAAAAECAAACAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAIAAAAAQkAAGZpbGU6Ly8vDAAAAAEBAABNYWNpbnRvc2ggSEQIAAAABAMAAACgIGh0AAAACAAAAAAEAABBwczkilBTuyQAAAABAQAAMTQ1NENGNTctMUE0Ri00OEMxLTg1RDEtMjI0MTUyNEU4RTExGAAAAAECAACBAAAAAQAAAO8TAAABAAAAAAAAAAEAAAABAAAAAQEAAC8AAAAAAAAAAQUAADgAAAABAQAAL1N5c3RlbS9MaWJyYXJ5L0NvcmVTZXJ2aWNlcy9BcHBsaWNhdGlvbnMvRFZEIFBsYXllci5hcHDMAAAA/v///wEAAAAAAAAAEAAAAAQQAABwAAAAAAAAAAUQAADcAAAAAAAAABAQAAAIAQAAAAAAACAQAABYAAAAAAAAADAQAADMAAAAAAAAAEAQAAD4AAAAAAAAAAIgAAC4AQAAAAAAAAUgAAAoAQAAAAAAABAgAAA4AQAAAAAAABEgAABsAQAAAAAAABIgAABMAQAAAAAAABMgAABcAQAAAAAAACAgAACYAQAAAAAAADAgAADEAQAAAAAAABDQAAAEAAAAAAAAAAD/AADMAQAAAAAAAA==</data>
<integer>3</integer>
</array>
<key>com.mowglii.ItsycalApp</key>
<array>
<data>Ym9va3QCAAAAAAQQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAEAAAQAAAADAwAAAAAAIAwAAAABAQAAQXBwbGljYXRpb25zCwAAAAEBAABJdHN5Y2FsLmFwcAAIAAAAAQYAABAAAAAkAAAACAAAAAQDAADOCpYEAAAAAAgAAAAEAwAAAYxZBAAAAAAIAAAAAQYAAEgAAABYAAAACAAAAAAEAABBwbICFwAAABgAAAABAgAAAgAAAAAAAAAPAAAAAAAAAAAAAAAAAAAACAAAAAEJAABmaWxlOi8vLwwAAAABAQAATWFjaW50b3NoIEhECAAAAAQDAAAAoCBodAAAAAgAAAAABAAAQcHM5IpQU7skAAAAAQEAADE0NTRDRjU3LTFBNEYtNDhDMS04NUQxLTIyNDE1MjRFOEUxMRgAAAABAgAAgQAAAAEAAADvEwAAAQAAAAAAAAABAAAAAQAAAAEBAAAvAAAAAAAAAAEFAAAZAAAAAQEAAC9BcHBsaWNhdGlvbnMvSXRzeWNhbC5hcHAAAADMAAAA/v///wEAAAAAAAAAEAAAAAQQAAA4AAAAAAAAAAUQAABoAAAAAAAAABAQAACIAAAAAAAAACAQAAAkAAAAAAAAADAQAABYAAAAAAAAAEAQAAB4AAAAAAAAAAIgAAA4AQAAAAAAAAUgAACoAAAAAAAAABAgAAC4AAAAAAAAABEgAADsAAAAAAAAABIgAADMAAAAAAAAABMgAADcAAAAAAAAACAgAAAYAQAAAAAAADAgAABEAQAAAAAAABDQAAAEAAAAAAAAAAD/AABMAQAAAAAAAA==</data>
<integer>3</integer>
</array>
<key>com.apple.Safari</key>
<array>
<data>Ym9va3ACAAAAAAQQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbAEAAAQAAAADAwAAAAAAIAwAAAABAQAAQXBwbGljYXRpb25zCgAAAAEBAABTYWZhcmkuYXBwAAAIAAAAAQYAABAAAAAkAAAACAAAAAQDAAAGtykEAAAAAAgAAAAEAwAACbcpBAAAAAAIAAAAAQYAAEgAAABYAAAACAAAAAAEAABBwayxYgAAABgAAAABAgAAAgAAAAAAAAAPAAAAAAAAAAAAAAAAAAAACAAAAAEJAABmaWxlOi8vLwwAAAABAQAATWFjaW50b3NoIEhECAAAAAQDAAAAoCBodAAAAAgAAAAABAAAQcHM5IpQU7skAAAAAQEAADE0NTRDRjU3LTFBNEYtNDhDMS04NUQxLTIyNDE1MjRFOEUxMRgAAAABAgAAgQAAAAEAAADvEwAAAQAAAAAAAAABAAAAAQAAAAEBAAAvAAAAAAAAAAEFAAAYAAAAAQEAAC9BcHBsaWNhdGlvbnMvU2FmYXJpLmFwcMwAAAD+////AQAAAAAAAAAQAAAABBAAADgAAAAAAAAABRAAAGgAAAAAAAAAEBAAAIgAAAAAAAAAIBAAACQAAAAAAAAAMBAAAFgAAAAAAAAAQBAAAHgAAAAAAAAAAiAAADgBAAAAAAAABSAAAKgAAAAAAAAAECAAALgAAAAAAAAAESAAAOwAAAAAAAAAEiAAAMwAAAAAAAAAEyAAANwAAAAAAAAAICAAABgBAAAAAAAAMCAAAEQBAAAAAAAAENAAAAQAAAAAAAAAAP8AAEwBAAAAAAAA</data>
<integer>3</integer>
</array>
</dict>
</dict>
</plist>
Excellent find! I will consider incorporating it once I have the time. Thank you!
Your welcome :)
This plist doesn't exist by default? I don't see it on my work laptop. I'll check on my other macs soon.
I used FSMonitor to see what change when it’s triggered.
The process "lsd" is modifying this file every time the eGPU setting is toggled, no need to even close the Get Info window.
I’m on latest Catalina 10.15.5