This worked for me as well! Figured I might as well post it as an answer -
Custom file associations
The following method creates a custom mime type and file association
manually. This is useful if your desktop does not have a mime
type/file association editor installed. In this example, a fictional
multimedia application 'foobar' will be associated with all *.foo
files. This will only affect the current user.
First, create the file
mkdir -p ~/.local/share/mime/packages
add this text:
<?xml version="1.0" encoding="UTF-8"?>
Note that you can use any icon, including one for another application.
Next, edit or create the file
~/.local/share/applications/foobar.desktop to contain something
Note that Categories should be set appropriately for the application
type (in this example, a multimedia app).
Now update the applications and mime database with:
Programs that use mime types, such as file managers, should now open
*.foo files with foobar. (You may need to restart your file manager to see the change.)