Processing file association on Linux (Ubuntu)

I started using Linux Ubuntu this week and the first thing I realized when trying to install Processing is that it doesn’t appear in the apps panel nor is possible to execute the “Processing” file on the installation folder.
I used the “Main menu” app to solve the apps panel problem, but I can’t open an sketch directly from the sketch file as I used to in Windows. Processing isn’t the default app to open .pde files and I can’t change it because my computer doesn’t recognize Processing as an app.
Thank you

1 Like

You need to create a new mime-type and .desktop file.

1. Adding a mime type

Create a new file named text-pde.xml in the location ~/.local/share/mime/packages/. I prefer to do this using the terminal:

vim ~/.local/share/mime/packages/text-pde.xml

You can replace vim with the name of your preferred text/code editor (gedit if you’re on Ubuntu?).

Add the following code to this file:

<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
  <mime-type type="text/pde">
    <glob pattern="*.pde" />
  </mime-type>
</mime-info>

Now, run update-mime-database ~/.local/share/mime

2. The .desktop file

Next, create a new file named processing.desktop in the location ~/.local/share/applications/. Again, I prefer to do this using the terminal:

vim ~/.local/share/applications/processing.desktop

Add the following to it:

[Desktop Entry]
Name=Processing
Exec=/path/to/processing/processing %F
Icon=/path/to/processing/lib/icons/pde-256.png
Type=Application
Terminal=false

Of course, you’ll have to replace /path/to/processing with the relevant path to your Processing install.

Now, right-click on any sketch (.pde) file; select “open with” and browse the extended list of apps to set Processing to the default for that file type.

3 Likes
2 Likes