mriza / XMind-Linux-Installer

A simple BASH script to install XMind in Linux
GNU General Public License v3.0
54 stars 29 forks source link

File associations on Ubuntu 16.04 #5

Closed eagleofnorth closed 6 years ago

eagleofnorth commented 6 years ago

Thanks a lot for providing this script. Makes what seems impossible quite easy.

However after installing Xmind with this script Ubuntu 16.04 seems to treat .zip files and .xmind files in the same way:

I can set Ubuntu to open xmind files in Xmind (by right clicking an xmind file and go to properties). But then Ubuntu will also try to open .zip files in Xmind (!).

Thanks for all help!

eagleofnorth commented 6 years ago

I managed to solve this the following way:

Installation of Xmind 8 in Ubuntu 16.04

Add new mime type:

  1. Create a filed called /usr/share/mime/packages/xmind.xml with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
  <mime-type type="application/mindmap">
    <comment>Xmind files</comment>
    <icon name="application-xmind"/>
    <glob pattern="*.XMIND"/>
    <glob pattern="*.xmind"/>
  </mime-type>
</mime-info>
  1. Execute the following command to update mime database:
sudo update-mime-database /usr/share/mime

Add icon:

  1. Find a xmind icon that you want to use. It must be in SVG format. I used: http://www.iconarchive.com/show/papirus-apps-icons-by-papirus-team/xmind-icon.html

  2. Rename the SVG file to applications-mindmap.svg

  3. Move it to /usr/share/icons/hicolor/scalable/mimetypes

  4. Run the following command:

    sudo gtk-update-icon-cache /usr/share/icons/hicolor/ -f
mriza commented 6 years ago

thanks for your feedback, I will include this in the script, or you can contribute by forking it and make a pull request for the changes

mriza commented 6 years ago

https://github.com/mriza/XMind-Linux-Installer/commit/3a6dacf5300f539d768d55dfb8ed7a073e226614 https://github.com/mriza/XMind-Linux-Installer/commit/5ab1d8905b361d3c60a542b3ccd31276f1eb7a77