Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-04-18 09:32:24

Bill53
Member
Registered: 2020-04-18
Posts: 6

[SOLVED]Creating MIME type association

Xubuntu 18.04.4

I installed Arduino from flatpak. Works fine but doesn't create the mime type for the .ino files.
The 'Mime Type Editor' in the GUI under Settings is not an editor, just a viewer - even if it is called 'editor'.

I tried running it from the terminal:
sudo /usr/bin/xfce4-mime-settings
Still doesn't give any editing tools.

So, how do I add a new type?
Thanks

Last edited by Bill53 (2020-04-18 13:54:42)

Offline

#2 2020-04-18 11:19:53

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,023

Re: [SOLVED]Creating MIME type association

Hello and welcome.

It's a manual process as there is no Xfce gui tool to do this, but it is not difficult. The arduino mime entry can be found here.

Copy the contents of this file to one called "arduino.xml" and place it in either:

  • /usr/share/mime/packages - for system-wide use

  • ~/.local/share/mime/packages - for single-user use

Then run:

sudo update-mime-database /usr/share/mime

...or:

update-mime-database ~/.local/share/mime

...depending on where you put the file.

The mimetype should then show up in xfce4-mime-settings.

Last edited by ToZ (2020-04-18 12:10:13)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2020-04-18 12:01:36

Bill53
Member
Registered: 2020-04-18
Posts: 6

Re: [SOLVED]Creating MIME type association

Thanks ToZ,

it's just that the link gives me a 404 ...
Tried searching github for 'arduino mime' no result.

But never mind.
If it is a manual process, might as well search for how to create the mime type.
Thanks again.

Cheers

Offline

#4 2020-04-18 12:09:45

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,023

Re: [SOLVED]Creating MIME type association

Fixed the link. Here is the arduino mime file from its source code.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2020-04-18 13:04:18

Bill53
Member
Registered: 2020-04-18
Posts: 6

Re: [SOLVED]Creating MIME type association

Fixed the link? WOW! That was fast! Thanks!

Meanwhile i found this, just in case someone comes across with the same issue.
For completeness.

https://coderwall.com/p/qjda2q/create-n … -in-ubuntu

In a nutshell:

Create the MIME-type file in:

/usr/share/mime/packages/
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
  <mime-type type="application/todo">
    <comment>Todos Text file</comment>
    <glob pattern="*.TODO"/>
    <glob pattern="*.todo"/>
  </mime-type>
</mime-info>

(This is a minimum. Combine this to your requirements with the xml file at the link above)

Then:

$ sudo update-mime-database /usr/share/mime

Give it an icon:
It MUST BE an svg type with the same name as you saved the XML file!
Save the icon to:

/usr/share/icons/gnome/scalable/mimetypes

!! This seems to be a Xubuntu specific directory !! (Xubuntu 18.04.4)

Then:

$ sudo gtk-update-icon-cache /usr/share/icons/gnome -f

Refresh the file browser.

Find more details and better explanation at the link above.

Last edited by Bill53 (2020-04-18 13:40:15)

Offline

Board footer

Powered by FluxBB