Creating a shortcut to launch Jupyter Notebook.
An easy and short guide for Jupyter Notebook or other apps.
Here’s the situation, you use Jupyter Notebook but you’re tired of going to terminal, changing the directory, and launching Jupyter Notebook or Jupyter Lab. I have a solution for you!
First, let’s launch Terminal. We want to use the terminal to change the directory to where I want the shell
Then we want to type nano
plus the name of what you want the shell to be named (this can be changed later on) and with the extension .sh
.
This will trigger the GNU. Enter the directory that you want to load with Jupyter notebook and then you can add the code to launch Jupyter Notebook.
The code that was typed in the GNU will first change the directory to the folder that we will be using, then launches Jupyter Notebook. After we type the code, we need to save it. Press control+x
this will ask us if we want to save the changes. We type Y
to save changes and press Enter
to close the GNU.
Next, we need to make the shortcut executable, to do so, we need to type the following code:
chmod +x "name of shortcut".sh
ls -l "name of shortcut".sh
Finally, we need to tell it which program to use when opening the shell. To do so, we need to right click and select Open With
then Other
followed by clicking on All applications
and make sure Always Open With
is checked. Then all we need to do is select Terminal
as the program to use to open the shortcut.
And the shortcut has been created! But it’s not too pretty, so let’s zhuzh it up. We can add an icon by downloading it from google and we can also change the name to make it more presentable.
To work on the presentation, we’ll start by clicking on our shell and then pressing Command+I
this will bring our inspection tool. We can change the icon of our shortcut by copy-pasting the image to the icon that appears at the top right part of the window. We can change the name by rewriting it on the name and extension
In order to hide extension make sure to click hide extension
so it doesn’t show in the end.
There we go! Our new icon is set, now when you click the icon, Jupyter notebook will open with the directory that was coded.