Results 1 to 5 of 5

Thread: File suffix and type association

  1. #1
    Join Date
    Oct 2008
    Location
    Rezzoaglio (GE) Italy
    Beans
    693
    Distro
    Ubuntu Development Release

    File suffix and type association

    SweetHome3D uses files with suffix .sh3d but having internally a Zip format.
    On one partitions on my PC I have SweetHome3D installed via deb package, on a different partition I have the snap version of SweetHome3D. Both partitions are in Ubuntu Cosmic.
    For the deb version the default application for .sh3d files is SweetHome3D while for the snap version the default is ArchiveManager.
    If I select FileProperties-OpenWith for a .sh3d file
    on the 1st install (deb) I see: Select an application to open "casa.sh3d" and other files of type 'Sweet Home 3D'
    while on the 2nd install (snap) I see: Select an application to open "casa.sh3d" and other files of type 'Zip archives'
    I understand that the type 'Zip archives' comes from the internal format of the file, but this is overridden some part to force type 'Sweet Home 3D'
    Where is written that .sh3d is of type 'Sweet Home 3D' and not 'Zip archives'?
    Attached Images Attached Images

  2. #2
    Join Date
    Jun 2016
    Beans
    2,891
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: File suffix and type association

    /usr/share/mime/packages/sweethome3d.xml

    If you only need the change for one user, you can create a directory ~/.local/share/mime/packages and put this file there. If you need it system-wide it goes in /usr/share/mime/packages .

    For the contents of this file to take effect, you'll need to run -
    Code:
    update-mime-database <MIME directory you modified>
    where the "MIME directory" is the folder containing the packages folder, e.g. if you put the file in ~/.local/share/mime/packages the MIME directory is ~/.local/share/mime
    Refer to man update-mime-database for more info
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    If your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  3. #3
    Join Date
    Jun 2007
    Beans
    17,337

    Re: File suffix and type association

    I would think the snap has to provide that mime association (it doesn't..
    So maybe take the .deb's .xml & put it in youe ~/snap/sweethome3d-homedesign/4/.local/share/mime/packages/ folder and see,
    If no good start an issue in snapcraft.io forum

  4. #4
    Join Date
    Oct 2008
    Location
    Rezzoaglio (GE) Italy
    Beans
    693
    Distro
    Ubuntu Development Release

    Re: File suffix and type association

    copied the .deb's .xml to ~/.local/share/mime/packages and issued command:
    corrado@corrado-HP-p5-cc-0731:~$ update-mime-database ~/.local/share/mime
    ... now it works.
    thanks a lot

    opened an issue in snapcraft forum: https://forum.snapcraft.io/t/sweetho...hare-mime/6839

  5. #5
    Join Date
    Oct 2008
    Location
    Rezzoaglio (GE) Italy
    Beans
    693
    Distro
    Ubuntu Development Release

    Re: File suffix and type association

    copied to ~/snap/sweethome3d-homedesign/4/.local/share/mime
    but update-mime-database results in:
    corrado@corrado-HP-p6-cc-0801:~$ update-mime-database ~/snap/sweethome3d-homedesign/4/.local/share/mime
    Note that '/home/corrado/snap/sweethome3d-homedesign/4/.local/share' is not in the search path
    set by the XDG_DATA_HOME and XDG_DATA_DIRS
    environment variables, so applications may not
    be able to find it until you set them. The
    directories currently searched are:

    - /home/corrado/.local/share
    - /usr/share/ubuntu
    - /usr/local/share
    - /usr/share
    - /var/lib/snapd/desktop

    corrado@corrado-HP-p6-cc-0801:~$

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •