launcher - How to handle jupyter notebook files in Ubuntu? - Ask Ubuntu
recently project jupyter added mime-type ipynb files: application/x-ipynb+json
, , i'd launch these files without having allways launch terminal command:
cd /path/to/notebook jupyter notebook
so i've adapted blog post in order to:
- launch jupyter-notebook server when double clicking
ipynb
file - add icon
ipynb
files. - create desktop launcher launch jupyter notebook default folder or dragging , dropping file or folder.
here's how looks, , see answer below understand how this.
1. create ipynb.xml
mime-info file
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> <mime-type type="application/x-ipynb+json"> <comment>ipython notebook</comment> <glob pattern="*.ipynb"/> </mime-type> </mime-info>
then store file in ~/.local/share/mime
, update mime database.
cp ipynb.xml ~/.local/share/mime update-mime-database ~/.local/share/mime
2. create jupyter.desktop
file
caution: edit paths adapt system , habits.
[desktop entry] version=1.0 type=application name=jupyter icon="$home/.icons/jupyter-sq-text.svg" exec=/path/to/jupyter notebook %f path="$home/documents/notebooks" comment=jupyter notebook mimetype=application/x-ipynb+json; categories=science; terminal=true
then install desktop file:
desktop-file-install --dir="$home/.local/share/applications" jupyter.desktop
3. add jupyter icon
i chose svg version design repository of jupyter, , installed in ~/.local/share/icons
wget https://raw.githubusercontent.com/jupyter/design/master/logo/svg/jupyter-sq-text.svg -o $home/.local/share/icons/jupyter-sq-text.svg
finally, link mime-type icon system:
sudo ln -s $home/.local/share/icons/jupyter-sq-text.svg /usr/share/icons/gnome/scalable/mimetypes/application-x-ipynb+json.svg sudo gtk-update-icon-cache /usr/share/icons/gnome/ -f
hope that's help!
Comments
Post a Comment