jupyter-matlab-proxy icon indicating copy to clipboard operation
jupyter-matlab-proxy copied to clipboard

How to pass additional startup commands to MATLAB through matlab-proxy-app?

Open TidbitSoftware opened this issue 2 years ago • 4 comments

Normally when calling matlab from the command line on my local machine, I will use the -r option with addpath commands to set up paths to directories containing custom MATLAB modules. I would do something similar for the MATLAB launcher in JupyterLab (installed on top of TLJH). I know how to do this for notebook kernel launchers. Is there something similar to kernel.json for the MATLAB launcher (specifically, that would allow me to modify the call to the matlab binary so that the -r option is passed)?

Edit: Also, I'm wondering if it is possible to move the launcher from 'Notebook' to 'Other'?

TidbitSoftware avatar Jan 20 '23 22:01 TidbitSoftware

I found what I was looking for in /opt/tljh/user/lib/python3.9/site-packages/jupyter_matlab_proxy/__init__.py.

I still would like to know about re-categorizing the launcher from 'Notebook' to 'Other' if anyone knows how to do this.

TidbitSoftware avatar Jan 24 '23 22:01 TidbitSoftware

Dear @TidbitSoftware

Thank you for the question. I think this is an interesting usecase for which we would like to design a supported solution. There isn't a trivial way to accomplish this at the moment.

I'm reopening this issue until a solution has been created for this.

prabhakk-mw avatar Jan 25 '23 02:01 prabhakk-mw

@TidbitSoftware To answer your other question " Ability to move launcher to Other from Notebook"

Unfortunately, this is controlled by the jupyter-server-proxy extension that we use to enable this capability and is outside of our control.

This PR (jupyterhub/jupyter-server-proxy#244), on the jupyter-server-proxy repository enables the ability to configure the location of the launcher icons. If and when it gets merged in, future versions of their package should enable this capability.

prabhakk-mw avatar Jan 31 '23 06:01 prabhakk-mw

Not sure how many different projects you work across but could you try setting your start-up folder as discussed in https://uk.mathworks.com/help/matlab/matlab_env/matlab-startup-folder.html and putting a startup.m in that folder?

rsp34 avatar Dec 19 '23 20:12 rsp34

@TidbitSoftware v0.18.0 of matlab-proxy has been released with support to provide a startup script to matlab-proxy-app.

See Run Custom MATLAB Startup Code

Thank you!

prabhakk-mw avatar May 24 '24 13:05 prabhakk-mw

Beautiful! Thanks for your work and attention on this Prabhakar! I'll get the chance to try implementing it soon.

TidbitSoftware avatar May 24 '24 17:05 TidbitSoftware