Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement MIME type support on UNIX systems #1980

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

BioTheWolff
Copy link
Contributor

Problem description

This PR addresses issue #491 regarding the inability to open ImHex project files (.hexproj) directly from various UNIX Desktop Environments.

NB: This PR's scope is limited to UNIX systems, as I have no access to MacOS systems and could not find a way to automatically create file associations on Windows.

Implementation description

In order for project files to be recognised as such, we need to create a new MIME type. According to RFC 6838 section 3.2, additional application MIME types should be defined with a vendor prefix.
NB: This is preferred over the deprecated x- prefix, although RFC 6838 states that the vendor should be "a well known producer"

This PR proposes a new mime type for ImHex project files: application/vnd.imhex.proj, and associates it with the file format *.hexproj.

It also implements small changes in the Arch Linux and RPM builds, in order to correctly ship the MIME XML file during installation.

Additional things

The implemented change has been manually tested in the following UNIX systems and graphical environments:

  • Arch Linux, with Gnome 47.2
  • Arch Linux, with XFCE4
  • Fedora 41 Workstation Edition, with Gnome 47.0
  • Fedora 41 Plasma, with KDE Plasma 24.08.2
  • Ubuntu 22.04.5, with Gnome 42.9

Which tests the functionality of the following build types:

  • Arch Linux's .zst packages
  • Debian .deb packages
  • RPM packages

For Arch Linux and RPM packages, this has been tested to ensure that post-installation hooks (such as regeneration of the MIME database) is correctly executed (which it is). No further changes than those implemented in the PR are needed.

Implements support for mime types under the
`application/vnd.imhex.proj` subtype.
Allows for the automatic application launching through .hexproj files.

Fixes WerWolv#491

Signed-off-by: BioTheWolff <[email protected]>
Implement ImHex's mime subtype in package delivery for UNIX systems such
as ArchLinux, Debian, and RedHat and its derivatives.

Signed-off-by: BioTheWolff <[email protected]>
@WerWolv
Copy link
Owner

WerWolv commented Dec 3, 2024

Thank you very much! I'm happy to merge any later PRs adding the same thing to Windows and/or macOS. I have both available for testing. This in itself is great though

@WerWolv WerWolv merged commit 7032473 into WerWolv:master Dec 3, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants