FedoraForum.org - Fedora Support Forums and Community
Results 1 to 13 of 13
  1. #1
    Join Date
    Jan 2010
    Location
    The Netherlands
    Age
    54
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How to associate a program to file extension

    I have installed an application MSGViewer, that enables me to read .msg files (Outlook eMail messages)
    The current use model is that I start MSGViewer application and drag&drop .msg file to open it.

    I would like to open .msg by just double clicking the file, or using "right mouse => Open With" option in the File Browser. The problem is that "right mouse => Open With => Other Application => Show Other Applications" does not list MSGViewer, so I can't select it.


    How to add MSGViewer into Show Other Applications list in the File Browser?

    The MSGViewer.desktop is located in the right directory:
    Code:
    [boris@e6410dl ~]$ ll /usr/share/applications/MSGViewer.desktop 
    -rw-r--r--. 1 root root 178 Mar 16 20:25 /usr/share/applications/MSGViewer.desktop
    I also tried adding the following line in both /usr/share/applications/defaults.list and /home/boris/.local/share/applications/mimeapps.list:
    Code:
    application/msg=MSGViewer.desktop
    None of the above produces a desired result.

    Any other suggestions that I could try?
    An explanation of handling default applications in Gnome would be very mach appreciated. It is very confusing why it has to be done in many different locations...
    Fedora39.GNOME@Dell_Latitude_E5440
    Fedora38.MATE@HP_Compaq_6830S
    SparkyLinux.5.16.LXQt@HP_Compaq_DC7100

  2. #2
    Join Date
    Aug 2010
    Location
    Al Ain, UAE
    Posts
    2,028
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to associate a program to file extension

    It is controlled by the MIME Extensions. Some googling on how to change that will find you the answer.

  3. #3
    Join Date
    Feb 2009
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to associate a program to file extension

    Try coping the desktop file to your home dir

    ~/.local/share/applications/

    Just make sure the visible is set to false

    Check out (dare I point to it) http://askubuntu.com/questions/71359...th-in-nautilus
    I've not tried it. Tell me how you get on.

  4. #4
    Join Date
    Apr 2009
    Location
    central NY, USA
    Posts
    1,728
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Re: How to associate a program to file extension

    Normally: right-click, properties, open with, {select}, set as default. But if it doesn't show up to be selected ... not sure where to go with that. Hmm.
    ---

  5. #5
    Join Date
    Jan 2010
    Location
    The Netherlands
    Age
    54
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to associate a program to file extension

    Quote Originally Posted by stevenjd13
    Try coping the desktop file to your home dir

    ~/.local/share/applications/

    Just make sure the visible is set to false

    Check out (dare I point to it) http://askubuntu.com/questions/71359...th-in-nautilus
    I've not tried it. Tell me how you get on.
    Thanks, but it did not work for me.
    By the way, setting "NoDisplay=true" removes the application from the application menu completely, so I can't even start it by clicking on the icon.
    Fedora39.GNOME@Dell_Latitude_E5440
    Fedora38.MATE@HP_Compaq_6830S
    SparkyLinux.5.16.LXQt@HP_Compaq_DC7100

  6. #6
    Join Date
    Jan 2010
    Location
    The Netherlands
    Age
    54
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to associate a program to file extension

    Quote Originally Posted by flyingfsck
    It is controlled by the MIME Extensions. Some googling on how to change that will find you the answer.
    This is an explanation that I needed. Unfortunately it does not solve my problem.
    I have identified that the correct mime type for .msg extension is "application/vnd.ms-outlook"
    MIME Types by Content Type

    I have changed /usr/share/applications/defaults.list entry accordingly:
    Code:
    application/vnd.ms-outlook=MSGViewer.desktop
    I also added MIME type definition in the /usr/share/applications/MSGViewer.desktop:
    Code:
    MimeType=application/vnd.ms-outlook
    It still does not work...

    Am I supposed to reboot the computer in order to see the effect? (I suppose not, this is not MS Windows...)
    Fedora39.GNOME@Dell_Latitude_E5440
    Fedora38.MATE@HP_Compaq_6830S
    SparkyLinux.5.16.LXQt@HP_Compaq_DC7100

  7. #7
    Join Date
    Aug 2010
    Location
    Al Ain, UAE
    Posts
    2,028
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to associate a program to file extension

    Not reboot, but you probably need to log out and back in, to restart Gnome/KDE/XFCE/whatever you are using.

  8. #8
    Join Date
    Jan 2010
    Location
    The Netherlands
    Age
    54
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Re: How to associate a program to file extension

    Log out/log in did not help. Also rebooting computer did not have any effect.

    Is there any other way to associate a program to a file extension?
    Suppose that I invent an extension, which is not a MIME type. How can associate a program to such extension?
    Fedora39.GNOME@Dell_Latitude_E5440
    Fedora38.MATE@HP_Compaq_6830S
    SparkyLinux.5.16.LXQt@HP_Compaq_DC7100

  9. #9
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    15,281
    Mentioned
    186 Post(s)
    Tagged
    0 Thread(s)

    Re: How to associate a program to file extension

    this seems to be about adding a custom application association to Gnome (for Redhat Beta 7 but that should be pretty similar to Fedora)

    https://access.redhat.com/site/docum...type-user.html

  10. #10
    dobbi Guest

    Re: How to associate a program to file extension

    root aka all users:
    /usr/share/applications/defaults.list

    local user:
    /usr/local/share/applications/defaults.list

    or

    /home/donatello/.local/share/applications/mimeapps.list

    Just add the entry to any of those files and it should associate that type of file to some application

    The desktop file should have the mimetype in there you can copy that or go to the binary and see its properties, if you need to create a new mimetype you can do so if you know how to edit xml files.

    How to create custom mimetypes and file association
    https://wiki.archlinux.org/index.php...e_associations

    Pay attention to the "updating the mime database part" or just reboot.

    When the right click open with don't show the application.
    Applications don't appear in the Open With... context menu (of a file manager)

    Sometimes, a certain application will not appear in the right-click Open With... dialog. To fix this problem, locate the .desktop file in /usr/share/applications, edit it as root, and add %U to the end of the Exec= line. For example, Kile currently has this problem; you need to edit /usr/share/applications/kde4/kile.desktop and change the line reading Exec=kile to read Exec=kile %U. Also, please file a bug against the upstream project if you notice this problem.

    You may also have to edit the MimeType list in the .desktop file if you install extensions that allow an application to handle additional MIME types.
    Source: https://wiki.archlinux.org/index.php...t_applications

    ps: If you have to do this by hand, contact the packager of that file to let him know that the desktop file is missing an argument. This is a minor issue.
    In Fedora this means going to bugzilla and filling a bugreport against the package if it is from the official repositories or if not you have to follow the rules of the repository you are using, rpmfusion have their own bugtracker.

    Resources:
    http://standards.freedesktop.org/des...ec-latest.html

    http://www.freedesktop.org/wiki/Spec...ime-info-spec/

    https://wiki.archlinux.org/index.php...t_applications
    Last edited by dobbi; 3rd April 2014 at 11:21 PM.

  11. #11
    Join Date
    Jan 2010
    Location
    The Netherlands
    Age
    54
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb Re: How to associate a program to file extension

    Thank you all on your valuable suggestions.

    Based on the input form different forums I have solved this and I would like to share the solution with you:
    The trick to make an application appear in nautilus menu "Open With => Other Application => Show Other Applications" is to add %U at the end of the Exec=application line in the application.destkop file.

    In this specific case the solution look like follows:
    Code:
    [boris@e6410dl applications]$ pwd
    /usr/share/applications
    [boris@e6410dl applications]$ ll MSGViewer.desktop 
    -rw-r--r--. 1 root root 216 Apr  7 10:01 MSGViewer.desktop
    [boris@e6410dl applications]$ cat MSGViewer.desktop | grep Exec
    Exec=/opt/MSGViewer/MSGViewer %U
    Now MSGViewer is also available in the "Open With => Other Application => Show Other Applications" menu of nautilus, and I can associate it with a file extension of choice.
    Fedora39.GNOME@Dell_Latitude_E5440
    Fedora38.MATE@HP_Compaq_6830S
    SparkyLinux.5.16.LXQt@HP_Compaq_DC7100

  12. #12
    Join Date
    Aug 2005
    Location
    Washington (the state), USA
    Age
    73
    Posts
    376
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to associate a program to file extension

    This thread solved my other problem of trying to make a custom script wrapper around mplayer the default app for videos types.

    I had to add the script desktop file to the [Default Applications] section of the /home/<myhome>/.local/share/applications/mimeapps.list file

    Why on earth did Gnome 3 decide to remove all the GUI capability to this? Especially since there is no documentation that I can find to explain how it works now. I have xfce on my older machines, and it still makes this kind of stuff easy.

  13. #13
    Join Date
    Nov 2018
    Location
    Switzerland
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to associate a program to file extension


Similar Threads

  1. associate file-types in firefox
    By drs in forum Using Fedora
    Replies: 6
    Last Post: 16th February 2006, 05:57 PM
  2. program extension associations
    By TDR in forum Using Fedora
    Replies: 0
    Last Post: 3rd October 2005, 08:59 AM
  3. associate extension to program, where???
    By TDR in forum Using Fedora
    Replies: 1
    Last Post: 27th September 2005, 09:45 PM

Tags for this Thread

Posting Permissions

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