I need to start MATLAB with the parameters “env MESA_LOADER_DRIVER_OVERRIDE=i965”. I could edit my .desktop file and also add an alias in .bashrc. Now I need to set this environment override in a python script. I have tried
If you want env vars from the system you need import os
To set them ex: os.environ[MESA_LOADER_DRIVER_OVERRIDE]=i965
You can print them with ex: print(os.environ['MESA_LOADER_DRIVER_OVERRIDE'])
Traceback (most recent call last):
File "~/.config/nvim/plugged/vim-matlab/ftplugin/matlab/../../scripts/vim-matlab-server.py", line 28, in <module>
os.environ[MESA_LOADER_DRIVER_OVERRIDE]=i965 │
NameError: name 'i965' is not defined
[Process exited 1]
Since it already imports os, do I maybe have to set this environment variable in my .xintrc? The problem is that I only need this driver for MATLAB. I don’t want to set it as a global driver. An alias would work better, but that probably doesn’t get piped into python, does it?