Skip to content

Instantly share code, notes, and snippets.

@krassowski
Last active February 11, 2025 10:50
Show Gist options
  • Save krassowski/90fdecc215f20f70f3125ce01044b132 to your computer and use it in GitHub Desktop.
Save krassowski/90fdecc215f20f70f3125ce01044b132 to your computer and use it in GitHub Desktop.

JupyterLab 4.3.5 with custom favicon

Binder

To customize:

  1. Find pageConfig by opening source of JupyterLab tab in the browser (e.g. Ctrl + U)
  2. Determine template source from value of templatesDir in pageConfig (here /srv/conda/envs/notebook/share/jupyter/lab/static/)
  3. Determine a suitable destination to store your templates and set it in the server config file, adjusting c.LabApp.templates_dir accordingly (here /home/jovyan/ just out of convenience)
  4. Put index.html in the destination directory
  5. Copy original index.html from source into the destination as base.html
{% extends "base.html" %}
{% block favicon %}
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>💤</text></svg>" class="idle favicon">
<link rel="" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🔥</text></svg>" class="busy favicon">
{% endblock %}
{
"LabApp": {
"templates_dir": "/home/jovyan"
}
}
jupyterlab==4.3.5
#!/bin/bash
set -e
echo $@
cp /srv/conda/envs/notebook/share/jupyter/lab/static/index.html /home/jovyan/base.html
exec jupyter-lab "${@:4}" --config jupyter-config.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment