9

The answer to this question points out that the "JupyterLab Dark" theme is now available as part of a vanilla jupyter-lab install.

How can I configure jupyter-lab so that it launches with this theme already applied on the first launch, so I don't have to manually select it every time I launch my jupyter docker container?

1

3 Answers 3

8

As the answer from mike and the comment from MarkusOdenthal did not work for me when I used the jupyter docker stacks I looked for a different solution and it seams using overrides.json is the current recommended approach:

https://jupyterlab.readthedocs.io/en/stable/user/directories.html#overridesjson

In short: check the application directory with jupyter lab path and place a file named overrides.json containing

{ "@jupyterlab/apputils-extension:themes": { "theme": "JupyterLab Dark" } } 

into <application directory>/settings/ (e.g. /opt/conda/share/jupyter/lab/settings/ for the official jupyter docker containers)

So if you want to have the base image from jupyter with dark theme, the Dockerfile would be

FROM jupyter/base-notebook COPY overrides.json /opt/conda/share/jupyter/lab/settings/ 
Sign up to request clarification or add additional context in comments.

Comments

7

Put this in ~/.jupyterlab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings

{ "theme": "JupyerLab Dark" } 

In the Dockerfile this might look like:

RUN mkdir -p ~/.jupyterlab/user-settings/@jupyterlab/apputils-extension/ && \ echo '{ "theme":"JupyterLab Dark" }' > themes.jupyterlab-settings 

2 Comments

In saturncloud.io you need to change URL a little bit from @mike. mkdir -p ~/.jupyter/lab/jupyterlab/user-settings/@jupyterlab/apputils-extension/ && echo '{ "theme":"JupyterLab Dark" }' > themes.jupyterlab-settings
A couple of issues... the path seems to be ~/jupyter/lab/user-settings... now with the extra slash. And whilst the mkdir makes the directory, the echo actually writes in the current directory if you don't cd there first.
0

Based on @mike's answer + @Mark Setchell's comment,

ARG USER=docker_user RUN mkdir -p /home/$USER/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ && \ echo '{ "theme":"JupyterLab Dark" }' > /home/$USER/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings 

For me the '~' to replace /home/$USER did not work as well

Important note: The .jupyterlab folder seemed to have changed to .jupyter/lab, as commented in the original answer

1 Comment

@mike, if you update your answer, I will be glad to discard the above answer. I put it here in the hope it saves the time to figure out the necessary modifications.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.