Score:1

How to add a Jupyter Notebook icon to my app menu?

zm flag

I am working on Jupyter Notebook and I want to see its icon in the Applications menu, but it is not there. I should also mention that I do not have Anaconda, and I installed Jupyter separately. Also its location is:

~/.local/bin/jupyter-notebook

I run this for using Jupyter every time.

Luuk avatar
cn flag
See: [How to use icons into the main Applications menu](https://askubuntu.com/questions/838035/how-to-use-icons-into-the-main-applications-menu)
Score:1
ca flag

To add a Jupyter Notebook launcher to start a Jupyter notebook from the applications menu do the following:

  1. Create a jupyter-notebook.desktop file in ~/.local/share/applications:

    touch ~/.local/share/applications/jupyter-notebook.desktop
    
  2. Open the file with a text editor (I'm using nano):

    nano ~/.local/share/applications/jupyter-notebook.desktop
    
  3. Add the following to the file:

    [Desktop Entry]
    Comment=Open a Jupyter Notebook in your browser
    Terminal=false
    Name=JupyterNotebook
    Exec="/full/path/to/jupyter-notebook" %f
    Type=Application
    

    Note that in the Exec field you have to use the full path to jupyter-notebook. So in your case you should add something like /home/user/.local/bin/jupyter-notebook instead of ~/.local/bin/jupyter-notebook, where user is your actual username.

  4. Save and close the file (Ctrl+O and then Ctrl+X in nano).

That's it! You should now be able to run Jupyter Notebook from your applications menu.


Note: Every time you open a Jupyter Notebook this way, a new Jupyter server will be launched as well, although without being shown in a terminal. If you close the browser tab that Jupyter Notebook runs in, the server will continue to run. So you'll have to close the server yourself. To do that you can use the jupyter notebook list command in a terminal, which will list all running servers, and then you'll have tot use jupyter notebook stop port, where port is the port that localhost runs on.

For example, I have started three Jupyter Notebooks using the applications menu launcher and I have closed the browser tabs. jupyter notebook list shows:

Currently running servers:
http://localhost:8889/?token=23b2468a3229ca7a18430cd48039fd95e0e6866d2a8cd5d5 :: /home/user
http://localhost:8888/?token=406937f75d9e564986d0e1c7929a9119c95eeff01b5bcca8 :: /home/user
http://localhost:8890/?token=2fa24c5385fe7dc4d0fc91cf267cff029571614e272f8453 :: /home/user

To close them I have to run:

jupyter notebook stop 8889
jupyter notebook stop 8888
jupyter notebook stop 8890
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.