atrueprincefanfrom18 wrote: ↑July 25th, 2020, 2:07 pm
Don't know how that's done. If you find a demonstration video, please let me know.
At what point are you stuck?
Anyway, I tried this on a computer with XUbuntu installed.
(It's like Ubuntu but with XFCE. This might mean that the things on my screenshots don't match your OS.)
There the menu item is called "Open With Other Application...".

- assoc_1_crop.png (21.65 KiB) Viewed 2829 times
The window which it opens looks like this:
At the bottom it's possible to use a custom command. I entered the full path to the SDLPoP executable there (not shown).
However! As the text at the top says, clicking "Open" now will associate SDLPoP with all "unknown" files, not just *.p1r files!
To add a new filetype for *.p1r files, do the following:
(Note: This is new for me as well. I figured things out from web searches, man pages, and from the existing files under ~/.local/share/mime/ .)
Create a file called
user-extension-p1r.xml with the following content:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-extension-p1r">
<comment>SDLPoP replay file</comment>
<glob pattern="*.p1r"/>
</mime-type>
</mime-info>
Then install it with this command:
Code: Select all
xdg-mime install user-extension-p1r.xml
You can also add an icon to *.p1r files with this command:
Code: Select all
xdg-icon-resource install --context mimetypes --size 32 SDLPoP/data/icon.png application-x-extension-p1r
Now *.p1r files have a separate filetype, and if you associate them with SDLPoP then it won't affect other kinds of files.
The association can also be done with a command if SDLPoP has a desktop file installed:
Code: Select all
xdg-mime default /usr/share/applications/SDLPoP.desktop application/x-extension-p1r
or if the desktop file is installed locally:
Code: Select all
xdg-mime default ~/.local/share/applications/SDLPoP.desktop application/x-extension-p1r
I guess I should add this to
make install.
Update: I did it on a new branch:
https://github.com/NagyD/SDLPoP/commit/ ... 23492fa373
By the way,
make install is usually ran with sudo.
But if I run the above
xdg-mime install command with sudo then it takes a rather long time.
I'm not sure why, maybe this way it looks through the system-wide installed filetypes?
For this reason, I changed the location of the SDLPoP.desktop file to the per-user path in the commit above so it can be used without sudo.