Is there a way to configure Ubuntu 18.04 to open Jupyter Notebooks with a double click from the graphical file browser?
There are 2 prominent Stack Overflow posts on the subject:
https://stackoverflow.com/questions/30953227/double-click-to-open-an-ipython-notebook
https://stackoverflow.com/questions/30953227/double-click-to-open-an-ipython-notebook/30955613
But most of the answers here pertain to MacOS, and the few relating to Linux did not seem to work for me on Ubuntu 18.04.
Something completely different from the above that I tried was to make a desktop file:
cd ~/.local/share/applications
gedit jupyter_notebook.desktop
In Gedit I entered this:
[Desktop Entry]
Comment=
Terminal=false
Name=JupyterNotebook
Exec="jupyter notebook" %f
Type=Application
But this did not work. Double-clicking on a .ipynb file still opens it in Chrome and shows the .json contents rather than running it as a notebook.
Has anybody actually gotten this functionality to work with Ubuntu 18.04?
You have to enter the full path to the
jupyter-notebook
executable in theExec
field of your .desktop file.You can find the full path of
jupyter-notebook
by running:So your .desktop file would become:
You also have to make your .desktop file executable, if you haven't already, by running:
Finally, right-click a .ipynb file, go to Properties → Open With → select JupyterNotebook from the list → Set as default.