Change file type icon under Gnome?

HWP and HWPX are like DOC and DOCX. By default, it seems that EOS shows a good icon for the HWP file, but it shows a ZIP icon for the HWPX file. I changed the association from the archive manager to LibreOFfice, but the icon is still ZIP. How can I make HWPX have the same icon as HWP?

image

Hey there! :raised_hand_with_fingers_splayed: Changing icons in GNOME is actually pretty cool and straightforward. If you’re tired of seeing that boring ZIP icon for your HWPX files and want them to match the snazzy HWP icon, follow these steps:

  1. Get ‘Assogiate’:
    First, you gotta grab “Assogiate.” It’s like a secret agent for file associations in Linux. Install it from the Arch User Repository (AUR) using yay or your favorite AUR helper:

    yay -S assogiate
    
  2. Open Assogiate:
    Find “Assogiate” in your apps or type assogiate in the terminal.

  3. Hunt Down HWPX:
    In Assogiate, scroll through the list of MIME types to find the one related to HWPX files. It’s probably named “application/zip” or something similar.

  4. Give It a Makeover:
    Once you’ve located HWPX’s MIME type, click “Edit.”

  5. Choose a New Outfit:
    Look for the option to change the icon. It’s usually a tiny picture. Click on it and pick a fresh, stylish icon for your HWPX files. You can either use one from the list or upload your own.

  6. Save Your Changes:
    After you’ve chosen the new icon, hit “OK” to save your changes.

  7. Reload GNOME:
    To make sure your changes kick in, you might need to refresh GNOME. Do that by pressing Alt + F2, typing “r” in the Run Application box, and hitting Enter. GNOME will get a quick makeover!

  8. Check It Out:
    Now, open a HWPX file in your file manager, and voilà! It should sport the new icon you’ve picked.

And there you have it! Your HWPX files are ready to party with the same icon as HWP files. Enjoy your fresh look! :sunglasses::tada:

1 Like

Is the name correct? I cannot find it.

Also, the problem seems to be that the system is not recognising the “.hwpx” extension as a new type but it thinks it is a type of ZIP. That is, if I change the default app for the HWPX file to Writer, real ZIP files also get associated to Writer.

As far as I know, Windows determines the file type only by the file extension (that is, if you rename ‘test.zip’ to ‘test.txt’, it will treat it as a text file), but I suspect that Gnome actually read the file signature for files with unknown file extensions. Since HWPX, like DOCX, is actually a ZIP archive, it has the ZIP signature. It seems that since Gnome does not know about HWPX, it reads the file signature and thinks it as a ZIP file, and use the default app for ZIP and changing the default app for “HWPX” also changes that for ZIP.

I understand your frustration with not being able to find “Assogiate” in the AUR, and your observation about the file extension issue is spot on. :thinking:

You’re right that GNOME and other Linux desktop environments often rely on both file extensions and file signatures (magic numbers) to determine file types. This can sometimes lead to unintended associations, as you’ve described with the HWPX files and ZIP files.

To tackle this issue and make sure HWPX files are recognized correctly, you can try the following:

  1. File Association Method:
    As you mentioned, Linux desktop environments often use both file extensions and signatures. Since HWPX files are ZIP archives, they have the ZIP signature. This can lead to conflicts. To resolve this, you can manually edit the file association for HWPX files, making sure it doesn’t affect ZIP files:

    • Right-click on an HWPX file.
    • Choose “Properties” or “Open With Other Application.”
    • Select the application you want (e.g., LibreOffice Writer) and make sure to check the box that says “Set as default.”
    • Repeat this process for ZIP files but associate them with your preferred archive manager (e.g., File Roller).

This should help you set the default application for HWPX files without interfering with ZIP files.

  1. Extension Override:
    If the above method doesn’t work, you can try explicitly defining the file extension association in GNOME. To do this:

    • Open the terminal and run the following command to create a MIME type definition for HWPX files:

      xdg-mime default libreoffice-writer.desktop application/vnd.hancom.hwp
      
    • Now, run this command to make sure GNOME recognizes it:

      xdg-mime query default application/vnd.hancom.hwp
      

This should set the correct association for HWPX files without affecting ZIP files.

Give these methods a try, and hopefully, it will resolve the issue with HWPX files being treated as ZIP archives. If you have any further questions or run into any more snags, feel free to ask! :blush::+1: